From 2f67bbe7acab2d932dff84a2d6599f9be47c1579 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Wed, 25 Jan 2023 15:40:28 +0100 Subject: [PATCH] Update dart version + add null safety + add openapi generation with null safety --- lib/Components/Buttons/rounded_button.dart | 28 +- lib/Components/loading.dart | 2 +- lib/Components/rounded_input_field.dart | 14 +- lib/Components/text_field_container.dart | 6 +- lib/Helpers/DatabaseHelper.dart | 12 +- lib/Helpers/DeviceInfoHelper.dart | 4 +- lib/Helpers/MQTTHelper.dart | 65 +- lib/Models/ResponseSubDTO.dart | 22 +- lib/Models/map-marker.dart | 14 +- lib/Models/section.dart | 10 +- lib/Models/tabletContext.dart | 18 +- lib/Screens/Configuration/config_view.dart | 31 +- .../MainView/dropDown_configuration.dart | 20 +- lib/Screens/MainView/language_selection.dart | 30 +- lib/Screens/MainView/main_view.dart | 30 +- lib/Screens/Map/google_map_view.dart | 32 +- lib/Screens/Map/map_view.dart | 22 +- lib/Screens/Map/marker_view.dart | 6 +- lib/Screens/Menu/menu_view.dart | 30 +- lib/Screens/Previous/previous_view.dart | 52 +- lib/Screens/Quizz/quizz_view.dart | 56 +- lib/Screens/Quizz/showResponses.dart | 28 +- lib/Screens/Slider/slider_view.dart | 46 +- lib/Screens/Video/video_view.dart | 24 +- lib/Screens/Web/web_view.dart | 52 +- lib/Screens/custom_clipper.dart | 10 +- lib/api/openApi.dart | 14 + lib/api/swagger.yaml | 2239 +++++++++++++++++ lib/app_context.dart | 2 +- lib/client.dart | 30 +- lib/main.dart | 31 +- linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + manager_api/.gitignore | 32 +- manager_api/.openapi-generator/FILES | 17 +- manager_api/.openapi-generator/VERSION | 2 +- manager_api/.travis.yml | 2 +- manager_api/README.md | 25 +- manager_api/analysis_options.yaml | 0 manager_api/doc/ArticleDTO.md | 19 + manager_api/doc/AuthenticationApi.md | 18 +- manager_api/doc/ConfigurationApi.md | 64 +- manager_api/doc/ConfigurationDTO.md | 11 +- manager_api/doc/DeviceApi.md | 52 +- manager_api/doc/DeviceDTO.md | 5 +- manager_api/doc/DeviceDetailDTO.md | 5 +- manager_api/doc/DeviceDetailDTOAllOf.md | 4 +- manager_api/doc/ExportConfigurationDTO.md | 11 +- .../doc/ExportConfigurationDTOAllOf.md | 4 +- manager_api/doc/GeoPointDTO.md | 4 +- manager_api/doc/ImageDTO.md | 4 +- manager_api/doc/ImageGeoPoint.md | 4 +- manager_api/doc/Instance.md | 17 + manager_api/doc/InstanceApi.md | 229 ++ manager_api/doc/InstanceDTO.md | 17 + manager_api/doc/LevelDTO.md | 4 +- manager_api/doc/LoginDTO.md | 4 +- manager_api/doc/MapDTO.md | 4 +- manager_api/doc/MapTypeApp.md | 4 +- manager_api/doc/MenuDTO.md | 4 +- manager_api/doc/PlayerMessageDTO.md | 4 +- manager_api/doc/QuestionDTO.md | 4 +- manager_api/doc/QuizzDTO.md | 12 +- manager_api/doc/QuizzDTOBadLevel.md | 17 + manager_api/doc/ResourceApi.md | 66 +- manager_api/doc/ResourceDTO.md | 7 +- manager_api/doc/ResourceType.md | 4 +- manager_api/doc/ResponseDTO.md | 4 +- manager_api/doc/SectionApi.md | 152 +- manager_api/doc/SectionDTO.md | 10 +- manager_api/doc/SectionType.md | 4 +- manager_api/doc/SliderDTO.md | 4 +- manager_api/doc/TokenDTO.md | 5 +- manager_api/doc/TranslationDTO.md | 4 +- manager_api/doc/User.md | 5 +- manager_api/doc/UserApi.md | 36 +- manager_api/doc/UserDetailDTO.md | 4 +- manager_api/doc/VideoDTO.md | 4 +- manager_api/doc/WebDTO.md | 4 +- manager_api/git_push.sh | 7 +- manager_api/lib/api.dart | 9 +- manager_api/lib/api/authentication_api.dart | 152 +- manager_api/lib/api/configuration_api.dart | 339 +-- manager_api/lib/api/device_api.dart | 291 +-- manager_api/lib/api/instance_api.dart | 252 ++ manager_api/lib/api/resource_api.dart | 376 ++- manager_api/lib/api/section_api.dart | 737 +++--- manager_api/lib/api/user_api.dart | 231 +- manager_api/lib/api_client.dart | 276 +- manager_api/lib/api_exception.dart | 10 +- manager_api/lib/api_helper.dart | 80 +- manager_api/lib/auth/api_key_auth.dart | 29 +- manager_api/lib/auth/authentication.dart | 4 +- manager_api/lib/auth/http_basic_auth.dart | 11 +- manager_api/lib/auth/http_bearer_auth.dart | 23 +- manager_api/lib/auth/oauth.dart | 7 +- manager_api/lib/model/article_dto.dart | 160 ++ manager_api/lib/model/configuration_dto.dart | 228 +- manager_api/lib/model/device_detail_dto.dart | 242 +- .../lib/model/device_detail_dto_all_of.dart | 129 +- manager_api/lib/model/device_dto.dart | 196 +- .../lib/model/export_configuration_dto.dart | 246 +- .../export_configuration_dto_all_of.dart | 101 +- manager_api/lib/model/geo_point_dto.dart | 141 +- manager_api/lib/model/image_dto.dart | 131 +- manager_api/lib/model/image_geo_point.dart | 97 +- manager_api/lib/model/instance.dart | 136 + manager_api/lib/model/instance_dto.dart | 136 + manager_api/lib/model/level_dto.dart | 107 +- manager_api/lib/model/login_dto.dart | 97 +- manager_api/lib/model/map_dto.dart | 133 +- manager_api/lib/model/map_type_app.dart | 77 +- manager_api/lib/model/menu_dto.dart | 91 +- manager_api/lib/model/player_message_dto.dart | 109 +- manager_api/lib/model/question_dto.dart | 131 +- manager_api/lib/model/quizz_dto.dart | 123 +- .../lib/model/quizz_dto_bad_level.dart | 130 + manager_api/lib/model/resource_dto.dart | 152 +- manager_api/lib/model/resource_type.dart | 76 +- manager_api/lib/model/response_dto.dart | 119 +- manager_api/lib/model/section_dto.dart | 277 +- manager_api/lib/model/section_type.dart | 84 +- manager_api/lib/model/slider_dto.dart | 91 +- manager_api/lib/model/token_dto.dart | 156 +- manager_api/lib/model/translation_dto.dart | 97 +- manager_api/lib/model/user.dart | 158 +- manager_api/lib/model/user_detail_dto.dart | 113 +- manager_api/lib/model/video_dto.dart | 89 +- manager_api/lib/model/web_dto.dart | 89 +- manager_api/pubspec.lock | 405 +++ manager_api/pubspec.yaml | 14 +- manager_api/test/article_dto_test.dart | 47 + manager_api/test/authentication_api_test.dart | 7 +- manager_api/test/configuration_api_test.dart | 19 +- manager_api/test/configuration_dto_test.dart | 42 +- manager_api/test/device_api_test.dart | 9 +- .../test/device_detail_dto_all_of_test.dart | 7 +- manager_api/test/device_detail_dto_test.dart | 31 +- manager_api/test/device_dto_test.dart | 31 +- .../export_configuration_dto_all_of_test.dart | 7 +- .../test/export_configuration_dto_test.dart | 42 +- manager_api/test/geo_point_dto_test.dart | 7 +- manager_api/test/image_dto_test.dart | 7 +- manager_api/test/image_geo_point_test.dart | 7 +- manager_api/test/instance_api_test.dart | 46 + manager_api/test/instance_dto_test.dart | 37 + manager_api/test/instance_test.dart | 37 + manager_api/test/level_dto_test.dart | 7 +- manager_api/test/login_dto_test.dart | 7 +- manager_api/test/map_dto_test.dart | 9 +- manager_api/test/map_type_app_test.dart | 5 +- manager_api/test/menu_dto_test.dart | 7 +- manager_api/test/player_message_dto_test.dart | 12 +- manager_api/test/question_dto_test.dart | 7 +- .../test/quizz_dto_bad_level_test.dart | 37 + manager_api/test/quizz_dto_test.dart | 15 +- manager_api/test/resource_api_test.dart | 17 +- manager_api/test/resource_dto_test.dart | 17 +- manager_api/test/resource_type_test.dart | 5 +- manager_api/test/response_dto_test.dart | 7 +- manager_api/test/section_api_test.dart | 24 +- manager_api/test/section_dto_test.dart | 37 +- manager_api/test/section_type_test.dart | 5 +- manager_api/test/slider_dto_test.dart | 7 +- manager_api/test/token_dto_test.dart | 12 +- manager_api/test/translation_dto_test.dart | 7 +- manager_api/test/user_api_test.dart | 7 +- manager_api/test/user_detail_dto_test.dart | 7 +- manager_api/test/user_test.dart | 12 +- manager_api/test/video_dto_test.dart | 7 +- manager_api/test/web_dto_test.dart | 7 +- manager_api_old/.gitignore | 27 + manager_api_old/.openapi-generator-ignore | 23 + manager_api_old/.openapi-generator/FILES | 90 + manager_api_old/.openapi-generator/VERSION | 1 + manager_api_old/.travis.yml | 14 + manager_api_old/README.md | 161 ++ manager_api_old/doc/AuthenticationApi.md | 109 + manager_api_old/doc/ConfigurationApi.md | 317 +++ manager_api_old/doc/ConfigurationDTO.md | 20 + manager_api_old/doc/DeviceApi.md | 273 ++ manager_api_old/doc/DeviceDTO.md | 24 + manager_api_old/doc/DeviceDetailDTO.md | 28 + manager_api_old/doc/DeviceDetailDTOAllOf.md | 18 + manager_api_old/doc/ExportConfigurationDTO.md | 22 + .../doc/ExportConfigurationDTOAllOf.md | 16 + manager_api_old/doc/GeoPointDTO.md | 20 + manager_api_old/doc/ImageDTO.md | 19 + manager_api_old/doc/ImageGeoPoint.md | 16 + manager_api_old/doc/LevelDTO.md | 17 + manager_api_old/doc/LoginDTO.md | 16 + manager_api_old/doc/MapDTO.md | 19 + .../doc/MapType.md | 0 manager_api_old/doc/MapTypeApp.md | 14 + manager_api_old/doc/MenuDTO.md | 15 + manager_api_old/doc/PlayerMessageDTO.md | 16 + manager_api_old/doc/QuestionDTO.md | 19 + manager_api_old/doc/QuizzDTO.md | 19 + manager_api_old/doc/ResourceApi.md | 319 +++ manager_api_old/doc/ResourceDTO.md | 19 + .../doc/ResourceDetailDTO.md | 0 manager_api_old/doc/ResourceType.md | 14 + manager_api_old/doc/ResponseDTO.md | 17 + manager_api_old/doc/SectionApi.md | 685 +++++ manager_api_old/doc/SectionDTO.md | 27 + manager_api_old/doc/SectionType.md | 14 + manager_api_old/doc/SliderDTO.md | 15 + manager_api_old/doc/TokenDTO.md | 20 + manager_api_old/doc/TranslationDTO.md | 16 + manager_api_old/doc/User.md | 21 + manager_api_old/doc/UserApi.md | 229 ++ manager_api_old/doc/UserDetailDTO.md | 18 + manager_api_old/doc/VideoDTO.md | 15 + manager_api_old/doc/WebDTO.md | 15 + manager_api_old/git_push.sh | 58 + manager_api_old/lib/api.dart | 75 + .../lib/api/authentication_api.dart | 191 ++ .../lib/api/configuration_api.dart | 452 ++++ manager_api_old/lib/api/device_api.dart | 388 +++ manager_api_old/lib/api/resource_api.dart | 467 ++++ manager_api_old/lib/api/section_api.dart | 948 +++++++ manager_api_old/lib/api/user_api.dart | 325 +++ manager_api_old/lib/api_client.dart | 275 ++ manager_api_old/lib/api_exception.dart | 31 + manager_api_old/lib/api_helper.dart | 80 + manager_api_old/lib/auth/api_key_auth.dart | 35 + manager_api_old/lib/auth/authentication.dart | 15 + manager_api_old/lib/auth/http_basic_auth.dart | 21 + .../lib/auth/http_bearer_auth.dart | 38 + manager_api_old/lib/auth/oauth.dart | 23 + .../lib/model/configuration_dto.dart | 120 + .../lib/model/device_detail_dto.dart | 196 ++ .../lib/model/device_detail_dto_all_of.dart | 102 + manager_api_old/lib/model/device_dto.dart | 156 ++ .../lib/model/export_configuration_dto.dart | 138 + .../export_configuration_dto_all_of.dart | 80 + manager_api_old/lib/model/geo_point_dto.dart | 116 + manager_api_old/lib/model/image_dto.dart | 107 + .../lib/model/image_geo_point.dart | 80 + manager_api_old/lib/model/level_dto.dart | 89 + manager_api_old/lib/model/login_dto.dart | 80 + manager_api_old/lib/model/map_dto.dart | 107 + .../lib/model/map_type.dart | 0 manager_api_old/lib/model/map_type_app.dart | 85 + manager_api_old/lib/model/menu_dto.dart | 71 + .../lib/model/player_message_dto.dart | 80 + manager_api_old/lib/model/question_dto.dart | 107 + manager_api_old/lib/model/quizz_dto.dart | 107 + .../lib/model/resource_detail_dto.dart | 0 manager_api_old/lib/model/resource_dto.dart | 109 + manager_api_old/lib/model/resource_type.dart | 82 + manager_api_old/lib/model/response_dto.dart | 89 + manager_api_old/lib/model/section_dto.dart | 181 ++ manager_api_old/lib/model/section_type.dart | 88 + manager_api_old/lib/model/slider_dto.dart | 71 + manager_api_old/lib/model/token_dto.dart | 118 + .../lib/model/translation_dto.dart | 80 + manager_api_old/lib/model/user.dart | 127 + .../lib/model/user_detail_dto.dart | 98 + manager_api_old/lib/model/video_dto.dart | 71 + manager_api_old/lib/model/web_dto.dart | 71 + .../openapi-generator-cli-5.1.0.jar | Bin manager_api_old/pubspec.yaml | 20 + {manager_api => manager_api_old}/swagger.yaml | 0 .../swagger.yaml.bak | 0 .../test/authentication_api_test.dart | 30 + .../test/configuration_api_test.dart | 45 + .../test/configuration_dto_test.dart | 51 + manager_api_old/test/device_api_test.dart | 50 + .../test/device_detail_dto_all_of_test.dart | 41 + .../test/device_detail_dto_test.dart | 76 + manager_api_old/test/device_dto_test.dart | 56 + .../export_configuration_dto_all_of_test.dart | 31 + .../test/export_configuration_dto_test.dart | 61 + manager_api_old/test/geo_point_dto_test.dart | 51 + manager_api_old/test/image_dto_test.dart | 46 + .../test/image_geo_point_test.dart | 31 + manager_api_old/test/level_dto_test.dart | 36 + manager_api_old/test/login_dto_test.dart | 31 + manager_api_old/test/map_dto_test.dart | 46 + manager_api_old/test/map_type_app_test.dart | 20 + .../test/map_type_test.dart | 0 manager_api_old/test/menu_dto_test.dart | 26 + .../test/player_message_dto_test.dart | 26 + manager_api_old/test/question_dto_test.dart | 46 + manager_api_old/test/quizz_dto_test.dart | 46 + manager_api_old/test/resource_api_test.dart | 55 + .../test/resource_detail_dto_test.dart | 0 manager_api_old/test/resource_dto_test.dart | 41 + manager_api_old/test/resource_type_test.dart | 20 + manager_api_old/test/response_dto_test.dart | 36 + manager_api_old/test/section_api_test.dart | 90 + manager_api_old/test/section_dto_test.dart | 86 + manager_api_old/test/section_type_test.dart | 20 + manager_api_old/test/slider_dto_test.dart | 26 + manager_api_old/test/token_dto_test.dart | 51 + .../test/translation_dto_test.dart | 31 + manager_api_old/test/user_api_test.dart | 45 + .../test/user_detail_dto_test.dart | 41 + manager_api_old/test/user_test.dart | 56 + manager_api_old/test/video_dto_test.dart | 26 + manager_api_old/test/web_dto_test.dart | 26 + pubspec.lock | 725 +++++- pubspec.yaml | 34 +- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 307 files changed, 20195 insertions(+), 3554 deletions(-) create mode 100644 lib/api/openApi.dart create mode 100644 lib/api/swagger.yaml create mode 100644 manager_api/analysis_options.yaml create mode 100644 manager_api/doc/ArticleDTO.md create mode 100644 manager_api/doc/Instance.md create mode 100644 manager_api/doc/InstanceApi.md create mode 100644 manager_api/doc/InstanceDTO.md create mode 100644 manager_api/doc/QuizzDTOBadLevel.md create mode 100644 manager_api/lib/api/instance_api.dart create mode 100644 manager_api/lib/model/article_dto.dart create mode 100644 manager_api/lib/model/instance.dart create mode 100644 manager_api/lib/model/instance_dto.dart create mode 100644 manager_api/lib/model/quizz_dto_bad_level.dart create mode 100644 manager_api/pubspec.lock create mode 100644 manager_api/test/article_dto_test.dart create mode 100644 manager_api/test/instance_api_test.dart create mode 100644 manager_api/test/instance_dto_test.dart create mode 100644 manager_api/test/instance_test.dart create mode 100644 manager_api/test/quizz_dto_bad_level_test.dart create mode 100644 manager_api_old/.gitignore create mode 100644 manager_api_old/.openapi-generator-ignore create mode 100644 manager_api_old/.openapi-generator/FILES create mode 100644 manager_api_old/.openapi-generator/VERSION create mode 100644 manager_api_old/.travis.yml create mode 100644 manager_api_old/README.md create mode 100644 manager_api_old/doc/AuthenticationApi.md create mode 100644 manager_api_old/doc/ConfigurationApi.md create mode 100644 manager_api_old/doc/ConfigurationDTO.md create mode 100644 manager_api_old/doc/DeviceApi.md create mode 100644 manager_api_old/doc/DeviceDTO.md create mode 100644 manager_api_old/doc/DeviceDetailDTO.md create mode 100644 manager_api_old/doc/DeviceDetailDTOAllOf.md create mode 100644 manager_api_old/doc/ExportConfigurationDTO.md create mode 100644 manager_api_old/doc/ExportConfigurationDTOAllOf.md create mode 100644 manager_api_old/doc/GeoPointDTO.md create mode 100644 manager_api_old/doc/ImageDTO.md create mode 100644 manager_api_old/doc/ImageGeoPoint.md create mode 100644 manager_api_old/doc/LevelDTO.md create mode 100644 manager_api_old/doc/LoginDTO.md create mode 100644 manager_api_old/doc/MapDTO.md rename {manager_api => manager_api_old}/doc/MapType.md (100%) create mode 100644 manager_api_old/doc/MapTypeApp.md create mode 100644 manager_api_old/doc/MenuDTO.md create mode 100644 manager_api_old/doc/PlayerMessageDTO.md create mode 100644 manager_api_old/doc/QuestionDTO.md create mode 100644 manager_api_old/doc/QuizzDTO.md create mode 100644 manager_api_old/doc/ResourceApi.md create mode 100644 manager_api_old/doc/ResourceDTO.md rename {manager_api => manager_api_old}/doc/ResourceDetailDTO.md (100%) create mode 100644 manager_api_old/doc/ResourceType.md create mode 100644 manager_api_old/doc/ResponseDTO.md create mode 100644 manager_api_old/doc/SectionApi.md create mode 100644 manager_api_old/doc/SectionDTO.md create mode 100644 manager_api_old/doc/SectionType.md create mode 100644 manager_api_old/doc/SliderDTO.md create mode 100644 manager_api_old/doc/TokenDTO.md create mode 100644 manager_api_old/doc/TranslationDTO.md create mode 100644 manager_api_old/doc/User.md create mode 100644 manager_api_old/doc/UserApi.md create mode 100644 manager_api_old/doc/UserDetailDTO.md create mode 100644 manager_api_old/doc/VideoDTO.md create mode 100644 manager_api_old/doc/WebDTO.md create mode 100644 manager_api_old/git_push.sh create mode 100644 manager_api_old/lib/api.dart create mode 100644 manager_api_old/lib/api/authentication_api.dart create mode 100644 manager_api_old/lib/api/configuration_api.dart create mode 100644 manager_api_old/lib/api/device_api.dart create mode 100644 manager_api_old/lib/api/resource_api.dart create mode 100644 manager_api_old/lib/api/section_api.dart create mode 100644 manager_api_old/lib/api/user_api.dart create mode 100644 manager_api_old/lib/api_client.dart create mode 100644 manager_api_old/lib/api_exception.dart create mode 100644 manager_api_old/lib/api_helper.dart create mode 100644 manager_api_old/lib/auth/api_key_auth.dart create mode 100644 manager_api_old/lib/auth/authentication.dart create mode 100644 manager_api_old/lib/auth/http_basic_auth.dart create mode 100644 manager_api_old/lib/auth/http_bearer_auth.dart create mode 100644 manager_api_old/lib/auth/oauth.dart create mode 100644 manager_api_old/lib/model/configuration_dto.dart create mode 100644 manager_api_old/lib/model/device_detail_dto.dart create mode 100644 manager_api_old/lib/model/device_detail_dto_all_of.dart create mode 100644 manager_api_old/lib/model/device_dto.dart create mode 100644 manager_api_old/lib/model/export_configuration_dto.dart create mode 100644 manager_api_old/lib/model/export_configuration_dto_all_of.dart create mode 100644 manager_api_old/lib/model/geo_point_dto.dart create mode 100644 manager_api_old/lib/model/image_dto.dart create mode 100644 manager_api_old/lib/model/image_geo_point.dart create mode 100644 manager_api_old/lib/model/level_dto.dart create mode 100644 manager_api_old/lib/model/login_dto.dart create mode 100644 manager_api_old/lib/model/map_dto.dart rename {manager_api => manager_api_old}/lib/model/map_type.dart (100%) create mode 100644 manager_api_old/lib/model/map_type_app.dart create mode 100644 manager_api_old/lib/model/menu_dto.dart create mode 100644 manager_api_old/lib/model/player_message_dto.dart create mode 100644 manager_api_old/lib/model/question_dto.dart create mode 100644 manager_api_old/lib/model/quizz_dto.dart rename {manager_api => manager_api_old}/lib/model/resource_detail_dto.dart (100%) create mode 100644 manager_api_old/lib/model/resource_dto.dart create mode 100644 manager_api_old/lib/model/resource_type.dart create mode 100644 manager_api_old/lib/model/response_dto.dart create mode 100644 manager_api_old/lib/model/section_dto.dart create mode 100644 manager_api_old/lib/model/section_type.dart create mode 100644 manager_api_old/lib/model/slider_dto.dart create mode 100644 manager_api_old/lib/model/token_dto.dart create mode 100644 manager_api_old/lib/model/translation_dto.dart create mode 100644 manager_api_old/lib/model/user.dart create mode 100644 manager_api_old/lib/model/user_detail_dto.dart create mode 100644 manager_api_old/lib/model/video_dto.dart create mode 100644 manager_api_old/lib/model/web_dto.dart rename {manager_api => manager_api_old}/openapi-generator-cli-5.1.0.jar (100%) create mode 100644 manager_api_old/pubspec.yaml rename {manager_api => manager_api_old}/swagger.yaml (100%) rename {manager_api => manager_api_old}/swagger.yaml.bak (100%) create mode 100644 manager_api_old/test/authentication_api_test.dart create mode 100644 manager_api_old/test/configuration_api_test.dart create mode 100644 manager_api_old/test/configuration_dto_test.dart create mode 100644 manager_api_old/test/device_api_test.dart create mode 100644 manager_api_old/test/device_detail_dto_all_of_test.dart create mode 100644 manager_api_old/test/device_detail_dto_test.dart create mode 100644 manager_api_old/test/device_dto_test.dart create mode 100644 manager_api_old/test/export_configuration_dto_all_of_test.dart create mode 100644 manager_api_old/test/export_configuration_dto_test.dart create mode 100644 manager_api_old/test/geo_point_dto_test.dart create mode 100644 manager_api_old/test/image_dto_test.dart create mode 100644 manager_api_old/test/image_geo_point_test.dart create mode 100644 manager_api_old/test/level_dto_test.dart create mode 100644 manager_api_old/test/login_dto_test.dart create mode 100644 manager_api_old/test/map_dto_test.dart create mode 100644 manager_api_old/test/map_type_app_test.dart rename {manager_api => manager_api_old}/test/map_type_test.dart (100%) create mode 100644 manager_api_old/test/menu_dto_test.dart create mode 100644 manager_api_old/test/player_message_dto_test.dart create mode 100644 manager_api_old/test/question_dto_test.dart create mode 100644 manager_api_old/test/quizz_dto_test.dart create mode 100644 manager_api_old/test/resource_api_test.dart rename {manager_api => manager_api_old}/test/resource_detail_dto_test.dart (100%) create mode 100644 manager_api_old/test/resource_dto_test.dart create mode 100644 manager_api_old/test/resource_type_test.dart create mode 100644 manager_api_old/test/response_dto_test.dart create mode 100644 manager_api_old/test/section_api_test.dart create mode 100644 manager_api_old/test/section_dto_test.dart create mode 100644 manager_api_old/test/section_type_test.dart create mode 100644 manager_api_old/test/slider_dto_test.dart create mode 100644 manager_api_old/test/token_dto_test.dart create mode 100644 manager_api_old/test/translation_dto_test.dart create mode 100644 manager_api_old/test/user_api_test.dart create mode 100644 manager_api_old/test/user_detail_dto_test.dart create mode 100644 manager_api_old/test/user_test.dart create mode 100644 manager_api_old/test/video_dto_test.dart create mode 100644 manager_api_old/test/web_dto_test.dart diff --git a/lib/Components/Buttons/rounded_button.dart b/lib/Components/Buttons/rounded_button.dart index e6fb746..2a6ce58 100644 --- a/lib/Components/Buttons/rounded_button.dart +++ b/lib/Components/Buttons/rounded_button.dart @@ -2,16 +2,16 @@ import 'package:flutter/material.dart'; import 'package:tablet_app/constants.dart'; class RoundedButton extends StatelessWidget { - final String text; - final Function press; - final IconData icon; - final Color color, textColor; - final double fontSize; - final double vertical; - final double horizontal; + final String? text; + final Function? press; + final IconData? icon; + final Color? color, textColor; + final double? fontSize; + final double? vertical; + final double? horizontal; const RoundedButton({ - Key key, + Key? key, this.text, this.press, this.icon, @@ -27,8 +27,8 @@ class RoundedButton extends StatelessWidget { //Size size = MediaQuery.of(context).size; return TextButton( style: ButtonStyle( - padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical : 25, horizontal: this.horizontal != null ? this.horizontal : (icon == null ? 85 : 30))), - backgroundColor: MaterialStateColor.resolveWith((states) => color), + padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical! : 25, horizontal: this.horizontal != null ? this.horizontal! : (icon == null ? 85 : 30))), + backgroundColor: MaterialStateColor.resolveWith((states) => color!), shape: MaterialStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(30.0), @@ -37,7 +37,7 @@ class RoundedButton extends StatelessWidget { ), onPressed: () => { - press() + press!() }, child: getValue(icon) ); @@ -50,7 +50,7 @@ class RoundedButton extends StatelessWidget { children: [ Center( child: Text( - text, + text!, style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), ), ), @@ -60,13 +60,13 @@ class RoundedButton extends StatelessWidget { Icon( icon, color: textColor, - size: fontSize + 8, + size: fontSize! + 8, ) ], ); } else { return Text( - text, + text!, style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), ); } diff --git a/lib/Components/loading.dart b/lib/Components/loading.dart index 8853516..52202cc 100644 --- a/lib/Components/loading.dart +++ b/lib/Components/loading.dart @@ -2,7 +2,7 @@ import 'package:flare_flutter/flare_actor.dart'; import 'package:flutter/material.dart'; class Loading extends StatelessWidget { - Loading({Key key}) : super(key: key); + Loading({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/Components/rounded_input_field.dart b/lib/Components/rounded_input_field.dart index 8b1f335..550de92 100644 --- a/lib/Components/rounded_input_field.dart +++ b/lib/Components/rounded_input_field.dart @@ -3,14 +3,14 @@ import 'package:tablet_app/Components/text_field_container.dart'; import 'package:tablet_app/constants.dart'; class RoundedInputField extends StatelessWidget { - final String hintText; - final IconData icon; - final ValueChanged onChanged; - final String initialValue; - final Color color, textColor, iconColor; - final int maxLength; + final String? hintText; + final IconData? icon; + final ValueChanged? onChanged; + final String? initialValue; + final Color? color, textColor, iconColor; + final int? maxLength; const RoundedInputField({ - Key key, + Key? key, this.hintText, this.initialValue, this.icon, diff --git a/lib/Components/text_field_container.dart b/lib/Components/text_field_container.dart index 3f929b7..ddc298b 100644 --- a/lib/Components/text_field_container.dart +++ b/lib/Components/text_field_container.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; import 'package:tablet_app/constants.dart'; class TextFieldContainer extends StatelessWidget { - final Widget child; - final Color color; + final Widget? child; + final Color? color; const TextFieldContainer({ - Key key, + Key? key, this.child, this.color = kBackgroundGrey, }) : super(key: key); diff --git a/lib/Helpers/DatabaseHelper.dart b/lib/Helpers/DatabaseHelper.dart index 0ed24e5..91029ca 100644 --- a/lib/Helpers/DatabaseHelper.dart +++ b/lib/Helpers/DatabaseHelper.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:path/path.dart'; import 'package:sqflite/sqflite.dart'; import 'package:tablet_app/Models/tabletContext.dart'; @@ -20,11 +20,11 @@ class DatabaseHelper { DatabaseHelper._privateConstructor(); static final DatabaseHelper instance = DatabaseHelper._privateConstructor(); - static Database _database; + static Database? _database; Future get database async { - if (_database != null) return _database; + if (_database != null) return _database!; _database = await _initDatabase(); - return _database; + return _database!; } _initDatabase() async { @@ -76,13 +76,13 @@ class DatabaseHelper { return await db.delete(table, where: '$columnId = ?', whereArgs: [email]); } - Future clearTable() async { + Future>> clearTable() async { Database db = await instance.database; return await db.rawQuery("DELETE FROM $table"); } Future getData() async { - TabletAppContext tabletAppContext; + TabletAppContext tabletAppContext = TabletAppContext(); await DatabaseHelper.instance.queryAllRows().then((value) { value.forEach((element) { diff --git a/lib/Helpers/DeviceInfoHelper.dart b/lib/Helpers/DeviceInfoHelper.dart index 458e4a4..75e7133 100644 --- a/lib/Helpers/DeviceInfoHelper.dart +++ b/lib/Helpers/DeviceInfoHelper.dart @@ -4,10 +4,10 @@ import 'package:device_info/device_info.dart'; import 'package:flutter/services.dart'; class DeviceInfoHelper { - static Future getDeviceDetails() async { + static Future getDeviceDetails() async { /* String deviceName; String deviceVersion;*/ - String identifier; + String? identifier; final DeviceInfoPlugin deviceInfoPlugin = new DeviceInfoPlugin(); try { if (Platform.isAndroid) { diff --git a/lib/Helpers/MQTTHelper.dart b/lib/Helpers/MQTTHelper.dart index 96fc469..eb4ec86 100644 --- a/lib/Helpers/MQTTHelper.dart +++ b/lib/Helpers/MQTTHelper.dart @@ -1,9 +1,7 @@ import 'dart:convert'; -import 'dart:developer'; - import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:mqtt_client/mqtt_client.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:tablet_app/Helpers/DeviceInfoHelper.dart'; @@ -20,8 +18,9 @@ class MQTTHelper { print('Connected !!!!!!!!!!!! ----------------------------------'); TabletAppContext tabletAppContext = appContext.getContext(); - tabletAppContext.clientMQTT.updates.listen((List> c) async { - final MqttPublishMessage message = c[0].payload; + tabletAppContext.clientMQTT!.updates!.listen((List> c) async { + final MqttPublishMessage message = c[0].payload as MqttPublishMessage; + final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message); print('Received message:$payload from topic: ${c[0].topic}'); @@ -36,14 +35,14 @@ class MQTTHelper { print("Check if tablet config"); print(tabletAppContext.configuration); if (tabletAppContext.configuration != null) { - if (tabletAppContext.configuration.id == configId) { + if (tabletAppContext.configuration!.id == configId) { // refresh config try { - PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload)); + PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload))!; var isConfigChanged = playerMessage.configChanged != null ? playerMessage.configChanged : false; var isDeleted = playerMessage.isDeleted != null ? playerMessage.isDeleted : false; print(isDeleted); - if (isDeleted) { + if (isDeleted!) { // Clear all print("isDeleted"); tabletAppContext.configuration = null; @@ -52,7 +51,7 @@ class MQTTHelper { await DatabaseHelper.instance.update(tabletAppContext); } else { - if (isConfigChanged) { + if (isConfigChanged!) { updateConfig(appContext); } } @@ -70,9 +69,9 @@ class MQTTHelper { // refresh device info try { - PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload)); + PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload))!; var isConfigChanged = playerMessage.configChanged != null ? playerMessage.configChanged : false; - if (isConfigChanged) { + if (isConfigChanged!) { updateDevice(appContext); } } @@ -109,19 +108,19 @@ class MQTTHelper { var identifier = await DeviceInfoHelper.getDeviceDetails(); var hostToTake = tabletAppContext.host; - if(tabletAppContext.host.lastIndexOf(":") > 5) + if(tabletAppContext.host!.lastIndexOf(":") > 5) { - hostToTake = tabletAppContext.host.substring(0,tabletAppContext.host.lastIndexOf(":")); + hostToTake = tabletAppContext.host!.substring(0,tabletAppContext.host!.lastIndexOf(":")); } - tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake.replaceAll('http://', ''), 'tablet_app_'+identifier, 1883); + tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('http://', ''), 'tablet_app_'+identifier!, 1883); isInstantiated = true; - tabletAppContext.clientMQTT.logging(on: false); - tabletAppContext.clientMQTT.keepAlivePeriod = 20; - tabletAppContext.clientMQTT.onDisconnected = onDisconnected; - tabletAppContext.clientMQTT.onConnected = () => onConnected(appContext); - tabletAppContext.clientMQTT.onSubscribed = onSubscribed; + tabletAppContext.clientMQTT!.logging(on: false); + tabletAppContext.clientMQTT!.keepAlivePeriod = 20; + tabletAppContext.clientMQTT!.onDisconnected = onDisconnected; + tabletAppContext.clientMQTT!.onConnected = () => onConnected(appContext); + tabletAppContext.clientMQTT!.onSubscribed = onSubscribed; var message = { "deviceId": tabletAppContext.deviceId != null ? tabletAppContext.deviceId : identifier, @@ -132,23 +131,23 @@ class MQTTHelper { .keepAliveFor(60) .withWillTopic('player/status') .withWillMessage(jsonEncode(message)) - .withClientIdentifier('tablet_app_'+identifier) + .withClientIdentifier('tablet_app_'+identifier!) .startClean() .withWillQos(MqttQos.atLeastOnce); - tabletAppContext.clientMQTT.connectionMessage = connMessage; - tabletAppContext.clientMQTT.autoReconnect = true; + tabletAppContext.clientMQTT!.connectionMessage = connMessage; + tabletAppContext.clientMQTT!.autoReconnect = true; try { - await tabletAppContext.clientMQTT.connect(); + await tabletAppContext.clientMQTT!.connect(); // For get config changed request if(tabletAppContext.configuration != null) { - tabletAppContext.clientMQTT.subscribe('config/#', MqttQos.atLeastOnce); + tabletAppContext.clientMQTT!.subscribe('config/#', MqttQos.atLeastOnce); } // For get device assignation config request if(tabletAppContext.deviceId != null) { - tabletAppContext.clientMQTT.subscribe('player/${tabletAppContext.deviceId}', MqttQos.atLeastOnce); + tabletAppContext.clientMQTT!.subscribe('player/${tabletAppContext.deviceId}', MqttQos.atLeastOnce); var message = { "deviceId": tabletAppContext.deviceId, @@ -159,21 +158,21 @@ class MQTTHelper { final builder = MqttClientPayloadBuilder(); builder.addString(jsonEncode(message)); - tabletAppContext.clientMQTT.publishMessage(pubTopic, MqttQos.atLeastOnce, builder.payload); + tabletAppContext.clientMQTT!.publishMessage(pubTopic, MqttQos.atLeastOnce, builder.payload!); } } catch (e) { print('Exception: $e'); - tabletAppContext.clientMQTT.disconnect(); + tabletAppContext.clientMQTT!.disconnect(); } - return tabletAppContext.clientMQTT; + return tabletAppContext.clientMQTT!; } Future updateDevice(dynamic appContext) async { print("updateDevice"); TabletAppContext tabletAppContext = appContext.getContext(); - DeviceDetailDTO device = await tabletAppContext.clientAPI.deviceApi.deviceGetDetail(tabletAppContext.deviceId); + DeviceDetailDTO? device = await tabletAppContext.clientAPI!.deviceApi!.deviceGetDetail(tabletAppContext.deviceId!); print(device); @@ -181,7 +180,7 @@ class MQTTHelper { // STORE IT LOCALLY !! TabletAppContext tabletAppContext = appContext.getContext(); tabletAppContext.deviceId = device.id; - tabletAppContext.configuration.id = device.configurationId; + tabletAppContext.configuration!.id = device.configurationId; appContext.setContext(tabletAppContext); @@ -214,15 +213,15 @@ class MQTTHelper { print("update config"); TabletAppContext tabletAppContext = appContext.getContext(); - ConfigurationDTO configuration = await tabletAppContext.clientAPI.configurationApi.configurationGetDetail(tabletAppContext.configuration.id); + ConfigurationDTO? configuration = await tabletAppContext.clientAPI!.configurationApi!.configurationGetDetail(tabletAppContext.configuration!.id!); if (configuration != null) { // STORE IT LOCALLY !! TabletAppContext tabletAppContext = appContext.getContext(); tabletAppContext.configuration = configuration; - if(!configuration.languages.contains(tabletAppContext.language)) { - tabletAppContext.language = configuration.languages[0]; + if(!configuration.languages!.contains(tabletAppContext.language)) { + tabletAppContext.language = configuration.languages![0]; } appContext.setContext(tabletAppContext); diff --git a/lib/Models/ResponseSubDTO.dart b/lib/Models/ResponseSubDTO.dart index d29a2ed..2728793 100644 --- a/lib/Models/ResponseSubDTO.dart +++ b/lib/Models/ResponseSubDTO.dart @@ -1,9 +1,9 @@ -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; class ResponseSubDTO { - List label; - bool isGood; - int order; + List? label; + bool? isGood; + int? order; ResponseSubDTO({this.label, this.isGood, this.order}); @@ -25,12 +25,12 @@ class ResponseSubDTO { } class QuestionSubDTO { - List label; - List responsesSubDTO; - int chosen; - String resourceId; - String source_; - int order; + List? label; + List? responsesSubDTO; + int? chosen; + String? resourceId; + String? source_; + int? order; QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order}); @@ -41,7 +41,7 @@ class QuestionSubDTO { questionSubDTO.add(new QuestionSubDTO( chosen: null, label: questionDTO.label, - responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses), + responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses!), resourceId: questionDTO.resourceId, source_: questionDTO.source_, order: questionDTO.order, diff --git a/lib/Models/map-marker.dart b/lib/Models/map-marker.dart index b8102c3..8a3115c 100644 --- a/lib/Models/map-marker.dart +++ b/lib/Models/map-marker.dart @@ -1,12 +1,12 @@ -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; class MapMarker { - int id; - String title; - String description; - List images; - String latitude; - String longitude; + int? id; + String? title; + String? description; + List? images; + String? latitude; + String? longitude; MapMarker({this.id, this.title, this.description, this.images, this.latitude, this.longitude}); diff --git a/lib/Models/section.dart b/lib/Models/section.dart index 47a5700..5c227cc 100644 --- a/lib/Models/section.dart +++ b/lib/Models/section.dart @@ -1,9 +1,9 @@ class Section { - int id; - String title; - String description; - String image; - int category; + int? id; + String? title; + String? description; + String? image; + int? category; Section({this.id, this.title, this.description, this.image, this.category}); diff --git a/lib/Models/tabletContext.dart b/lib/Models/tabletContext.dart index bb0527b..01dd9cc 100644 --- a/lib/Models/tabletContext.dart +++ b/lib/Models/tabletContext.dart @@ -1,18 +1,18 @@ import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:tablet_app/client.dart'; import 'dart:convert'; class TabletAppContext with ChangeNotifier{ - Client clientAPI; - MqttServerClient clientMQTT; - String id; - String host; - ConfigurationDTO configuration; - String language; - String deviceId; + Client? clientAPI; + MqttServerClient? clientMQTT; + String? id; + String? host; + ConfigurationDTO? configuration; + String? language; + String? deviceId; TabletAppContext({this.id, this.deviceId, this.host, this.configuration, this.language}); @@ -21,7 +21,7 @@ class TabletAppContext with ChangeNotifier{ 'id': id, 'deviceId': deviceId, 'host': host, - 'configuration': configuration == null ? null : jsonEncode(configuration.toJson()), + 'configuration': configuration == null ? null : jsonEncode(configuration!.toJson()), 'language': language }; } diff --git a/lib/Screens/Configuration/config_view.dart b/lib/Screens/Configuration/config_view.dart index d950d36..22170eb 100644 --- a/lib/Screens/Configuration/config_view.dart +++ b/lib/Screens/Configuration/config_view.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Components/Buttons/rounded_button.dart'; @@ -30,7 +30,7 @@ class ConfigViewWidget extends StatefulWidget { class _ConfigViewWidget extends State { Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution - String url = "http://192.168.1.19"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 + String url = "https://api.mymuseum.be"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 // PROD MDLF "http://192.168.1.19" bool configOk = false; @override @@ -41,7 +41,7 @@ class _ConfigViewWidget extends State { TabletAppContext tabletAppContext = appContext.getContext(); if (tabletAppContext != null) { if (tabletAppContext.host != null) - url = tabletAppContext.host; + url = tabletAppContext.host!; } return Scaffold( body: Container( @@ -164,8 +164,11 @@ class _ConfigViewWidget extends State { tabletAppContext.host = url; tabletAppContext.clientAPI = client; - var identifier = await DeviceInfoHelper.getDeviceDetails(); - tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier); + // Add if web TODO + //var identifier = await DeviceInfoHelper.getDeviceDetails(); + var identifier = "WEB TEST"; + // TODO WEB ! + // tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier); setState(() { appContext.setContext(tabletAppContext); configOk = true; @@ -199,14 +202,15 @@ class _ConfigViewWidget extends State { newDevice.configurationId = configurationDTO.id; newDevice.configuration = configurationDTO.label; newDevice.connected = true; - newDevice.identifier = await DeviceInfoHelper.getDeviceDetails(); - newDevice.ipAddressWLAN = await getIP(true); - newDevice.ipAddressETH = await getIP(false); - newDevice.name = newDevice.ipAddressWLAN; + //newDevice.identifier = await DeviceInfoHelper.getDeviceDetails(); // TODO WEB + //newDevice.ipAddressWLAN = await getIP(true); + //newDevice.ipAddressETH = await getIP(false); + //newDevice.name = newDevice.ipAddressWLAN; + newDevice.name = "WEB TEST"; print(newDevice); - DeviceDetailDTO device = await tabletAppContext.clientAPI.deviceApi.deviceCreate(newDevice); + DeviceDetailDTO? device = await tabletAppContext.clientAPI!.deviceApi!.deviceCreate(newDevice); if (device != null) { // STORE IT LOCALLY !! @@ -251,7 +255,7 @@ class _ConfigViewWidget extends State { isValidApi(Client client) async { print("TEST URL"); try { - var configs = await client.configurationApi.configurationGet(); + var configs = await client.configurationApi!.configurationGet(); return configs != null; } catch (ex) { print(ex); @@ -260,7 +264,7 @@ class _ConfigViewWidget extends State { } } -Future getIP(bool isWLAN) async { +Future getIP(bool isWLAN) async { for (var interface in await NetworkInterface.list()) { print('== Interface: ${interface.name} =='); if (interface.name == "wlan0" && isWLAN) { @@ -284,7 +288,7 @@ boxDecoration(SectionDTO section) { fit: BoxFit.cover, colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop), image: new NetworkImage( - section.imageSource, + section.imageSource!, ), ), boxShadow: [ @@ -299,6 +303,7 @@ boxDecoration(SectionDTO section) { } Future> getConfigurations(dynamic appContext) async { + List configurations = await appContext.getContext().clientAPI.configurationApi.configurationGet(); print("number of configurations " + configurations.length.toString()); configurations.forEach((element) { diff --git a/lib/Screens/MainView/dropDown_configuration.dart b/lib/Screens/MainView/dropDown_configuration.dart index db4f996..6b2a5b2 100644 --- a/lib/Screens/MainView/dropDown_configuration.dart +++ b/lib/Screens/MainView/dropDown_configuration.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/constants.dart'; class DropDownConfig extends StatefulWidget { - final List configurations; - final ValueChanged onChange; + final List? configurations; + final ValueChanged? onChange; const DropDownConfig({ - Key key, + Key? key, this.configurations, this.onChange, }) : super(key: key); @@ -18,7 +18,7 @@ class DropDownConfig extends StatefulWidget { } class _DropDownConfigState extends State { - ConfigurationDTO configurationDTO; + ConfigurationDTO configurationDTO = ConfigurationDTO(); @override Widget build(BuildContext context) { @@ -34,16 +34,16 @@ class _DropDownConfigState extends State { height: 2, color: kMainRed, // TODO CHANGEEEEE ), - onChanged: (ConfigurationDTO newValue) { + onChanged: (ConfigurationDTO? newValue) { setState(() { - configurationDTO = newValue; - widget.onChange(configurationDTO); + configurationDTO = newValue!; + widget.onChange!(configurationDTO); }); }, - items: widget.configurations.map>((ConfigurationDTO value) { + items: widget.configurations!.map>((ConfigurationDTO value) { return DropdownMenuItem( value: value, - child: Text(value.label, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400)), + child: Text(value.label!, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400)), ); }).toList(), ); diff --git a/lib/Screens/MainView/language_selection.dart b/lib/Screens/MainView/language_selection.dart index 2c2886c..4dd01ee 100644 --- a/lib/Screens/MainView/language_selection.dart +++ b/lib/Screens/MainView/language_selection.dart @@ -13,20 +13,20 @@ class LanguageSelection extends StatefulWidget { } class _LanguageSelection extends State with TickerProviderStateMixin { - List languagesEnable; + List? languagesEnable; Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution double flagSize = 60; - String selectedLanguage; - double elementMinimizedSize; + String? selectedLanguage; + double? elementMinimizedSize; bool minimized = false; - double _leftLanguage; - double _topLanguage; - double _rightLanguage; - double _bottomLanguage; + double? _leftLanguage; + double? _topLanguage; + double? _rightLanguage; + double? _bottomLanguage; - AnimationController _controller; + AnimationController? _controller; @override void initState() { @@ -39,14 +39,14 @@ class _LanguageSelection extends State with TickerProviderSta _controller = AnimationController( value: 12, vsync: this, duration: Duration(seconds: 1)); - _controller.animateBack(0); + _controller!.animateBack(0); super.initState(); } @override void dispose() { - _controller.dispose(); + _controller!.dispose(); super.dispose(); } @@ -55,7 +55,7 @@ class _LanguageSelection extends State with TickerProviderSta final appContext = Provider.of(context); Size size = MediaQuery.of(context).size; selectedLanguage = (appContext.getContext() as TabletAppContext).language; - languagesEnable = (appContext.getContext() as TabletAppContext).configuration.languages; + languagesEnable = (appContext.getContext() as TabletAppContext).configuration!.languages; return Stack( children: [ @@ -71,7 +71,7 @@ class _LanguageSelection extends State with TickerProviderSta child: Container( height: size.height *0.07,//size.height *0.07, width: size.width *0.07,//size.width *0.07, - decoration: flagDecoration(selectedLanguage), + decoration: flagDecoration(selectedLanguage!), ), ), ) @@ -88,7 +88,7 @@ class _LanguageSelection extends State with TickerProviderSta ListView( children: [ if(minimized) ... [ - for(var language in languagesEnable.where((element) => element.toUpperCase() != selectedLanguage )) + for(var language in languagesEnable!.where((element) => element.toUpperCase() != selectedLanguage )) InkWell( onTap: () { setState(() { @@ -121,9 +121,9 @@ class _LanguageSelection extends State with TickerProviderSta minimizedAnimation(Size size) { minimized = !minimized; if (minimized) { - _controller.animateBack(15.0); + _controller!.animateBack(15.0); } else { - _controller.animateBack(0.0); + _controller!.animateBack(0.0); } setState(() { _leftLanguage = size.width - (size.width *0.07); //size.width - size.width *0.07; diff --git a/lib/Screens/MainView/main_view.dart b/lib/Screens/MainView/main_view.dart index 984bfd6..8896bf5 100644 --- a/lib/Screens/MainView/main_view.dart +++ b/lib/Screens/MainView/main_view.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Components/loading.dart'; import 'package:tablet_app/Helpers/MQTTHelper.dart'; @@ -30,7 +30,7 @@ class MainViewWidget extends StatefulWidget { class _MainViewWidget extends State { Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution - SectionDTO sectionSelected; + SectionDTO? sectionSelected; int rowCount = 4; @@ -45,7 +45,7 @@ class _MainViewWidget extends State { if(sectionSelected != null) { var elementToShow; - switch (sectionSelected.type) { + switch (sectionSelected!.type) { case SectionType.map : // MAP elementToShow = ChangeNotifierProvider( create: (_) => @@ -54,7 +54,7 @@ class _MainViewWidget extends State { longitude: null, title: '', description: '')), - child: MapViewWidget(section: sectionSelected) /*FutureBuilder( + child: MapViewWidget(section: sectionSelected!) /*FutureBuilder( future: _url, builder: (BuildContext context, AsyncSnapshot snapshot) => snapshot.hasData ? WebViewWidget(url: snapshot.data,) @@ -62,7 +62,7 @@ class _MainViewWidget extends State { ); break; case SectionType.web : // WEB - elementToShow = WebViewWidget(section: sectionSelected); + elementToShow = WebView(section: sectionSelected); break; case SectionType.video : // Video elementToShow = VideoViewWidget(section: sectionSelected); @@ -71,7 +71,7 @@ class _MainViewWidget extends State { elementToShow = SliderViewWidget(section: sectionSelected); break; case SectionType.menu : - elementToShow = MenuViewWidget(section: sectionSelected); + elementToShow = MenuViewWidget(section: sectionSelected!); break; case SectionType.quizz : elementToShow = QuizzViewWidget(section: sectionSelected); @@ -100,7 +100,7 @@ class _MainViewWidget extends State { child: Container( /*width: 125, height: 125,*/ - decoration: boxDecoration(sectionSelected, true), + decoration: boxDecoration(sectionSelected!, true), ), ), ), @@ -117,7 +117,7 @@ class _MainViewWidget extends State { child: Align( alignment: Alignment.centerLeft, child: AutoSizeText( - sectionSelected.title.firstWhere((translation) => translation.language == appContext.getContext().language).value, + sectionSelected!.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, style: new TextStyle(fontSize: kSectionTitleDetailSize), maxLines: 1, ), @@ -127,7 +127,7 @@ class _MainViewWidget extends State { child: Align( alignment: Alignment.centerLeft, child: AutoSizeText( - sectionSelected.description.firstWhere((translation) => translation.language == appContext.getContext().language).value, + sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, style: new TextStyle(fontSize: kSectionDescriptionDetailSize), maxLines: 2, ), @@ -140,11 +140,11 @@ class _MainViewWidget extends State { ), ), Padding( - padding: sectionSelected.type != SectionType.slider ? const EdgeInsets.only(left: 15.0, right: 15.0, top: 15.0) : const EdgeInsets.only(top: 15.0), + padding: sectionSelected!.type != SectionType.slider ? const EdgeInsets.only(left: 15.0, right: 15.0, top: 15.0) : const EdgeInsets.only(top: 15.0), child: Container( width: size.width, height: size.height * 0.85, - decoration: sectionSelected.type != SectionType.video && sectionSelected.type != SectionType.web && sectionSelected.type != SectionType.slider && sectionSelected.type != SectionType.map ? BoxDecoration( + decoration: sectionSelected!.type != SectionType.video && sectionSelected!.type != SectionType.web && sectionSelected!.type != SectionType.slider && sectionSelected!.type != SectionType.map ? BoxDecoration( color: kBackgroundLight, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(30.0), @@ -270,11 +270,11 @@ class _MainViewWidget extends State { } } - Future> getSections(dynamic appContext) async { + Future?> getSections(dynamic appContext) async { TabletAppContext tabletAppContext = await appContext.getContext(); try { - List sections = await tabletAppContext.clientAPI.sectionApi.sectionGetFromConfiguration(tabletAppContext.configuration.id); - sections.sort((a, b) => a.order.compareTo(b.order)); + List? sections = await tabletAppContext.clientAPI!.sectionApi!.sectionGetFromConfiguration(tabletAppContext.configuration!.id!); + sections!.sort((a, b) => a.order!.compareTo(b.order!)); return sections; } catch (e) { print(e); @@ -301,7 +301,7 @@ boxDecoration(SectionDTO section, bool isSelected) { fit: !isSelected? BoxFit.cover : BoxFit.contain, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null, image: new NetworkImage( - section.imageSource, + section.imageSource!, ), ): null, boxShadow: [ diff --git a/lib/Screens/Map/google_map_view.dart b/lib/Screens/Map/google_map_view.dart index 398ee26..296b7a2 100644 --- a/lib/Screens/Map/google_map_view.dart +++ b/lib/Screens/Map/google_map_view.dart @@ -3,17 +3,17 @@ import 'dart:typed_data'; import 'package:enum_to_string/enum_to_string.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Models/map-marker.dart'; import 'package:tablet_app/Screens/Map/map_context.dart'; class GoogleMapView extends StatefulWidget { - final MapDTO mapDTO; - final Uint8List selectedMarkerIcon; - final String language; + final MapDTO? mapDTO; + final Uint8List? selectedMarkerIcon; + final String? language; const GoogleMapView({ - Key key, + Key? key, this.mapDTO, this.selectedMarkerIcon, this.language, @@ -24,19 +24,19 @@ class GoogleMapView extends StatefulWidget { } class _GoogleMapViewState extends State { - ConfigurationDTO configurationDTO; + ConfigurationDTO? configurationDTO; Completer _controller = Completer(); Set markers = {}; - List markersList = List(); + List markersList = []; Set getMarkers(language, mapContext) { markers = {}; - widget.mapDTO.points.forEach((point) { + widget.mapDTO!.points!.forEach((point) { var mapMarker = new MapMarker( id: point.id, - title: point.title.firstWhere((translation) => translation.language == language).value, - description: point.description.firstWhere((translation) => translation.language == language).value, + title: point.title!.firstWhere((translation) => translation.language == language).value, + description: point.description!.firstWhere((translation) => translation.language == language).value, longitude: point.longitude, latitude: point.latitude, images: point.images @@ -48,12 +48,12 @@ class _GoogleMapViewState extends State { if (element.latitude != null && element.longitude != null) { markers.add(Marker( draggable: false, - markerId: MarkerId(element.latitude + element.longitude), + markerId: MarkerId(element.latitude! + element.longitude!), position: LatLng( - double.tryParse(element.latitude), - double.tryParse(element.longitude), + double.tryParse(element.latitude!)!, + double.tryParse(element.longitude!)!, ), - icon: BitmapDescriptor.fromBytes(widget.selectedMarkerIcon), + icon: BitmapDescriptor.fromBytes(widget.selectedMarkerIcon!), /*icon: BitmapDescriptor.defaultMarkerWithHue( BitmapDescriptor.hueYellow, ),*/ @@ -93,11 +93,11 @@ class _GoogleMapViewState extends State { Size size = MediaQuery.of(context).size; return GoogleMap( - mapType: widget.mapDTO.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO.mapType.toString()): MapType.hybrid, + mapType: widget.mapDTO!.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())!: MapType.hybrid, mapToolbarEnabled: false, initialCameraPosition: CameraPosition( target: LatLng(50.416639, 4.879169), - zoom: widget.mapDTO.zoom != null ? widget.mapDTO.zoom.toDouble() : 18, + zoom: widget.mapDTO!.zoom != null ? widget.mapDTO!.zoom!.toDouble() : 18, ), onMapCreated: (GoogleMapController controller) { _controller.complete(controller); diff --git a/lib/Screens/Map/map_view.dart b/lib/Screens/Map/map_view.dart index 1477377..4870974 100644 --- a/lib/Screens/Map/map_view.dart +++ b/lib/Screens/Map/map_view.dart @@ -4,7 +4,7 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Components/loading.dart'; import 'package:tablet_app/Models/map-marker.dart'; @@ -16,20 +16,20 @@ import '../../app_context.dart'; import 'google_map_view.dart'; Set markers = {}; -List markersList = List(); +List markersList = []; class MapViewWidget extends StatefulWidget { - final SectionDTO section; - MapViewWidget({Key key, this.section}) : super(key: key); + final SectionDTO? section; + MapViewWidget({Key? key, this.section}) : super(key: key); @override _MapViewWidget createState() => _MapViewWidget(); } class _MapViewWidget extends State { - MapDTO mapDTO; + MapDTO? mapDTO; Completer _controller = Completer(); - Uint8List selectedMarkerIcon; + Uint8List? selectedMarkerIcon; Future getBytesFromAsset(ByteData data, int width) async { //ByteData data = await rootBundle.load(path); @@ -37,14 +37,14 @@ class _MapViewWidget extends State { targetWidth: width); ui.FrameInfo fi = await codec.getNextFrame(); return (await fi.image.toByteData(format: ui.ImageByteFormat.png)) - .buffer + !.buffer .asUint8List(); } @override void initState() { - print(widget.section.data); - mapDTO = MapDTO.fromJson(jsonDecode(widget.section.data)); + print(widget.section!.data); + mapDTO = MapDTO.fromJson(jsonDecode(widget.section!.data!)); print(mapDTO); super.initState(); @@ -69,10 +69,10 @@ class _MapViewWidget extends State { return Stack( children: [ FutureBuilder( - future: getByteIcon(mapDTO.iconSource), + future: getByteIcon(mapDTO!.iconSource!), builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { - return GoogleMapView(language: appContext.getContext().language, mapDTO: mapDTO, selectedMarkerIcon: selectedMarkerIcon); + return GoogleMapView(language: appContext.getContext().language, mapDTO: mapDTO!, selectedMarkerIcon: selectedMarkerIcon); } else if (snapshot.connectionState == ConnectionState.none) { return Text("No data"); } else { diff --git a/lib/Screens/Map/marker_view.dart b/lib/Screens/Map/marker_view.dart index e463041..bc40c1e 100644 --- a/lib/Screens/Map/marker_view.dart +++ b/lib/Screens/Map/marker_view.dart @@ -16,7 +16,7 @@ class MarkerViewWidget extends StatefulWidget { class _MarkerInfoWidget extends State { Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution - CarouselController sliderController; + CarouselController? sliderController; int currentIndex = 1; @override @@ -205,7 +205,7 @@ class _MarkerInfoWidget extends State { child: InkWell( onTap: () { if (mapContext.getSelectedMarker().images.length > 0) - sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Icon( Icons.chevron_right, @@ -221,7 +221,7 @@ class _MarkerInfoWidget extends State { child: InkWell( onTap: () { if (mapContext.getSelectedMarker().images.length > 0) - sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Icon( Icons.chevron_left, diff --git a/lib/Screens/Menu/menu_view.dart b/lib/Screens/Menu/menu_view.dart index f9bfedd..f6b56d7 100644 --- a/lib/Screens/Menu/menu_view.dart +++ b/lib/Screens/Menu/menu_view.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Models/map-marker.dart'; import 'package:tablet_app/Screens/Map/map_context.dart'; @@ -13,7 +13,7 @@ import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/constants.dart'; class MenuViewWidget extends StatefulWidget { - final SectionDTO section; + final SectionDTO? section; MenuViewWidget({this.section}); @override @@ -21,12 +21,12 @@ class MenuViewWidget extends StatefulWidget { } class _MenuViewWidget extends State { - MenuDTO menuDTO; - SectionDTO selectedSection; + MenuDTO menuDTO = MenuDTO(); + SectionDTO? selectedSection; @override void initState() { - print(widget.section.data); - menuDTO = MenuDTO.fromJson(jsonDecode(widget.section.data)); + print(widget.section!.data); + menuDTO = MenuDTO.fromJson(jsonDecode(widget.section!.data!))!; print(menuDTO); super.initState(); @@ -44,7 +44,7 @@ class _MenuViewWidget extends State { if (selectedSection != null) { var elementToShow; - switch (selectedSection.type) { + switch (selectedSection!.type) { case SectionType.map : elementToShow = ChangeNotifierProvider( create: (_) => @@ -61,7 +61,7 @@ class _MenuViewWidget extends State { ); break; case SectionType.web : // WEB - elementToShow = WebViewWidget(section: selectedSection); + elementToShow = WebView(section: selectedSection); break; case SectionType.video : // Video elementToShow = VideoViewWidget(section: selectedSection); @@ -79,7 +79,7 @@ class _MenuViewWidget extends State { child: Container( width: size.width, height: size.height * 0.8, - decoration: selectedSection.type != SectionType.video && selectedSection.type != SectionType.web && selectedSection.type != SectionType.slider && selectedSection.type != SectionType.map ? BoxDecoration( + decoration: selectedSection!.type != SectionType.video && selectedSection!.type != SectionType.web && selectedSection!.type != SectionType.slider && selectedSection!.type != SectionType.map ? BoxDecoration( color: kBackgroundLight, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(30.0), @@ -137,16 +137,16 @@ class _MenuViewWidget extends State { child: GridView.builder( shrinkWrap: true, gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1.4), - itemCount: menuDTO.sections.length, + itemCount: menuDTO.sections!.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { setState(() { - selectedSection = menuDTO.sections[index]; + selectedSection = menuDTO.sections![index]; }); }, child: Container( - decoration: boxDecoration(menuDTO.sections[index], false), + decoration: boxDecoration(menuDTO.sections![index], false), padding: const EdgeInsets.all(25), margin: EdgeInsets.symmetric(vertical: 25, horizontal: 25), child: Align( @@ -158,7 +158,7 @@ class _MenuViewWidget extends State { Align( alignment: Alignment.centerRight, child: AutoSizeText( - menuDTO.sections[index].title.firstWhere((translation) => translation.language == appContext.getContext().language).value, + menuDTO.sections![index].title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, style: new TextStyle(fontSize: kMenuTitleDetailSize), maxLines: 1, ), @@ -166,7 +166,7 @@ class _MenuViewWidget extends State { Align( alignment: Alignment.centerRight, child: AutoSizeText( - menuDTO.sections[index].description.firstWhere((translation) => translation.language == appContext.getContext().language).value, + menuDTO.sections![index].description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, style: new TextStyle(fontSize: kSectionDescriptionDetailSize, fontFamily: ""), maxLines: 1, ), @@ -193,7 +193,7 @@ boxDecoration(SectionDTO section, bool isSelected) { fit: BoxFit.contain, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null, image: new NetworkImage( - section.imageSource, + section.imageSource!, ), ): null, boxShadow: [ diff --git a/lib/Screens/Previous/previous_view.dart b/lib/Screens/Previous/previous_view.dart index 95a1aac..0aee5b5 100644 --- a/lib/Screens/Previous/previous_view.dart +++ b/lib/Screens/Previous/previous_view.dart @@ -12,9 +12,9 @@ import '../../constants.dart'; import '../custom_clipper.dart'; class PreviousViewWidget extends StatefulWidget { - PreviousViewWidget({Key key, this.title}) : super(key: key); + PreviousViewWidget({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _PreviousViewWidget createState() => _PreviousViewWidget(); @@ -27,27 +27,27 @@ class _PreviousViewWidget extends State with TickerProviderS double elementMaximizedSize = 400.0; bool minimized = false; - double _leftMain; - double _topMain; - double _rightMain; - double _bottomMain; + double? _leftMain; + double? _topMain; + double? _rightMain; + double? _bottomMain; - double _leftTitle; - double _topTitle; - double _rightTitle; - double _bottomTitle; + double? _leftTitle; + double? _topTitle; + double? _rightTitle; + double? _bottomTitle; - double _leftElement; - double _topElement; - double _rightElement; - double _bottomElement; + double? _leftElement; + double? _topElement; + double? _rightElement; + double? _bottomElement; - double _leftMenu; - double _topMenu; - double _rightMenu; - double _bottomMenu; + double? _leftMenu; + double? _topMenu; + double? _rightMenu; + double? _bottomMenu; - AnimationController _controller; + AnimationController? _controller; Completer _webViewController = Completer< WebViewController>(); @@ -77,7 +77,7 @@ class _PreviousViewWidget extends State with TickerProviderS _controller = AnimationController( value: 12, vsync: this, duration: Duration(seconds: 1)); - _controller.animateBack(0); + _controller!.animateBack(0); super.initState(); } @@ -87,9 +87,9 @@ class _PreviousViewWidget extends State with TickerProviderS minimized = !minimized; if (minimized) { - _controller.animateBack(5.0); + _controller!.animateBack(5.0); } else { - _controller.animateBack(0.0); + _controller!.animateBack(0.0); } _leftMenu = 0; @@ -131,7 +131,7 @@ class _PreviousViewWidget extends State with TickerProviderS @override void dispose() { - _controller.dispose(); + _controller!.dispose(); super.dispose(); } @@ -222,10 +222,10 @@ class _PreviousViewWidget extends State with TickerProviderS child: Padding( padding: const EdgeInsets.all(5.0), child: AnimatedBuilder( - animation: _controller, - builder: (BuildContext context, Widget child) { + animation: _controller!, + builder: (BuildContext context, Widget? child) { return ClipPath( - clipper: WaveClipper(move: _controller.value, + clipper: WaveClipper(move: _controller!.value, minimized: minimized, height: _leftMain, width: _topMain), diff --git a/lib/Screens/Quizz/quizz_view.dart b/lib/Screens/Quizz/quizz_view.dart index cea7c3c..6d1346e 100644 --- a/lib/Screens/Quizz/quizz_view.dart +++ b/lib/Screens/Quizz/quizz_view.dart @@ -4,7 +4,7 @@ import 'package:carousel_slider/carousel_slider.dart'; import 'package:confetti/confetti.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Components/Buttons/rounded_button.dart'; import 'package:tablet_app/Models/ResponseSubDTO.dart'; @@ -16,8 +16,8 @@ import 'drawStrawberry.dart'; class QuizzViewWidget extends StatefulWidget { - final SectionDTO section; - GlobalKey key; + final SectionDTO? section; + GlobalKey? key; QuizzViewWidget({this.section, this.key}); @override @@ -25,10 +25,10 @@ class QuizzViewWidget extends StatefulWidget { } class _QuizzViewWidget extends State { - ConfettiController _controllerCenter; - QuizzDTO quizzDTO; + ConfettiController? _controllerCenter; + QuizzDTO quizzDTO = QuizzDTO(); List _questionsSubDTO = []; - CarouselController sliderController; + CarouselController? sliderController; int currentIndex = 1; bool showResult = false; bool showResponses = false; @@ -41,12 +41,12 @@ class _QuizzViewWidget extends State { sliderController = CarouselController(); - quizzDTO = QuizzDTO.fromJson(jsonDecode(widget.section.data)); + quizzDTO = QuizzDTO.fromJson(jsonDecode(widget.section!.data!))!; - quizzDTO.questions.sort((a, b) => a.order.compareTo(b.order)); - _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); + quizzDTO.questions!.sort((a, b) => a.order!.compareTo(b.order!)); + _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!); - _controllerCenter.play(); + _controllerCenter!.play(); } @@ -54,8 +54,8 @@ class _QuizzViewWidget extends State { void dispose() { sliderController = null; currentIndex = 1; - _controllerCenter.dispose(); - _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); + _controllerCenter!.dispose(); + _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!); super.dispose(); } @@ -68,12 +68,12 @@ class _QuizzViewWidget extends State { { var goodResponses = 0; _questionsSubDTO.forEach((question) { - if(question.chosen == question.responsesSubDTO.indexWhere((response) => response.isGood)) + if(question.chosen == question.responsesSubDTO!.indexWhere((response) => response.isGood!)) goodResponses +=1; }); log("goodResponses =" + goodResponses.toString()); var levelToShow; - var test = goodResponses/quizzDTO.questions.length; + var test = goodResponses/quizzDTO.questions!.length; if(0 == test || test < 0.25) levelToShow = quizzDTO.badLevel; @@ -93,7 +93,7 @@ class _QuizzViewWidget extends State { width: 5, height: 5, child: ConfettiWidget( - confettiController: _controllerCenter, + confettiController: _controllerCenter!, blastDirectionality: BlastDirectionality.explosive, shouldLoop: false, // start again as soon as the animation is finished colors: const [ @@ -150,7 +150,7 @@ class _QuizzViewWidget extends State { ), ), Container( - child: Text('$goodResponses/${quizzDTO.questions.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: 150, color: kBackgroundSecondGrey )), + child: Text('$goodResponses/${quizzDTO.questions!.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: 150, color: kBackgroundSecondGrey)), ), Container( child: Padding( @@ -229,7 +229,7 @@ class _QuizzViewWidget extends State { showResult = false; showResponses = false; currentIndex = 1; - _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); + _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!); }); }, fontSize: 30, @@ -299,7 +299,7 @@ class _QuizzViewWidget extends State { fit: BoxFit.contain, opacity: 0.35, image: new NetworkImage( - i.source_, + i.source_!, ), ): null, boxShadow: [ @@ -343,7 +343,7 @@ class _QuizzViewWidget extends State { child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(15.0), - child: Text(i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), + child: Text(i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), ), ), ), @@ -372,7 +372,7 @@ class _QuizzViewWidget extends State { mainAxisSpacing: 150, crossAxisSpacing: 150, ), - itemCount: i.responsesSubDTO.length, + itemCount: i.responsesSubDTO!.length, itemBuilder: (BuildContext ctx, index) { return InkWell( onTap: () { @@ -381,9 +381,9 @@ class _QuizzViewWidget extends State { if(currentIndex == _questionsSubDTO.length && i.chosen == index) { showResult = true; - _controllerCenter.play(); + _controllerCenter!.play(); } else { - sliderController.nextPage(duration: new Duration(milliseconds: 650), curve: Curves.fastOutSlowIn); + sliderController!.nextPage(duration: new Duration(milliseconds: 650), curve: Curves.fastOutSlowIn); } }); }, @@ -391,7 +391,7 @@ class _QuizzViewWidget extends State { padding: const EdgeInsets.all(8.0), child: Container( alignment: Alignment.center, - child: Text(i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), + child: Text(i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), decoration: BoxDecoration( color: i.chosen == index ? kTestSecondColor : kBackgroundLight, shape: BoxShape.rectangle, @@ -423,14 +423,14 @@ class _QuizzViewWidget extends State { ), ], ), - if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) + if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions!.length > 0) Positioned( top: MediaQuery.of(context).size.height * 0.35, right: 60, child: InkWell( onTap: () { - if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) { - sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions!.length > 0) { + sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); /*Fluttertoast.showToast( msg: "Vous n'avez pas répondu à cette question", toastLength: Toast.LENGTH_SHORT, @@ -456,7 +456,7 @@ class _QuizzViewWidget extends State { child: InkWell( onTap: () { if(currentIndex > 1) - sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Icon( Icons.chevron_left, @@ -472,7 +472,7 @@ class _QuizzViewWidget extends State { alignment: Alignment.bottomCenter, child: InkWell( child: Text( - currentIndex.toString()+'/'+quizzDTO.questions.length.toString(), + currentIndex.toString()+'/'+quizzDTO.questions!.length.toString(), style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), ), ) diff --git a/lib/Screens/Quizz/showResponses.dart b/lib/Screens/Quizz/showResponses.dart index 723f756..3e5ecb7 100644 --- a/lib/Screens/Quizz/showResponses.dart +++ b/lib/Screens/Quizz/showResponses.dart @@ -3,7 +3,7 @@ import 'dart:developer'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Models/ResponseSubDTO.dart'; import 'package:tablet_app/app_context.dart'; @@ -12,7 +12,7 @@ import 'package:tablet_app/constants.dart'; class ShowReponsesWidget extends StatefulWidget { - List questionsSubDTO; + List? questionsSubDTO; ShowReponsesWidget({this.questionsSubDTO}); @override @@ -21,14 +21,14 @@ class ShowReponsesWidget extends StatefulWidget { class _ShowReponsesWidget extends State { List _questionsSubDTO = []; - CarouselController sliderController; + CarouselController? sliderController; int currentIndex = 1; @override void initState() { super.initState(); sliderController = CarouselController(); - _questionsSubDTO = widget.questionsSubDTO; + _questionsSubDTO = widget.questionsSubDTO!; } @override @@ -78,7 +78,7 @@ class _ShowReponsesWidget extends State { fit: BoxFit.contain, opacity: 0.35, image: new NetworkImage( - i.source_, + i.source_!, ), ): null, boxShadow: [ @@ -122,7 +122,7 @@ class _ShowReponsesWidget extends State { child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(1.0), - child: Text(i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), + child: Text(i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), ), ), ), @@ -148,15 +148,15 @@ class _ShowReponsesWidget extends State { mainAxisSpacing: 15, crossAxisSpacing: 5, ), - itemCount: i.responsesSubDTO.length, + itemCount: i.responsesSubDTO!.length, itemBuilder: (BuildContext ctx, index) { return Padding( padding: const EdgeInsets.all(5.0), child: Container( alignment: Alignment.center, - child: Text(i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), + child: Text(i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), decoration: BoxDecoration( - color: i.responsesSubDTO[index].isGood ? kGreen : i.chosen == index ? kMainRed : kBackgroundLight, + color: i.responsesSubDTO![index].isGood! ? kGreen : i.chosen == index ? kMainRed : kBackgroundLight, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(10.0), boxShadow: [ @@ -183,14 +183,14 @@ class _ShowReponsesWidget extends State { ); }).toList(), ), - if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO.length > 0) + if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO!.length > 0) Positioned( top: size.height * 0.35, right: 60, child: InkWell( onTap: () { - if(_questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO.length > 0) { - sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + if(_questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO!.length > 0) { + sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); /*Fluttertoast.showToast( msg: "Vous n'avez pas répondu à cette question", toastLength: Toast.LENGTH_SHORT, @@ -216,7 +216,7 @@ class _ShowReponsesWidget extends State { child: InkWell( onTap: () { if(currentIndex > 1) - sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Icon( Icons.chevron_left, @@ -232,7 +232,7 @@ class _ShowReponsesWidget extends State { alignment: Alignment.bottomCenter, child: InkWell( child: Text( - currentIndex.toString()+'/'+ widget.questionsSubDTO.length.toString(), + currentIndex.toString()+'/'+ widget.questionsSubDTO!.length.toString(), style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), ), ) diff --git a/lib/Screens/Slider/slider_view.dart b/lib/Screens/Slider/slider_view.dart index 7442789..23a6c69 100644 --- a/lib/Screens/Slider/slider_view.dart +++ b/lib/Screens/Slider/slider_view.dart @@ -2,14 +2,14 @@ import 'dart:convert'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/constants.dart'; import 'package:photo_view/photo_view.dart'; class SliderViewWidget extends StatefulWidget { - final SectionDTO section; + final SectionDTO? section; SliderViewWidget({this.section}); @override @@ -17,16 +17,16 @@ class SliderViewWidget extends StatefulWidget { } class _SliderViewWidget extends State { - SliderDTO sliderDTO; - CarouselController sliderController; + SliderDTO sliderDTO = SliderDTO(); + CarouselController? sliderController; int currentIndex = 1; @override void initState() { sliderController = CarouselController(); - sliderDTO = SliderDTO.fromJson(jsonDecode(widget.section.data)); + sliderDTO = SliderDTO.fromJson(jsonDecode(widget.section!.data!))!; - sliderDTO.images.sort((a, b) => a.order.compareTo(b.order)); + sliderDTO.images!.sort((a, b) => a.order!.compareTo(b.order!)); super.initState(); } @@ -48,7 +48,7 @@ class _SliderViewWidget extends State { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - if(sliderDTO.images != null && sliderDTO.images.length > 0) + if(sliderDTO.images != null && sliderDTO.images!.length > 0) CarouselSlider( carouselController: sliderController, options: CarouselOptions( @@ -61,7 +61,7 @@ class _SliderViewWidget extends State { enlargeCenterPage: true, reverse: false, ), - items: sliderDTO.images.map((i) { + items: sliderDTO.images!.map((i) { return Builder( builder: (BuildContext context) { return Container( @@ -112,7 +112,7 @@ class _SliderViewWidget extends State { child: ClipRect( child: PhotoView( imageProvider: new NetworkImage( - i.source_, + i.source_!, ), minScale: PhotoViewComputedScale.contained * 0.8, maxScale: PhotoViewComputedScale.contained * 3.0, @@ -131,7 +131,7 @@ class _SliderViewWidget extends State { right: 0, child: Padding( padding: const EdgeInsets.all(15.0), - child: Text(i.title.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.title.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kTitleSize, color: kBackgroundLight)), + child: Text(i.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kTitleSize, color: kBackgroundLight)), ) ) ] @@ -160,7 +160,7 @@ class _SliderViewWidget extends State { child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(15.0), - child: Text(i.description.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.description.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), + child: Text(i.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), ), ), ), @@ -175,14 +175,14 @@ class _SliderViewWidget extends State { ), ], ), - if(sliderDTO.images != null && sliderDTO.images.length > 1) + if(sliderDTO.images != null && sliderDTO.images!.length > 1) Positioned( top: MediaQuery.of(context).size.height * 0.35, right: 60, child: InkWell( onTap: () { - if (sliderDTO.images.length > 0) - sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + if (sliderDTO.images!.length > 0) + sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Icon( Icons.chevron_right, @@ -191,14 +191,14 @@ class _SliderViewWidget extends State { ), ) ), - if(sliderDTO.images != null && sliderDTO.images.length > 1) + if(sliderDTO.images != null && sliderDTO.images!.length > 1) Positioned( top: MediaQuery.of(context).size.height * 0.35, left: 60, child: InkWell( onTap: () { - if (sliderDTO.images.length > 0) - sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + if (sliderDTO.images!.length > 0) + sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Icon( Icons.chevron_left, @@ -207,23 +207,23 @@ class _SliderViewWidget extends State { ), ) ), - if(sliderDTO.images != null && sliderDTO.images.length > 0) + if(sliderDTO.images != null && sliderDTO.images!.length > 0) Padding( - padding: widget.section.parentId == null ? EdgeInsets.only() : const EdgeInsets.only(left: 15, bottom: 10), + padding: widget.section!.parentId == null ? EdgeInsets.only() : const EdgeInsets.only(left: 15, bottom: 10), child: Align( - alignment: widget.section.parentId == null ? Alignment.bottomCenter : Alignment.bottomLeft, + alignment: widget.section!.parentId == null ? Alignment.bottomCenter : Alignment.bottomLeft, child: InkWell( onTap: () { - sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); }, child: Text( - currentIndex.toString()+'/'+sliderDTO.images.length.toString(), + currentIndex.toString()+'/'+sliderDTO.images!.length.toString(), style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), ), ) ), ), - if(sliderDTO.images == null || sliderDTO.images.length == 0) + if(sliderDTO.images == null || sliderDTO.images!.length == 0) Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),)) // Description /*Container( diff --git a/lib/Screens/Video/video_view.dart b/lib/Screens/Video/video_view.dart index d708325..30e3113 100644 --- a/lib/Screens/Video/video_view.dart +++ b/lib/Screens/Video/video_view.dart @@ -1,12 +1,12 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:tablet_app/constants.dart'; import 'package:youtube_player_flutter/youtube_player_flutter.dart'; class VideoViewWidget extends StatefulWidget { - final SectionDTO section; + final SectionDTO? section; VideoViewWidget({this.section}); @override @@ -14,21 +14,21 @@ class VideoViewWidget extends StatefulWidget { } class _VideoViewWidget extends State { - YoutubePlayer _videoView; - VideoDTO videoDTO; + YoutubePlayer? _videoView; + VideoDTO? videoDTO; @override void initState() { - print(widget.section.data); - videoDTO = VideoDTO.fromJson(jsonDecode(widget.section.data)); + print(widget.section!.data); + videoDTO = VideoDTO.fromJson(jsonDecode(widget.section!.data!)); print(videoDTO); - String videoId; - if (videoDTO.source_ != null && videoDTO.source_.length > 0 ) { - videoId = YoutubePlayer.convertUrlToId(videoDTO.source_); + String? videoId; + if (videoDTO!.source_ != null && videoDTO!.source_!.length > 0 ) { + videoId = YoutubePlayer.convertUrlToId(videoDTO!.source_!); YoutubePlayerController _controller = YoutubePlayerController( - initialVideoId: videoId, + initialVideoId: videoId!, flags: YoutubePlayerFlags( autoPlay: true, controlsVisibleAtStart: false, @@ -59,5 +59,7 @@ class _VideoViewWidget extends State { } @override - Widget build(BuildContext context) => videoDTO.source_ != null && videoDTO.source_.length > 0 ? _videoView : Center(child: Text("La vidéo ne peut pas être affichée, l'url est incorrecte", style: new TextStyle(fontSize: kNoneInfoOrIncorrect),)); + Widget build(BuildContext context) => videoDTO!.source_ != null && videoDTO!.source_!.length > 0 ? + _videoView! : + Center(child: Text("La vidéo ne peut pas être affichée, l'url est incorrecte", style: new TextStyle(fontSize: kNoneInfoOrIncorrect))); } \ No newline at end of file diff --git a/lib/Screens/Web/web_view.dart b/lib/Screens/Web/web_view.dart index cbc3e0f..0ecdf08 100644 --- a/lib/Screens/Web/web_view.dart +++ b/lib/Screens/Web/web_view.dart @@ -1,28 +1,52 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:webview_flutter/webview_flutter.dart'; -class WebViewWidget extends StatefulWidget { - final SectionDTO section; - WebViewWidget({this.section}); +class WebView extends StatefulWidget { + final SectionDTO? section; + WebView({this.section}); @override _WebViewWidget createState() => _WebViewWidget(); } -class _WebViewWidget extends State { - WebView _webView; - WebDTO webDTO; +class _WebViewWidget extends State { + //WebView _webView; + WebDTO webDTO = WebDTO(); + WebViewController? controller; + @override void initState() { - print(widget.section.data); - webDTO = WebDTO.fromJson(jsonDecode(widget.section.data)); + print(widget.section!.data); + webDTO = WebDTO.fromJson(jsonDecode(widget.section!.data!))!; print(webDTO); + controller = WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..setBackgroundColor(const Color(0x00000000)) + ..setNavigationDelegate( + NavigationDelegate( + onProgress: (int progress) { + // Update loading bar. + }, + onPageStarted: (String url) {}, + onPageFinished: (String url) {}, + onWebResourceError: (WebResourceError error) {}, + onNavigationRequest: (NavigationRequest request) { + if (request.url != webDTO.source_) { + print('blocking navigation to $request}'); + return NavigationDecision.prevent; + } + return NavigationDecision.navigate; + }, + ), + ) + ..loadRequest(Uri.parse(webDTO.source_!)); + super.initState(); - _webView = WebView( + /*_webView = WebView( initialUrl: webDTO.source_, //"https://my.matterport.com/show/?m=k8bvdezfHbT" javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { @@ -35,15 +59,15 @@ class _WebViewWidget extends State { print('allowing navigation to $request'); return NavigationDecision.navigate; } - ); + );*/ } @override void dispose() { - _webView = null; + //_webView = null; super.dispose(); } @override - Widget build(BuildContext context) => webDTO.source_ != null && webDTO.source_.length > 0 ? _webView : Center(child: Text("La page internet ne peut pas être affichée, l'url est incorrecte ou vide")); -} \ No newline at end of file + Widget build(BuildContext context) => webDTO.source_ != null && webDTO.source_!.length > 0 ? WebViewWidget(controller: controller!) : Center(child: Text("La page internet ne peut pas être affichée, l'url est incorrecte ou vide")); +} //_webView \ No newline at end of file diff --git a/lib/Screens/custom_clipper.dart b/lib/Screens/custom_clipper.dart index 07dac72..4f7ed4d 100644 --- a/lib/Screens/custom_clipper.dart +++ b/lib/Screens/custom_clipper.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; class WaveClipper extends CustomClipper { - bool minimized; - double height; - double width; - double move = 0; + bool? minimized; + double? height; + double? width; + double? move = 0; WaveClipper({ this.move, @@ -36,7 +36,7 @@ class WaveClipper extends CustomClipper { Path path = Path() ..lineTo(0, size.width) ..lineTo(size.width, size.height) - ..lineTo(size.width*move, 0) + ..lineTo(size.width*move!, 0) ..close(); //print("move is = " + move.toString()); diff --git a/lib/api/openApi.dart b/lib/api/openApi.dart new file mode 100644 index 0000000..c4943f9 --- /dev/null +++ b/lib/api/openApi.dart @@ -0,0 +1,14 @@ +import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; + +@Openapi( + additionalProperties: AdditionalProperties(pubName: 'manager_api', pubAuthor: 'Fransolet Thomas'), + inputSpecFile: 'lib/api/swagger.yaml', + generatorName: Generator.dart, + alwaysRun: true, + outputDirectory: 'manager_api') +class Example extends OpenapiGeneratorConfig {} + +/* + RUN + >flutter pub run build_runner build --delete-conflicting-outputs +*/ \ No newline at end of file diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml new file mode 100644 index 0000000..bf69b89 --- /dev/null +++ b/lib/api/swagger.yaml @@ -0,0 +1,2239 @@ +x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) +openapi: 3.0.0 +info: + title: Manager Service + description: API Manager Service + version: Version Alpha +servers: + - url: https://api.mymuseum.be +paths: + /api/Configuration: + get: + tags: + - Configuration + operationId: Configuration_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + post: + tags: + - Configuration + operationId: Configuration_Create + requestBody: + x-name: newConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Configuration + operationId: Configuration_Update + requestBody: + x-name: updatedConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}: + get: + tags: + - Configuration + operationId: Configuration_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Configuration + operationId: Configuration_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}/export: + get: + tags: + - Configuration + operationId: Configuration_Export + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Configuration/import: + post: + tags: + - Configuration + operationId: Configuration_Import + requestBody: + x-name: exportConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ExportConfigurationDTO' + required: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device: + get: + tags: + - Device + operationId: Device_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Device + operationId: Device_Create + requestBody: + x-name: newDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - Device + operationId: Device_Update + requestBody: + x-name: updatedDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}/detail: + get: + tags: + - Device + operationId: Device_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Device/mainInfos: + put: + tags: + - Device + operationId: Device_UpdateMainInfos + requestBody: + x-name: deviceIn + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}: + delete: + tags: + - Device + operationId: Device_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Instance: + get: + tags: + - Instance + operationId: Instance_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Instance' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Instance + operationId: Instance_CreateInstance + requestBody: + x-name: newInstance + content: + application/json: + schema: + $ref: '#/components/schemas/Instance' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Instance + operationId: Instance_Updateinstance + requestBody: + x-name: updatedInstance + content: + application/json: + schema: + $ref: '#/components/schemas/Instance' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Instance/{id}: + get: + tags: + - Instance + operationId: Instance_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - Instance + operationId: Instance_DeleteInstance + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource: + get: + tags: + - Resource + operationId: Resource_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + - name: types + in: query + style: form + explode: true + schema: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResourceType' + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Resource + operationId: Resource_Create + requestBody: + x-name: newResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Resource + operationId: Resource_Update + requestBody: + x-name: updatedResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/{id}/detail: + get: + tags: + - Resource + operationId: Resource_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Resource/{id}: + get: + tags: + - Resource + operationId: Resource_Show + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Resource + operationId: Resource_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/upload: + post: + tags: + - Resource + operationId: Resource_Upload + requestBody: + content: + multipart/form-data: + schema: + properties: + label: + type: string + nullable: true + type: + type: string + nullable: true + instanceId: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section: + get: + tags: + - Section + operationId: Section_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Section + operationId: Section_Create + requestBody: + x-name: newSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Section + operationId: Section_Update + requestBody: + x-name: updatedSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/configuration/{id}: + get: + tags: + - Section + operationId: Section_GetFromConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_DeleteAllForConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}/subsections: + get: + tags: + - Section + operationId: Section_GetAllSectionSubSections + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: {} + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}: + get: + tags: + - Section + operationId: Section_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/order: + put: + tags: + - Section + operationId: Section_UpdateOrder + requestBody: + x-name: updatedSectionsOrder + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/MapDTO: + get: + tags: + - Section + operationId: Section_GetMapDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MapDTO' + security: + - bearer: [] + /api/Section/SliderDTO: + get: + tags: + - Section + operationId: Section_GetSliderDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SliderDTO' + security: + - bearer: [] + /api/Section/VideoDTO: + get: + tags: + - Section + operationId: Section_GetVideoDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoDTO' + security: + - bearer: [] + /api/Section/WebDTO: + get: + tags: + - Section + operationId: Section_GetWebDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/WebDTO' + security: + - bearer: [] + /api/Section/MenuDTO: + get: + tags: + - Section + operationId: Section_GetMenuDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MenuDTO' + security: + - bearer: [] + /api/Section/PlayerMessageDTO: + get: + tags: + - Section + operationId: Section_PlayerMessageDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PlayerMessageDTO' + security: + - bearer: [] + /api/Section/QuizzDTO: + get: + tags: + - Section + operationId: Section_GetQuizzDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QuizzDTO' + security: + - bearer: [] + /api/Section/ArticleDTO: + get: + tags: + - Section + operationId: Section_GetArticleDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ArticleDTO' + security: + - bearer: [] + /api/User: + get: + tags: + - User + operationId: User_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - User + operationId: User_CreateUser + requestBody: + x-name: newUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - User + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/User/{id}: + get: + tags: + - User + operationId: User_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - User + operationId: User_DeleteUser + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Authentication/Token: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithForm + requestBody: + content: + multipart/form-data: + schema: + properties: + grant_type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + client_id: + type: string + nullable: true + client_secret: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Authentication/Authenticate: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string +components: + schemas: + ConfigurationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + primaryColor: + type: string + nullable: true + secondaryColor: + type: string + nullable: true + languages: + type: array + nullable: true + items: + type: string + dateCreation: + type: string + format: date-time + isMobile: + type: boolean + isTablet: + type: boolean + isOffline: + type: boolean + instanceId: + type: string + nullable: true + TranslationDTO: + type: object + additionalProperties: false + properties: + language: + type: string + nullable: true + value: + type: string + nullable: true + ExportConfigurationDTO: + allOf: + - $ref: '#/components/schemas/ConfigurationDTO' + - type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + resources: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResourceDTO' + SectionDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + configurationId: + type: string + nullable: true + isSubSection: + type: boolean + parentId: + type: string + nullable: true + type: + $ref: '#/components/schemas/SectionType' + data: + type: string + nullable: true + dateCreation: + type: string + format: date-time + order: + type: integer + format: int32 + instanceId: + type: string + nullable: true + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + meterZoneGPS: + type: integer + format: int32 + nullable: true + isBeacon: + type: boolean + beaconId: + type: string + nullable: true + SectionType: + type: integer + description: |- + 0 = Map + 1 = Slider + 2 = Video + 3 = Web + 4 = Menu + 5 = Quizz + 6 = Article + x-enumNames: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + - Article + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + ResourceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + $ref: '#/components/schemas/ResourceType' + label: + type: string + nullable: true + data: + type: string + nullable: true + dateCreation: + type: string + format: date-time + instanceId: + type: string + nullable: true + ResourceType: + type: integer + description: |- + 0 = Image + 1 = Video + 2 = ImageUrl + 3 = VideoUrl + 4 = Audio + x-enumNames: + - Image + - Video + - ImageUrl + - VideoUrl + - Audio + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + DeviceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + identifier: + type: string + nullable: true + name: + type: string + nullable: true + ipAddressWLAN: + type: string + nullable: true + ipAddressETH: + type: string + nullable: true + configurationId: + type: string + nullable: true + configuration: + type: string + nullable: true + connected: + type: boolean + dateCreation: + type: string + format: date-time + dateUpdate: + type: string + format: date-time + instanceId: + type: string + nullable: true + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceDTO' + - type: object + additionalProperties: false + properties: + connectionLevel: + type: string + nullable: true + lastConnectionLevel: + type: string + format: date-time + batteryLevel: + type: string + nullable: true + lastBatteryLevel: + type: string + format: date-time + Instance: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + dateCreation: + type: string + format: date-time + InstanceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + dateCreation: + type: string + format: date-time + MapDTO: + type: object + additionalProperties: false + properties: + zoom: + type: integer + format: int32 + mapType: + $ref: '#/components/schemas/MapTypeApp' + points: + type: array + nullable: true + items: + $ref: '#/components/schemas/GeoPointDTO' + iconResourceId: + type: string + nullable: true + iconSource: + type: string + nullable: true + MapTypeApp: + type: integer + description: |- + 0 = none + 1 = normal + 2 = satellite + 3 = terrain + 4 = hybrid + x-enumNames: + - none + - normal + - satellite + - terrain + - hybrid + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + GeoPointDTO: + type: object + additionalProperties: false + properties: + id: + type: integer + format: int32 + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageGeoPoint' + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + ImageGeoPoint: + type: object + additionalProperties: false + properties: + imageResourceId: + type: string + nullable: true + imageSource: + type: string + nullable: true + SliderDTO: + type: object + additionalProperties: false + properties: + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + ImageDTO: + type: object + additionalProperties: false + properties: + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + VideoDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + WebDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + MenuDTO: + type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + PlayerMessageDTO: + type: object + additionalProperties: false + properties: + configChanged: + type: boolean + isDeleted: + type: boolean + QuizzDTO: + type: object + additionalProperties: false + properties: + questions: + type: array + nullable: true + items: + $ref: '#/components/schemas/QuestionDTO' + bad_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + medium_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + good_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + great_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + QuestionDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + responses: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResponseDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + ResponseDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isGood: + type: boolean + order: + type: integer + format: int32 + LevelDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + ArticleDTO: + type: object + additionalProperties: false + properties: + content: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isContentTop: + type: boolean + audioIds: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isReadAudioAuto: + type: boolean + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + password: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + token: + type: string + nullable: true + dateCreation: + type: string + format: date-time + instanceId: + type: string + nullable: true + UserDetailDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + TokenDTO: + type: object + additionalProperties: false + properties: + access_token: + type: string + nullable: true + refresh_token: + type: string + nullable: true + scope: + type: string + nullable: true + token_type: + type: string + nullable: true + expires_in: + type: integer + format: int32 + expiration: + type: string + format: date-time + instanceId: + type: string + nullable: true + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: Manager Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + Manager-api: Manager WebAPI +security: + - bearer: [] +tags: + - name: Configuration + description: Configuration management + - name: Device + description: Device management + - name: Instance + description: Instance management + - name: Resource + description: Resource management + - name: Section + description: Section management + - name: User + description: User management + - name: Authentication + description: Authentication management diff --git a/lib/app_context.dart b/lib/app_context.dart index 5193215..ef325e0 100644 --- a/lib/app_context.dart +++ b/lib/app_context.dart @@ -4,7 +4,7 @@ import 'package:tablet_app/client.dart'; class AppContext with ChangeNotifier { TabletAppContext _tabletContext; - Client clientAPI; + Client? clientAPI; AppContext(this._tabletContext); diff --git a/lib/client.dart b/lib/client.dart index 26477d5..c345f19 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -1,27 +1,27 @@ -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; //import 'package:openapi_dart_common/openapi.dart'; class Client { - ApiClient _apiClient; - ApiClient get apiApi => _apiClient; + ApiClient? _apiClient; + ApiClient? get apiApi => _apiClient; - AuthenticationApi _authenticationApi; - AuthenticationApi get authenticationApi => _authenticationApi; + AuthenticationApi? _authenticationApi; + AuthenticationApi? get authenticationApi => _authenticationApi; - UserApi _userApi; - UserApi get userApi => _userApi; + UserApi? _userApi; + UserApi? get userApi => _userApi; - ConfigurationApi _configurationApi; - ConfigurationApi get configurationApi => _configurationApi; + ConfigurationApi? _configurationApi; + ConfigurationApi? get configurationApi => _configurationApi; - SectionApi _sectionApi; - SectionApi get sectionApi => _sectionApi; + SectionApi? _sectionApi; + SectionApi? get sectionApi => _sectionApi; - ResourceApi _resourceApi; - ResourceApi get resourceApi => _resourceApi; + ResourceApi? _resourceApi; + ResourceApi? get resourceApi => _resourceApi; - DeviceApi _deviceApi; - DeviceApi get deviceApi => _deviceApi; + DeviceApi? _deviceApi; + DeviceApi? get deviceApi => _deviceApi; Client(String path) { _apiClient = ApiClient( diff --git a/lib/main.dart b/lib/main.dart index fb47c9e..5ca411f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,8 @@ +import 'dart:io'; + +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/client.dart'; import 'Helpers/DatabaseHelper.dart'; @@ -13,19 +16,21 @@ import 'constants.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); String initialRoute; - TabletAppContext localContext = new TabletAppContext(); + TabletAppContext? localContext; bool isConfig = false; - localContext = await DatabaseHelper.instance.getData(); + if(!kIsWeb) { + localContext = await DatabaseHelper.instance.getData(); + } if(localContext != null) { print("we've got an local db !"); - localContext.clientAPI = new Client(localContext.host); + localContext.clientAPI = new Client(localContext.host!); isConfig = localContext.configuration != null; print(localContext); // Get config from manager - DeviceDetailDTO device = await localContext.clientAPI.deviceApi.deviceGetDetail(localContext.deviceId); - localContext.configuration.id = device.configurationId; + DeviceDetailDTO? device = await localContext.clientAPI!.deviceApi!.deviceGetDetail(localContext.deviceId!); + localContext.configuration!.id = device!.configurationId; if (device.configurationId == null) { print("device.configurationId == null"); localContext.configuration = null; @@ -35,6 +40,10 @@ void main() async { print("NO LOCAL DB !"); } + if(kIsWeb) { + localContext = TabletAppContext(host: "https://api.mymuseum.be"); + } + initialRoute = isConfig ? '/main' : '/config'; final MyApp myApp = MyApp( @@ -45,8 +54,8 @@ void main() async { } class MyApp extends StatefulWidget { - final String initialRoute; - final TabletAppContext tabletAppContext; + final String? initialRoute; + final TabletAppContext? tabletAppContext; MyApp({this.initialRoute, this.tabletAppContext}); @override @@ -54,7 +63,7 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - TabletAppContext tabletAppContext; + TabletAppContext? tabletAppContext; @override void initState() { @@ -65,7 +74,7 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { return ChangeNotifierProvider( - create: (_) => AppContext(widget.tabletAppContext), + create: (_) => AppContext(widget.tabletAppContext!), child: MaterialApp( debugShowCheckedModeBanner: false, title: 'Tablet App Demo', @@ -76,7 +85,7 @@ class _MyAppState extends State { ],*/ theme: ThemeData( primarySwatch: Colors.grey, - scaffoldBackgroundColor: widget.tabletAppContext != null ? widget.tabletAppContext.configuration != null ? widget.tabletAppContext.configuration.secondaryColor != null ? new Color(int.parse(widget.tabletAppContext.configuration.secondaryColor.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : kBackgroundGrey : kBackgroundGrey, + scaffoldBackgroundColor: widget.tabletAppContext != null ? widget.tabletAppContext!.configuration != null ? widget.tabletAppContext!.configuration!.secondaryColor != null ? new Color(int.parse(widget.tabletAppContext!.configuration!.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : kBackgroundGrey : kBackgroundGrey, //fontFamily: "Vollkorn", textTheme: TextTheme(bodyText1: TextStyle(color: kMainRed)), visualDensity: VisualDensity.adaptivePlatformDensity, diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index e71a16d..f6f23bf 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,10 @@ #include "generated_plugin_registrant.h" +#include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2e1de87..f16b4c3 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8370e57..efc96d3 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,7 +6,9 @@ import FlutterMacOS import Foundation import sqflite +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/manager_api/.gitignore b/manager_api/.gitignore index 7c28044..1be28ce 100644 --- a/manager_api/.gitignore +++ b/manager_api/.gitignore @@ -1,27 +1,17 @@ -# See https://www.dartlang.org/tools/private-files.html +# See https://dart.dev/guides/libraries/private-files -# Files and directories created by pub -.buildlog +.dart_tool/ .packages -.project -.pub/ build/ -**/packages/ +pubspec.lock # Except for application packages -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 605784e..ca166c6 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -1,6 +1,8 @@ .gitignore .travis.yml README.md +analysis_options.yaml +doc/ArticleDTO.md doc/AuthenticationApi.md doc/ConfigurationApi.md doc/ConfigurationDTO.md @@ -13,6 +15,9 @@ doc/ExportConfigurationDTOAllOf.md doc/GeoPointDTO.md doc/ImageDTO.md doc/ImageGeoPoint.md +doc/Instance.md +doc/InstanceApi.md +doc/InstanceDTO.md doc/LevelDTO.md doc/LoginDTO.md doc/MapDTO.md @@ -21,6 +26,7 @@ doc/MenuDTO.md doc/PlayerMessageDTO.md doc/QuestionDTO.md doc/QuizzDTO.md +doc/QuizzDTOBadLevel.md doc/ResourceApi.md doc/ResourceDTO.md doc/ResourceType.md @@ -41,6 +47,7 @@ lib/api.dart lib/api/authentication_api.dart lib/api/configuration_api.dart lib/api/device_api.dart +lib/api/instance_api.dart lib/api/resource_api.dart lib/api/section_api.dart lib/api/user_api.dart @@ -52,6 +59,7 @@ lib/auth/authentication.dart lib/auth/http_basic_auth.dart lib/auth/http_bearer_auth.dart lib/auth/oauth.dart +lib/model/article_dto.dart lib/model/configuration_dto.dart lib/model/device_detail_dto.dart lib/model/device_detail_dto_all_of.dart @@ -61,6 +69,8 @@ lib/model/export_configuration_dto_all_of.dart lib/model/geo_point_dto.dart lib/model/image_dto.dart lib/model/image_geo_point.dart +lib/model/instance.dart +lib/model/instance_dto.dart lib/model/level_dto.dart lib/model/login_dto.dart lib/model/map_dto.dart @@ -69,6 +79,7 @@ lib/model/menu_dto.dart lib/model/player_message_dto.dart lib/model/question_dto.dart lib/model/quizz_dto.dart +lib/model/quizz_dto_bad_level.dart lib/model/resource_dto.dart lib/model/resource_type.dart lib/model/response_dto.dart @@ -82,9 +93,3 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml -test/export_configuration_dto_all_of_test.dart -test/export_configuration_dto_test.dart -test/level_dto_test.dart -test/question_dto_test.dart -test/quizz_dto_test.dart -test/response_dto_test.dart diff --git a/manager_api/.openapi-generator/VERSION b/manager_api/.openapi-generator/VERSION index acf69b4..717311e 100644 --- a/manager_api/.openapi-generator/VERSION +++ b/manager_api/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.0 \ No newline at end of file +unset \ No newline at end of file diff --git a/manager_api/.travis.yml b/manager_api/.travis.yml index 1a3af66..2774ccb 100644 --- a/manager_api/.travis.yml +++ b/manager_api/.travis.yml @@ -6,7 +6,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "2.12" install: - pub get diff --git a/manager_api/README.md b/manager_api/README.md index c06ab5c..93893f7 100644 --- a/manager_api/README.md +++ b/manager_api/README.md @@ -1,4 +1,4 @@ -# managerapi +# manager_api API Manager Service This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -8,7 +8,7 @@ This Dart package is automatically generated by the [OpenAPI Generator](https:// ## Requirements -Dart 2.0 or later +Dart 2.12 or later ## Installation & Usage @@ -16,7 +16,7 @@ Dart 2.0 or later If this Dart package is published to Github, add the following dependency to your pubspec.yaml ``` dependencies: - managerapi: + manager_api: git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git ``` @@ -24,8 +24,8 @@ dependencies: To use the package in your local drive, add the following dependency to your pubspec.yaml ``` dependencies: - managerapi: - path: /path/to/managerapi + manager_api: + path: /path/to/manager_api ``` ## Tests @@ -37,7 +37,7 @@ TODO Please follow the [installation procedure](#installation--usage) and then run the following: ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -60,7 +60,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -79,6 +79,11 @@ Class | Method | HTTP request | Description *DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | *DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | *DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | +*InstanceApi* | [**instanceCreateInstance**](doc\/InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | +*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | +*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance | +*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | +*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | *ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource | *ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | *ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource | @@ -91,6 +96,7 @@ Class | Method | HTTP request | Description *SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | +*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | *SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | *SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | *SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | @@ -111,6 +117,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [ArticleDTO](doc\/ArticleDTO.md) - [ConfigurationDTO](doc\/ConfigurationDTO.md) - [DeviceDTO](doc\/DeviceDTO.md) - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) @@ -120,6 +127,8 @@ Class | Method | HTTP request | Description - [GeoPointDTO](doc\/GeoPointDTO.md) - [ImageDTO](doc\/ImageDTO.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [Instance](doc\/Instance.md) + - [InstanceDTO](doc\/InstanceDTO.md) - [LevelDTO](doc\/LevelDTO.md) - [LoginDTO](doc\/LoginDTO.md) - [MapDTO](doc\/MapDTO.md) @@ -128,6 +137,7 @@ Class | Method | HTTP request | Description - [PlayerMessageDTO](doc\/PlayerMessageDTO.md) - [QuestionDTO](doc\/QuestionDTO.md) - [QuizzDTO](doc\/QuizzDTO.md) + - [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md) - [ResourceDTO](doc\/ResourceDTO.md) - [ResourceType](doc\/ResourceType.md) - [ResponseDTO](doc\/ResponseDTO.md) @@ -158,4 +168,3 @@ Class | Method | HTTP request | Description - diff --git a/manager_api/analysis_options.yaml b/manager_api/analysis_options.yaml new file mode 100644 index 0000000..e69de29 diff --git a/manager_api/doc/ArticleDTO.md b/manager_api/doc/ArticleDTO.md new file mode 100644 index 0000000..66b99a4 --- /dev/null +++ b/manager_api/doc/ArticleDTO.md @@ -0,0 +1,19 @@ +# manager_api.model.ArticleDTO + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**isContentTop** | **bool** | | [optional] +**audioIds** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**isReadAudioAuto** | **bool** | | [optional] +**images** | [**List**](ImageDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/AuthenticationApi.md b/manager_api/doc/AuthenticationApi.md index 240d621..be64641 100644 --- a/manager_api/doc/AuthenticationApi.md +++ b/manager_api/doc/AuthenticationApi.md @@ -1,11 +1,11 @@ -# managerapi.api.AuthenticationApi +# manager_api.api.AuthenticationApi ## Load the API package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -18,9 +18,9 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -31,7 +31,7 @@ final password = password_example; // String | final clientId = clientId_example; // String | final clientSecret = clientSecret_example; // String | -try { +try { final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret); print(result); } catch (e) { @@ -69,16 +69,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AuthenticationApi(); final loginDTO = LoginDTO(); // LoginDTO | -try { +try { final result = api_instance.authenticationAuthenticateWithJson(loginDTO); print(result); } catch (e) { diff --git a/manager_api/doc/ConfigurationApi.md b/manager_api/doc/ConfigurationApi.md index 9783da9..751fdea 100644 --- a/manager_api/doc/ConfigurationApi.md +++ b/manager_api/doc/ConfigurationApi.md @@ -1,11 +1,11 @@ -# managerapi.api.ConfigurationApi +# manager_api.api.ConfigurationApi ## Load the API package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -23,16 +23,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); final configurationDTO = ConfigurationDTO(); // ConfigurationDTO | -try { +try { final result = api_instance.configurationCreate(configurationDTO); print(result); } catch (e) { @@ -66,16 +66,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); final id = id_example; // String | -try { +try { final result = api_instance.configurationDelete(id); print(result); } catch (e) { @@ -105,20 +105,20 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **configurationExport** -> ExportConfigurationDTO configurationExport(id) +> MultipartFile configurationExport(id) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); final id = id_example; // String | -try { +try { final result = api_instance.configurationExport(id); print(result); } catch (e) { @@ -134,7 +134,7 @@ Name | Type | Description | Notes ### Return type -[**ExportConfigurationDTO**](ExportConfigurationDTO.md) +[**MultipartFile**](MultipartFile.md) ### Authorization @@ -143,25 +143,26 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/octet-stream, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **configurationGet** -> List configurationGet() +> List configurationGet(instanceId) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); +final instanceId = instanceId_example; // String | -try { - final result = api_instance.configurationGet(); +try { + final result = api_instance.configurationGet(instanceId); print(result); } catch (e) { print('Exception when calling ConfigurationApi->configurationGet: $e\n'); @@ -169,7 +170,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type @@ -191,16 +195,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); final id = id_example; // String | -try { +try { final result = api_instance.configurationGetDetail(id); print(result); } catch (e) { @@ -234,16 +238,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); final exportConfigurationDTO = ExportConfigurationDTO(); // ExportConfigurationDTO | -try { +try { final result = api_instance.configurationImport(exportConfigurationDTO); print(result); } catch (e) { @@ -277,16 +281,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); final configurationDTO = ConfigurationDTO(); // ConfigurationDTO | -try { +try { final result = api_instance.configurationUpdate(configurationDTO); print(result); } catch (e) { diff --git a/manager_api/doc/ConfigurationDTO.md b/manager_api/doc/ConfigurationDTO.md index 425da4d..1856cc4 100644 --- a/manager_api/doc/ConfigurationDTO.md +++ b/manager_api/doc/ConfigurationDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.ConfigurationDTO +# manager_api.model.ConfigurationDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -10,10 +10,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | | [optional] **label** | **String** | | [optional] +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] **primaryColor** | **String** | | [optional] **secondaryColor** | **String** | | [optional] **languages** | **List** | | [optional] [default to const []] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isMobile** | **bool** | | [optional] +**isTablet** | **bool** | | [optional] +**isOffline** | **bool** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/DeviceApi.md b/manager_api/doc/DeviceApi.md index da2f466..30e9574 100644 --- a/manager_api/doc/DeviceApi.md +++ b/manager_api/doc/DeviceApi.md @@ -1,11 +1,11 @@ -# managerapi.api.DeviceApi +# manager_api.api.DeviceApi ## Load the API package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,16 +22,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | -try { +try { final result = api_instance.deviceCreate(deviceDetailDTO); print(result); } catch (e) { @@ -65,16 +65,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final id = id_example; // String | -try { +try { final result = api_instance.deviceDelete(id); print(result); } catch (e) { @@ -104,20 +104,21 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGet** -> List deviceGet() +> List deviceGet(instanceId) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); +final instanceId = instanceId_example; // String | -try { - final result = api_instance.deviceGet(); +try { + final result = api_instance.deviceGet(instanceId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGet: $e\n'); @@ -125,7 +126,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type @@ -147,16 +151,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final id = id_example; // String | -try { +try { final result = api_instance.deviceGetDetail(id); print(result); } catch (e) { @@ -190,16 +194,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | -try { +try { final result = api_instance.deviceUpdate(deviceDetailDTO); print(result); } catch (e) { @@ -233,16 +237,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceDTO = DeviceDTO(); // DeviceDTO | -try { +try { final result = api_instance.deviceUpdateMainInfos(deviceDTO); print(result); } catch (e) { diff --git a/manager_api/doc/DeviceDTO.md b/manager_api/doc/DeviceDTO.md index 62df565..0f99dac 100644 --- a/manager_api/doc/DeviceDTO.md +++ b/manager_api/doc/DeviceDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.DeviceDTO +# manager_api.model.DeviceDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -18,6 +18,7 @@ Name | Type | Description | Notes **connected** | **bool** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/DeviceDetailDTO.md b/manager_api/doc/DeviceDetailDTO.md index 4968995..2d9ed26 100644 --- a/manager_api/doc/DeviceDetailDTO.md +++ b/manager_api/doc/DeviceDetailDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.DeviceDetailDTO +# manager_api.model.DeviceDetailDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -18,6 +18,7 @@ Name | Type | Description | Notes **connected** | **bool** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] **connectionLevel** | **String** | | [optional] **lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] **batteryLevel** | **String** | | [optional] diff --git a/manager_api/doc/DeviceDetailDTOAllOf.md b/manager_api/doc/DeviceDetailDTOAllOf.md index 0cc0886..8d701aa 100644 --- a/manager_api/doc/DeviceDetailDTOAllOf.md +++ b/manager_api/doc/DeviceDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# managerapi.model.DeviceDetailDTOAllOf +# manager_api.model.DeviceDetailDTOAllOf ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/ExportConfigurationDTO.md b/manager_api/doc/ExportConfigurationDTO.md index 7c7c3f9..4e16206 100644 --- a/manager_api/doc/ExportConfigurationDTO.md +++ b/manager_api/doc/ExportConfigurationDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.ExportConfigurationDTO +# manager_api.model.ExportConfigurationDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -10,10 +10,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | | [optional] **label** | **String** | | [optional] +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] **primaryColor** | **String** | | [optional] **secondaryColor** | **String** | | [optional] **languages** | **List** | | [optional] [default to const []] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isMobile** | **bool** | | [optional] +**isTablet** | **bool** | | [optional] +**isOffline** | **bool** | | [optional] +**instanceId** | **String** | | [optional] **sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] **resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] diff --git a/manager_api/doc/ExportConfigurationDTOAllOf.md b/manager_api/doc/ExportConfigurationDTOAllOf.md index e369543..21322a8 100644 --- a/manager_api/doc/ExportConfigurationDTOAllOf.md +++ b/manager_api/doc/ExportConfigurationDTOAllOf.md @@ -1,8 +1,8 @@ -# managerapi.model.ExportConfigurationDTOAllOf +# manager_api.model.ExportConfigurationDTOAllOf ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/GeoPointDTO.md b/manager_api/doc/GeoPointDTO.md index bb5d545..7423c02 100644 --- a/manager_api/doc/GeoPointDTO.md +++ b/manager_api/doc/GeoPointDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.GeoPointDTO +# manager_api.model.GeoPointDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/ImageDTO.md b/manager_api/doc/ImageDTO.md index 1f2c7b5..9844084 100644 --- a/manager_api/doc/ImageDTO.md +++ b/manager_api/doc/ImageDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.ImageDTO +# manager_api.model.ImageDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/ImageGeoPoint.md b/manager_api/doc/ImageGeoPoint.md index e290427..73dd52f 100644 --- a/manager_api/doc/ImageGeoPoint.md +++ b/manager_api/doc/ImageGeoPoint.md @@ -1,8 +1,8 @@ -# managerapi.model.ImageGeoPoint +# manager_api.model.ImageGeoPoint ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/Instance.md b/manager_api/doc/Instance.md new file mode 100644 index 0000000..dd6770c --- /dev/null +++ b/manager_api/doc/Instance.md @@ -0,0 +1,17 @@ +# manager_api.model.Instance + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/InstanceApi.md b/manager_api/doc/InstanceApi.md new file mode 100644 index 0000000..cf81e4a --- /dev/null +++ b/manager_api/doc/InstanceApi.md @@ -0,0 +1,229 @@ +# manager_api.api.InstanceApi + +## Load the API package +```dart +import 'package:manager_api/api.dart'; +``` + +All URIs are relative to *https://api.mymuseum.be* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**instanceCreateInstance**](InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | +[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | +[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance | +[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | +[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | + + +# **instanceCreateInstance** +> InstanceDTO instanceCreateInstance(instance) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final instance = Instance(); // Instance | + +try { + final result = api_instance.instanceCreateInstance(instance); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceCreateInstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance** | [**Instance**](Instance.md)| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceDeleteInstance** +> String instanceDeleteInstance(id) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final id = id_example; // String | + +try { + final result = api_instance.instanceDeleteInstance(id); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceDeleteInstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceGet** +> List instanceGet() + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); + +try { + final result = api_instance.instanceGet(); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](Instance.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceGetDetail** +> InstanceDTO instanceGetDetail(id) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final id = id_example; // String | + +try { + final result = api_instance.instanceGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceUpdateinstance** +> InstanceDTO instanceUpdateinstance(instance) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final instance = Instance(); // Instance | + +try { + final result = api_instance.instanceUpdateinstance(instance); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceUpdateinstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance** | [**Instance**](Instance.md)| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api/doc/InstanceDTO.md b/manager_api/doc/InstanceDTO.md new file mode 100644 index 0000000..1f678ff --- /dev/null +++ b/manager_api/doc/InstanceDTO.md @@ -0,0 +1,17 @@ +# manager_api.model.InstanceDTO + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/LevelDTO.md b/manager_api/doc/LevelDTO.md index af91156..e936fdb 100644 --- a/manager_api/doc/LevelDTO.md +++ b/manager_api/doc/LevelDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.LevelDTO +# manager_api.model.LevelDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/LoginDTO.md b/manager_api/doc/LoginDTO.md index c5d85da..fa86966 100644 --- a/manager_api/doc/LoginDTO.md +++ b/manager_api/doc/LoginDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.LoginDTO +# manager_api.model.LoginDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/MapDTO.md b/manager_api/doc/MapDTO.md index 656bd08..8701cf7 100644 --- a/manager_api/doc/MapDTO.md +++ b/manager_api/doc/MapDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.MapDTO +# manager_api.model.MapDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/MapTypeApp.md b/manager_api/doc/MapTypeApp.md index 4d1d1a4..b8ef959 100644 --- a/manager_api/doc/MapTypeApp.md +++ b/manager_api/doc/MapTypeApp.md @@ -1,8 +1,8 @@ -# managerapi.model.MapTypeApp +# manager_api.model.MapTypeApp ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/MenuDTO.md b/manager_api/doc/MenuDTO.md index 960de2c..cdbc1db 100644 --- a/manager_api/doc/MenuDTO.md +++ b/manager_api/doc/MenuDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.MenuDTO +# manager_api.model.MenuDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/PlayerMessageDTO.md b/manager_api/doc/PlayerMessageDTO.md index 0f07218..b5a97b7 100644 --- a/manager_api/doc/PlayerMessageDTO.md +++ b/manager_api/doc/PlayerMessageDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.PlayerMessageDTO +# manager_api.model.PlayerMessageDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/QuestionDTO.md b/manager_api/doc/QuestionDTO.md index 1827076..f119fb3 100644 --- a/manager_api/doc/QuestionDTO.md +++ b/manager_api/doc/QuestionDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.QuestionDTO +# manager_api.model.QuestionDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/QuizzDTO.md b/manager_api/doc/QuizzDTO.md index 953a3d7..11c9d89 100644 --- a/manager_api/doc/QuizzDTO.md +++ b/manager_api/doc/QuizzDTO.md @@ -1,18 +1,18 @@ -# managerapi.model.QuizzDTO +# manager_api.model.QuizzDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **questions** | [**List**](QuestionDTO.md) | | [optional] [default to const []] -**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] -**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] -**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] -**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**badLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional] +**mediumLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional] +**goodLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional] +**greatLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/QuizzDTOBadLevel.md b/manager_api/doc/QuizzDTOBadLevel.md new file mode 100644 index 0000000..94aa6b1 --- /dev/null +++ b/manager_api/doc/QuizzDTOBadLevel.md @@ -0,0 +1,17 @@ +# manager_api.model.QuizzDTOBadLevel + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/ResourceApi.md b/manager_api/doc/ResourceApi.md index 8efbe20..83d00db 100644 --- a/manager_api/doc/ResourceApi.md +++ b/manager_api/doc/ResourceApi.md @@ -1,11 +1,11 @@ -# managerapi.api.ResourceApi +# manager_api.api.ResourceApi ## Load the API package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -23,16 +23,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); final resourceDTO = ResourceDTO(); // ResourceDTO | -try { +try { final result = api_instance.resourceCreate(resourceDTO); print(result); } catch (e) { @@ -66,16 +66,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); final id = id_example; // String | -try { +try { final result = api_instance.resourceDelete(id); print(result); } catch (e) { @@ -105,20 +105,22 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resourceGet** -> List resourceGet() +> List resourceGet(instanceId, types) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); +final instanceId = instanceId_example; // String | +final types = []; // List | -try { - final result = api_instance.resourceGet(); +try { + final result = api_instance.resourceGet(instanceId, types); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceGet: $e\n'); @@ -126,7 +128,11 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] + **types** | [**List**](ResourceType.md)| | [optional] [default to const []] ### Return type @@ -148,16 +154,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); final id = id_example; // String | -try { +try { final result = api_instance.resourceGetDetail(id); print(result); } catch (e) { @@ -191,16 +197,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); final id = id_example; // String | -try { +try { final result = api_instance.resourceShow(id); print(result); } catch (e) { @@ -234,16 +240,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); final resourceDTO = ResourceDTO(); // ResourceDTO | -try { +try { final result = api_instance.resourceUpdate(resourceDTO); print(result); } catch (e) { @@ -273,22 +279,23 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resourceUpload** -> String resourceUpload(label, type) +> String resourceUpload(label, type, instanceId) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); final label = label_example; // String | final type = type_example; // String | +final instanceId = instanceId_example; // String | -try { - final result = api_instance.resourceUpload(label, type); +try { + final result = api_instance.resourceUpload(label, type, instanceId); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceUpload: $e\n'); @@ -301,6 +308,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **label** | **String**| | [optional] **type** | **String**| | [optional] + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/ResourceDTO.md b/manager_api/doc/ResourceDTO.md index d2acd16..6289a37 100644 --- a/manager_api/doc/ResourceDTO.md +++ b/manager_api/doc/ResourceDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.ResourceDTO +# manager_api.model.ResourceDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -11,8 +11,9 @@ Name | Type | Description | Notes **id** | **String** | | [optional] **type** | [**ResourceType**](ResourceType.md) | | [optional] **label** | **String** | | [optional] -**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **data** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/ResourceType.md b/manager_api/doc/ResourceType.md index 05e673f..afd3f6e 100644 --- a/manager_api/doc/ResourceType.md +++ b/manager_api/doc/ResourceType.md @@ -1,8 +1,8 @@ -# managerapi.model.ResourceType +# manager_api.model.ResourceType ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/ResponseDTO.md b/manager_api/doc/ResponseDTO.md index 4b5334a..7e6ed27 100644 --- a/manager_api/doc/ResponseDTO.md +++ b/manager_api/doc/ResponseDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.ResponseDTO +# manager_api.model.ResponseDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/SectionApi.md b/manager_api/doc/SectionApi.md index 0d62dd8..93873b6 100644 --- a/manager_api/doc/SectionApi.md +++ b/manager_api/doc/SectionApi.md @@ -1,11 +1,11 @@ -# managerapi.api.SectionApi +# manager_api.api.SectionApi ## Load the API package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -14,6 +14,7 @@ Method | HTTP request | Description [**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | +[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | [**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | [**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | [**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | @@ -32,16 +33,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final sectionDTO = SectionDTO(); // SectionDTO | -try { +try { final result = api_instance.sectionCreate(sectionDTO); print(result); } catch (e) { @@ -75,16 +76,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final id = id_example; // String | -try { +try { final result = api_instance.sectionDelete(id); print(result); } catch (e) { @@ -118,16 +119,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final id = id_example; // String | -try { +try { final result = api_instance.sectionDeleteAllForConfiguration(id); print(result); } catch (e) { @@ -157,20 +158,21 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **sectionGet** -> List sectionGet() +> List sectionGet(instanceId) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); +final instanceId = instanceId_example; // String | -try { - final result = api_instance.sectionGet(); +try { + final result = api_instance.sectionGet(instanceId); print(result); } catch (e) { print('Exception when calling SectionApi->sectionGet: $e\n'); @@ -178,7 +180,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type @@ -200,16 +205,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final id = id_example; // String | -try { +try { final result = api_instance.sectionGetAllSectionSubSections(id); print(result); } catch (e) { @@ -238,21 +243,60 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **sectionGetArticleDTO** +> ArticleDTO sectionGetArticleDTO() + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetArticleDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetArticleDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ArticleDTO**](ArticleDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **sectionGetDetail** > SectionDTO sectionGetDetail(id) -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final id = id_example; // String | -try { +try { final result = api_instance.sectionGetDetail(id); print(result); } catch (e) { @@ -286,16 +330,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final id = id_example; // String | -try { +try { final result = api_instance.sectionGetFromConfiguration(id); print(result); } catch (e) { @@ -329,15 +373,15 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionGetMapDTO(); print(result); } catch (e) { @@ -368,15 +412,15 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionGetMenuDTO(); print(result); } catch (e) { @@ -407,15 +451,15 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionGetQuizzDTO(); print(result); } catch (e) { @@ -446,15 +490,15 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionGetSliderDTO(); print(result); } catch (e) { @@ -485,15 +529,15 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionGetVideoDTO(); print(result); } catch (e) { @@ -524,15 +568,15 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionGetWebDTO(); print(result); } catch (e) { @@ -563,15 +607,15 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); -try { +try { final result = api_instance.sectionPlayerMessageDTO(); print(result); } catch (e) { @@ -602,16 +646,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final sectionDTO = SectionDTO(); // SectionDTO | -try { +try { final result = api_instance.sectionUpdate(sectionDTO); print(result); } catch (e) { @@ -645,16 +689,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); final sectionDTO = [List()]; // List | -try { +try { final result = api_instance.sectionUpdateOrder(sectionDTO); print(result); } catch (e) { diff --git a/manager_api/doc/SectionDTO.md b/manager_api/doc/SectionDTO.md index 46dec96..0349cd4 100644 --- a/manager_api/doc/SectionDTO.md +++ b/manager_api/doc/SectionDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.SectionDTO +# manager_api.model.SectionDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -21,6 +21,12 @@ Name | Type | Description | Notes **data** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **order** | **int** | | [optional] +**instanceId** | **String** | | [optional] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**meterZoneGPS** | **int** | | [optional] +**isBeacon** | **bool** | | [optional] +**beaconId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/SectionType.md b/manager_api/doc/SectionType.md index c192bbd..8374ab6 100644 --- a/manager_api/doc/SectionType.md +++ b/manager_api/doc/SectionType.md @@ -1,8 +1,8 @@ -# managerapi.model.SectionType +# manager_api.model.SectionType ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/SliderDTO.md b/manager_api/doc/SliderDTO.md index a5df1e8..36c8207 100644 --- a/manager_api/doc/SliderDTO.md +++ b/manager_api/doc/SliderDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.SliderDTO +# manager_api.model.SliderDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/TokenDTO.md b/manager_api/doc/TokenDTO.md index e031252..f8a2124 100644 --- a/manager_api/doc/TokenDTO.md +++ b/manager_api/doc/TokenDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.TokenDTO +# manager_api.model.TokenDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -14,6 +14,7 @@ Name | Type | Description | Notes **tokenType** | **String** | | [optional] **expiresIn** | **int** | | [optional] **expiration** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/TranslationDTO.md b/manager_api/doc/TranslationDTO.md index fef92bf..45938ec 100644 --- a/manager_api/doc/TranslationDTO.md +++ b/manager_api/doc/TranslationDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.TranslationDTO +# manager_api.model.TranslationDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/User.md b/manager_api/doc/User.md index e1f1f90..b51b3d3 100644 --- a/manager_api/doc/User.md +++ b/manager_api/doc/User.md @@ -1,8 +1,8 @@ -# managerapi.model.User +# manager_api.model.User ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties @@ -15,6 +15,7 @@ Name | Type | Description | Notes **lastName** | **String** | | [optional] **token** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/UserApi.md b/manager_api/doc/UserApi.md index 4f53b8e..5963708 100644 --- a/manager_api/doc/UserApi.md +++ b/manager_api/doc/UserApi.md @@ -1,11 +1,11 @@ -# managerapi.api.UserApi +# manager_api.api.UserApi ## Load the API package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://192.168.31.140* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -21,16 +21,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final user = User(); // User | -try { +try { final result = api_instance.userCreateUser(user); print(result); } catch (e) { @@ -64,16 +64,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final id = id_example; // String | -try { +try { final result = api_instance.userDeleteUser(id); print(result); } catch (e) { @@ -107,15 +107,15 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); -try { +try { final result = api_instance.userGet(); print(result); } catch (e) { @@ -146,16 +146,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final id = id_example; // String | -try { +try { final result = api_instance.userGetDetail(id); print(result); } catch (e) { @@ -189,16 +189,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final user = User(); // User | -try { +try { final result = api_instance.userUpdateUser(user); print(result); } catch (e) { diff --git a/manager_api/doc/UserDetailDTO.md b/manager_api/doc/UserDetailDTO.md index 6b1a0e9..27a3126 100644 --- a/manager_api/doc/UserDetailDTO.md +++ b/manager_api/doc/UserDetailDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.UserDetailDTO +# manager_api.model.UserDetailDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/VideoDTO.md b/manager_api/doc/VideoDTO.md index 08c8315..a13142e 100644 --- a/manager_api/doc/VideoDTO.md +++ b/manager_api/doc/VideoDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.VideoDTO +# manager_api.model.VideoDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/doc/WebDTO.md b/manager_api/doc/WebDTO.md index 3b26ea1..a6ac523 100644 --- a/manager_api/doc/WebDTO.md +++ b/manager_api/doc/WebDTO.md @@ -1,8 +1,8 @@ -# managerapi.model.WebDTO +# manager_api.model.WebDTO ## Load the model package ```dart -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; ``` ## Properties diff --git a/manager_api/git_push.sh b/manager_api/git_push.sh index ced3be2..f53a75d 100644 --- a/manager_api/git_push.sh +++ b/manager_api/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index 942b8c8..3d214e5 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars library openapi.api; @@ -15,7 +16,6 @@ import 'dart:io'; import 'package:http/http.dart'; import 'package:intl/intl.dart'; - import 'package:meta/meta.dart'; part 'api_client.dart'; @@ -30,10 +30,12 @@ part 'auth/http_bearer_auth.dart'; part 'api/authentication_api.dart'; part 'api/configuration_api.dart'; part 'api/device_api.dart'; +part 'api/instance_api.dart'; part 'api/resource_api.dart'; part 'api/section_api.dart'; part 'api/user_api.dart'; +part 'model/article_dto.dart'; part 'model/configuration_dto.dart'; part 'model/device_dto.dart'; part 'model/device_detail_dto.dart'; @@ -43,6 +45,8 @@ part 'model/export_configuration_dto_all_of.dart'; part 'model/geo_point_dto.dart'; part 'model/image_dto.dart'; part 'model/image_geo_point.dart'; +part 'model/instance.dart'; +part 'model/instance_dto.dart'; part 'model/level_dto.dart'; part 'model/login_dto.dart'; part 'model/map_dto.dart'; @@ -51,6 +55,7 @@ part 'model/menu_dto.dart'; part 'model/player_message_dto.dart'; part 'model/question_dto.dart'; part 'model/quizz_dto.dart'; +part 'model/quizz_dto_bad_level.dart'; part 'model/resource_dto.dart'; part 'model/resource_type.dart'; part 'model/response_dto.dart'; diff --git a/manager_api/lib/api/authentication_api.dart b/manager_api/lib/api/authentication_api.dart index 8868812..e8647e9 100644 --- a/manager_api/lib/api/authentication_api.dart +++ b/manager_api/lib/api/authentication_api.dart @@ -1,17 +1,18 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class AuthenticationApi { - AuthenticationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + AuthenticationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -27,77 +28,53 @@ class AuthenticationApi { /// * [String] clientId: /// /// * [String] clientSecret: - Future authenticationAuthenticateWithFormWithHttpInfo({ String grantType, String username, String password, String clientId, String clientSecret }) async { - // Verify required params are set. - + Future authenticationAuthenticateWithFormWithHttpInfo({ String? grantType, String? username, String? password, String? clientId, String? clientSecret, }) async { + // ignore: prefer_const_declarations final path = r'/api/Authentication/Token'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['multipart/form-data']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['multipart/form-data']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (grantType != null) { - hasFields = true; - mp.fields[r'grant_type'] = parameterToString(grantType); - } - if (username != null) { - hasFields = true; - mp.fields[r'username'] = parameterToString(username); - } - if (password != null) { - hasFields = true; - mp.fields[r'password'] = parameterToString(password); - } - if (clientId != null) { - hasFields = true; - mp.fields[r'client_id'] = parameterToString(clientId); - } - if (clientSecret != null) { - hasFields = true; - mp.fields[r'client_secret'] = parameterToString(clientSecret); - } - if (hasFields) { - postBody = mp; - } - } else { - if (grantType != null) { - formParams[r'grant_type'] = parameterToString(grantType); - } - if (username != null) { - formParams[r'username'] = parameterToString(username); - } - if (password != null) { - formParams[r'password'] = parameterToString(password); - } - if (clientId != null) { - formParams[r'client_id'] = parameterToString(clientId); - } - if (clientSecret != null) { - formParams[r'client_secret'] = parameterToString(clientSecret); - } + bool hasFields = false; + final mp = MultipartRequest('POST', Uri.parse(path)); + if (grantType != null) { + hasFields = true; + mp.fields[r'grant_type'] = parameterToString(grantType); + } + if (username != null) { + hasFields = true; + mp.fields[r'username'] = parameterToString(username); + } + if (password != null) { + hasFields = true; + mp.fields[r'password'] = parameterToString(password); + } + if (clientId != null) { + hasFields = true; + mp.fields[r'client_id'] = parameterToString(clientId); + } + if (clientSecret != null) { + hasFields = true; + mp.fields[r'client_secret'] = parameterToString(clientSecret); + } + if (hasFields) { + postBody = mp; } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } @@ -112,80 +89,65 @@ class AuthenticationApi { /// * [String] clientId: /// /// * [String] clientSecret: - Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async { - final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret ); + Future authenticationAuthenticateWithForm({ String? grantType, String? username, String? password, String? clientId, String? clientSecret, }) async { + final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret, ); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TokenDTO',) as TokenDTO; + + } + return null; } /// Performs an HTTP 'POST /api/Authentication/Authenticate' operation and returns the [Response]. /// Parameters: /// /// * [LoginDTO] loginDTO (required): - Future authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO) async { - // Verify required params are set. - if (loginDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO'); - } - + Future authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Authentication/Authenticate'; - Object postBody = loginDTO; + // ignore: prefer_final_locals + Object? postBody = loginDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [LoginDTO] loginDTO (required): - Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async { - final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO); + Future authenticationAuthenticateWithJson(LoginDTO loginDTO,) async { + final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TokenDTO',) as TokenDTO; + + } + return null; } } diff --git a/manager_api/lib/api/configuration_api.dart b/manager_api/lib/api/configuration_api.dart index 342f0f0..ffc3cf0 100644 --- a/manager_api/lib/api/configuration_api.dart +++ b/manager_api/lib/api/configuration_api.dart @@ -1,17 +1,18 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class ConfigurationApi { - ConfigurationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + ConfigurationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,434 +20,338 @@ class ConfigurationApi { /// Parameters: /// /// * [ConfigurationDTO] configurationDTO (required): - Future configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO) async { - // Verify required params are set. - if (configurationDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO'); - } - + Future configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration'; - Object postBody = configurationDTO; + // ignore: prefer_final_locals + Object? postBody = configurationDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [ConfigurationDTO] configurationDTO (required): - Future configurationCreate(ConfigurationDTO configurationDTO) async { - final response = await configurationCreateWithHttpInfo(configurationDTO); + Future configurationCreate(ConfigurationDTO configurationDTO,) async { + final response = await configurationCreateWithHttpInfo(configurationDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO; + + } + return null; } /// Performs an HTTP 'DELETE /api/Configuration/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future configurationDeleteWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future configurationDeleteWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future configurationDelete(String id) async { - final response = await configurationDeleteWithHttpInfo(id); + Future configurationDelete(String id,) async { + final response = await configurationDeleteWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future configurationExportWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future configurationExportWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration/{id}/export' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future configurationExport(String id) async { - final response = await configurationExportWithHttpInfo(id); + Future configurationExport(String id,) async { + final response = await configurationExportWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ExportConfigurationDTO') as ExportConfigurationDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile; + + } + return null; } /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. - Future configurationGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future configurationGetWithHttpInfo({ String? instanceId, }) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; - - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); } - return await apiClient.invokeAPI( + const contentTypes = []; + + + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future> configurationGet() async { - final response = await configurationGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> configurationGet({ String? instanceId, }) async { + final response = await configurationGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; } /// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future configurationGetDetailWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future configurationGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future configurationGetDetail(String id) async { - final response = await configurationGetDetailWithHttpInfo(id); + Future configurationGetDetail(String id,) async { + final response = await configurationGetDetailWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO; + + } + return null; } /// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response]. /// Parameters: /// /// * [ExportConfigurationDTO] exportConfigurationDTO (required): - Future configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async { - // Verify required params are set. - if (exportConfigurationDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO'); - } - + Future configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration/import'; - Object postBody = exportConfigurationDTO; + // ignore: prefer_final_locals + Object? postBody = exportConfigurationDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [ExportConfigurationDTO] exportConfigurationDTO (required): - Future configurationImport(ExportConfigurationDTO exportConfigurationDTO) async { - final response = await configurationImportWithHttpInfo(exportConfigurationDTO); + Future configurationImport(ExportConfigurationDTO exportConfigurationDTO,) async { + final response = await configurationImportWithHttpInfo(exportConfigurationDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response]. /// Parameters: /// /// * [ConfigurationDTO] configurationDTO (required): - Future configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO) async { - // Verify required params are set. - if (configurationDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO'); - } - + Future configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Configuration'; - Object postBody = configurationDTO; + // ignore: prefer_final_locals + Object? postBody = configurationDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [ConfigurationDTO] configurationDTO (required): - Future configurationUpdate(ConfigurationDTO configurationDTO) async { - final response = await configurationUpdateWithHttpInfo(configurationDTO); + Future configurationUpdate(ConfigurationDTO configurationDTO,) async { + final response = await configurationUpdateWithHttpInfo(configurationDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO; + + } + return null; } } diff --git a/manager_api/lib/api/device_api.dart b/manager_api/lib/api/device_api.dart index 7162ac9..7bb84ed 100644 --- a/manager_api/lib/api/device_api.dart +++ b/manager_api/lib/api/device_api.dart @@ -1,17 +1,18 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class DeviceApi { - DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + DeviceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,370 +20,290 @@ class DeviceApi { /// Parameters: /// /// * [DeviceDetailDTO] deviceDetailDTO (required): - Future deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { - // Verify required params are set. - if (deviceDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); - } - + Future deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Device'; - Object postBody = deviceDetailDTO; + // ignore: prefer_final_locals + Object? postBody = deviceDetailDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [DeviceDetailDTO] deviceDetailDTO (required): - Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async { - final response = await deviceCreateWithHttpInfo(deviceDetailDTO); + Future deviceCreate(DeviceDetailDTO deviceDetailDTO,) async { + final response = await deviceCreateWithHttpInfo(deviceDetailDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO; + + } + return null; } /// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future deviceDeleteWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future deviceDeleteWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Device/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future deviceDelete(String id) async { - final response = await deviceDeleteWithHttpInfo(id); + Future deviceDelete(String id,) async { + final response = await deviceDeleteWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. - Future deviceGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future deviceGetWithHttpInfo({ String? instanceId, }) async { + // ignore: prefer_const_declarations final path = r'/api/Device'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; - - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); } - return await apiClient.invokeAPI( + const contentTypes = []; + + + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future> deviceGet() async { - final response = await deviceGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> deviceGet({ String? instanceId, }) async { + final response = await deviceGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; } /// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future deviceGetDetailWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future deviceGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Device/{id}/detail' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future deviceGetDetail(String id) async { - final response = await deviceGetDetailWithHttpInfo(id); + Future deviceGetDetail(String id,) async { + final response = await deviceGetDetailWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO; + + } + return null; } /// Performs an HTTP 'PUT /api/Device' operation and returns the [Response]. /// Parameters: /// /// * [DeviceDetailDTO] deviceDetailDTO (required): - Future deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { - // Verify required params are set. - if (deviceDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); - } - + Future deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Device'; - Object postBody = deviceDetailDTO; + // ignore: prefer_final_locals + Object? postBody = deviceDetailDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [DeviceDetailDTO] deviceDetailDTO (required): - Future deviceUpdate(DeviceDetailDTO deviceDetailDTO) async { - final response = await deviceUpdateWithHttpInfo(deviceDetailDTO); + Future deviceUpdate(DeviceDetailDTO deviceDetailDTO,) async { + final response = await deviceUpdateWithHttpInfo(deviceDetailDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO; + + } + return null; } /// Performs an HTTP 'PUT /api/Device/mainInfos' operation and returns the [Response]. /// Parameters: /// /// * [DeviceDTO] deviceDTO (required): - Future deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO) async { - // Verify required params are set. - if (deviceDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDTO'); - } - + Future deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Device/mainInfos'; - Object postBody = deviceDTO; + // ignore: prefer_final_locals + Object? postBody = deviceDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [DeviceDTO] deviceDTO (required): - Future deviceUpdateMainInfos(DeviceDTO deviceDTO) async { - final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO); + Future deviceUpdateMainInfos(DeviceDTO deviceDTO,) async { + final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDTO') as DeviceDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDTO',) as DeviceDTO; + + } + return null; } } diff --git a/manager_api/lib/api/instance_api.dart b/manager_api/lib/api/instance_api.dart new file mode 100644 index 0000000..ef652ce --- /dev/null +++ b/manager_api/lib/api/instance_api.dart @@ -0,0 +1,252 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class InstanceApi { + InstanceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Instance' operation and returns the [Response]. + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceCreateInstanceWithHttpInfo(Instance instance,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance'; + + // ignore: prefer_final_locals + Object? postBody = instance; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceCreateInstance(Instance instance,) async { + final response = await instanceCreateInstanceWithHttpInfo(instance,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO; + + } + return null; + } + + /// Performs an HTTP 'DELETE /api/Instance/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future instanceDeleteInstanceWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance/{id}' + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future instanceDeleteInstance(String id,) async { + final response = await instanceDeleteInstanceWithHttpInfo(id,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; + } + + /// Performs an HTTP 'GET /api/Instance' operation and returns the [Response]. + Future instanceGetWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Instance'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future?> instanceGet() async { + final response = await instanceGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) + .cast() + .toList(); + + } + return null; + } + + /// Performs an HTTP 'GET /api/Instance/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future instanceGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance/{id}' + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future instanceGetDetail(String id,) async { + final response = await instanceGetDetailWithHttpInfo(id,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO; + + } + return null; + } + + /// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response]. + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceUpdateinstanceWithHttpInfo(Instance instance,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance'; + + // ignore: prefer_final_locals + Object? postBody = instance; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceUpdateinstance(Instance instance,) async { + final response = await instanceUpdateinstanceWithHttpInfo(instance,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO; + + } + return null; + } +} diff --git a/manager_api/lib/api/resource_api.dart b/manager_api/lib/api/resource_api.dart index 6423466..bb0ea9d 100644 --- a/manager_api/lib/api/resource_api.dart +++ b/manager_api/lib/api/resource_api.dart @@ -1,17 +1,18 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class ResourceApi { - ResourceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + ResourceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,372 +20,299 @@ class ResourceApi { /// Parameters: /// /// * [ResourceDTO] resourceDTO (required): - Future resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async { - // Verify required params are set. - if (resourceDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO'); - } - + Future resourceCreateWithHttpInfo(ResourceDTO resourceDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Resource'; - Object postBody = resourceDTO; + // ignore: prefer_final_locals + Object? postBody = resourceDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [ResourceDTO] resourceDTO (required): - Future resourceCreate(ResourceDTO resourceDTO) async { - final response = await resourceCreateWithHttpInfo(resourceDTO); + Future resourceCreate(ResourceDTO resourceDTO,) async { + final response = await resourceCreateWithHttpInfo(resourceDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO; + + } + return null; } /// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future resourceDeleteWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future resourceDeleteWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Resource/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future resourceDelete(String id) async { - final response = await resourceDeleteWithHttpInfo(id); + Future resourceDelete(String id,) async { + final response = await resourceDeleteWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'GET /api/Resource' operation and returns the [Response]. - Future resourceGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + /// + /// * [List] types: + Future resourceGetWithHttpInfo({ String? instanceId, List? types, }) async { + // ignore: prefer_const_declarations final path = r'/api/Resource'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; - - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); + } + if (types != null) { + queryParams.addAll(_queryParams('multi', 'types', types)); } - return await apiClient.invokeAPI( + const contentTypes = []; + + + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future> resourceGet() async { - final response = await resourceGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + /// + /// * [List] types: + Future?> resourceGet({ String? instanceId, List? types, }) async { + final response = await resourceGetWithHttpInfo( instanceId: instanceId, types: types, ); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; } /// Performs an HTTP 'GET /api/Resource/{id}/detail' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future resourceGetDetailWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future resourceGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Resource/{id}/detail' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future resourceGetDetail(String id) async { - final response = await resourceGetDetailWithHttpInfo(id); + Future resourceGetDetail(String id,) async { + final response = await resourceGetDetailWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future resourceShowWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future resourceShowWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Resource/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future resourceShow(String id) async { - final response = await resourceShowWithHttpInfo(id); + Future resourceShow(String id,) async { + final response = await resourceShowWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile; + + } + return null; } /// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response]. /// Parameters: /// /// * [ResourceDTO] resourceDTO (required): - Future resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async { - // Verify required params are set. - if (resourceDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO'); - } - + Future resourceUpdateWithHttpInfo(ResourceDTO resourceDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Resource'; - Object postBody = resourceDTO; + // ignore: prefer_final_locals + Object? postBody = resourceDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [ResourceDTO] resourceDTO (required): - Future resourceUpdate(ResourceDTO resourceDTO) async { - final response = await resourceUpdateWithHttpInfo(resourceDTO); + Future resourceUpdate(ResourceDTO resourceDTO,) async { + final response = await resourceUpdateWithHttpInfo(resourceDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO; + + } + return null; } /// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response]. @@ -393,56 +321,47 @@ class ResourceApi { /// * [String] label: /// /// * [String] type: - Future resourceUploadWithHttpInfo({ String label, String type }) async { - // Verify required params are set. - + /// + /// * [String] instanceId: + Future resourceUploadWithHttpInfo({ String? label, String? type, String? instanceId, }) async { + // ignore: prefer_const_declarations final path = r'/api/Resource/upload'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['multipart/form-data']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['multipart/form-data']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (label != null) { - hasFields = true; - mp.fields[r'label'] = parameterToString(label); - } - if (type != null) { - hasFields = true; - mp.fields[r'type'] = parameterToString(type); - } - if (hasFields) { - postBody = mp; - } - } else { - if (label != null) { - formParams[r'label'] = parameterToString(label); - } - if (type != null) { - formParams[r'type'] = parameterToString(type); - } + bool hasFields = false; + final mp = MultipartRequest('POST', Uri.parse(path)); + if (label != null) { + hasFields = true; + mp.fields[r'label'] = parameterToString(label); + } + if (type != null) { + hasFields = true; + mp.fields[r'type'] = parameterToString(type); + } + if (instanceId != null) { + hasFields = true; + mp.fields[r'instanceId'] = parameterToString(instanceId); + } + if (hasFields) { + postBody = mp; } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } @@ -451,17 +370,20 @@ class ResourceApi { /// * [String] label: /// /// * [String] type: - Future resourceUpload({ String label, String type }) async { - final response = await resourceUploadWithHttpInfo( label: label, type: type ); + /// + /// * [String] instanceId: + Future resourceUpload({ String? label, String? type, String? instanceId, }) async { + final response = await resourceUploadWithHttpInfo( label: label, type: type, instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } } diff --git a/manager_api/lib/api/section_api.dart b/manager_api/lib/api/section_api.dart index 1b2ff7f..cb2897c 100644 --- a/manager_api/lib/api/section_api.dart +++ b/manager_api/lib/api/section_api.dart @@ -1,17 +1,18 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class SectionApi { - SectionApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + SectionApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,930 +20,768 @@ class SectionApi { /// Parameters: /// /// * [SectionDTO] sectionDTO (required): - Future sectionCreateWithHttpInfo(SectionDTO sectionDTO) async { - // Verify required params are set. - if (sectionDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: sectionDTO'); - } - + Future sectionCreateWithHttpInfo(SectionDTO sectionDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Section'; - Object postBody = sectionDTO; + // ignore: prefer_final_locals + Object? postBody = sectionDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [SectionDTO] sectionDTO (required): - Future sectionCreate(SectionDTO sectionDTO) async { - final response = await sectionCreateWithHttpInfo(sectionDTO); + Future sectionCreate(SectionDTO sectionDTO,) async { + final response = await sectionCreateWithHttpInfo(sectionDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SectionDTO',) as SectionDTO; + + } + return null; } /// Performs an HTTP 'DELETE /api/Section/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future sectionDeleteWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future sectionDeleteWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Section/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future sectionDelete(String id) async { - final response = await sectionDeleteWithHttpInfo(id); + Future sectionDelete(String id,) async { + final response = await sectionDeleteWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'DELETE /api/Section/configuration/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future sectionDeleteAllForConfigurationWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future sectionDeleteAllForConfigurationWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Section/configuration/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future sectionDeleteAllForConfiguration(String id) async { - final response = await sectionDeleteAllForConfigurationWithHttpInfo(id); + Future sectionDeleteAllForConfiguration(String id,) async { + final response = await sectionDeleteAllForConfigurationWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. - Future sectionGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future sectionGetWithHttpInfo({ String? instanceId, }) async { + // ignore: prefer_const_declarations final path = r'/api/Section'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; - - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); } - return await apiClient.invokeAPI( + const contentTypes = []; + + + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future> sectionGet() async { - final response = await sectionGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> sectionGet({ String? instanceId, }) async { + final response = await sectionGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; } /// Performs an HTTP 'GET /api/Section/{id}/subsections' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future sectionGetAllSectionSubSectionsWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future sectionGetAllSectionSubSectionsWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Section/{id}/subsections' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future> sectionGetAllSectionSubSections(String id) async { - final response = await sectionGetAllSectionSubSectionsWithHttpInfo(id); + Future?> sectionGetAllSectionSubSections(String id,) async { + final response = await sectionGetAllSectionSubSectionsWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; + } + + /// Performs an HTTP 'GET /api/Section/ArticleDTO' operation and returns the [Response]. + Future sectionGetArticleDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/ArticleDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetArticleDTO() async { + final response = await sectionGetArticleDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ArticleDTO',) as ArticleDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future sectionGetDetailWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future sectionGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Section/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future sectionGetDetail(String id) async { - final response = await sectionGetDetailWithHttpInfo(id); + Future sectionGetDetail(String id,) async { + final response = await sectionGetDetailWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SectionDTO',) as SectionDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/configuration/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future sectionGetFromConfigurationWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future sectionGetFromConfigurationWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/Section/configuration/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future> sectionGetFromConfiguration(String id) async { - final response = await sectionGetFromConfigurationWithHttpInfo(id); + Future?> sectionGetFromConfiguration(String id,) async { + final response = await sectionGetFromConfigurationWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; } /// Performs an HTTP 'GET /api/Section/MapDTO' operation and returns the [Response]. Future sectionGetMapDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/MapDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionGetMapDTO() async { + Future sectionGetMapDTO() async { final response = await sectionGetMapDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'MapDTO') as MapDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MapDTO',) as MapDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/MenuDTO' operation and returns the [Response]. Future sectionGetMenuDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/MenuDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionGetMenuDTO() async { + Future sectionGetMenuDTO() async { final response = await sectionGetMenuDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'MenuDTO') as MenuDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MenuDTO',) as MenuDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response]. Future sectionGetQuizzDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/QuizzDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionGetQuizzDTO() async { + Future sectionGetQuizzDTO() async { final response = await sectionGetQuizzDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'QuizzDTO') as QuizzDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QuizzDTO',) as QuizzDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/SliderDTO' operation and returns the [Response]. Future sectionGetSliderDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/SliderDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionGetSliderDTO() async { + Future sectionGetSliderDTO() async { final response = await sectionGetSliderDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'SliderDTO') as SliderDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SliderDTO',) as SliderDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/VideoDTO' operation and returns the [Response]. Future sectionGetVideoDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/VideoDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionGetVideoDTO() async { + Future sectionGetVideoDTO() async { final response = await sectionGetVideoDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'VideoDTO') as VideoDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'VideoDTO',) as VideoDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/WebDTO' operation and returns the [Response]. Future sectionGetWebDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/WebDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionGetWebDTO() async { + Future sectionGetWebDTO() async { final response = await sectionGetWebDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'WebDTO') as WebDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WebDTO',) as WebDTO; + + } + return null; } /// Performs an HTTP 'GET /api/Section/PlayerMessageDTO' operation and returns the [Response]. Future sectionPlayerMessageDTOWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/Section/PlayerMessageDTO'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future sectionPlayerMessageDTO() async { + Future sectionPlayerMessageDTO() async { final response = await sectionPlayerMessageDTOWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'PlayerMessageDTO') as PlayerMessageDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PlayerMessageDTO',) as PlayerMessageDTO; + + } + return null; } /// Performs an HTTP 'PUT /api/Section' operation and returns the [Response]. /// Parameters: /// /// * [SectionDTO] sectionDTO (required): - Future sectionUpdateWithHttpInfo(SectionDTO sectionDTO) async { - // Verify required params are set. - if (sectionDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: sectionDTO'); - } - + Future sectionUpdateWithHttpInfo(SectionDTO sectionDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Section'; - Object postBody = sectionDTO; + // ignore: prefer_final_locals + Object? postBody = sectionDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [SectionDTO] sectionDTO (required): - Future sectionUpdate(SectionDTO sectionDTO) async { - final response = await sectionUpdateWithHttpInfo(sectionDTO); + Future sectionUpdate(SectionDTO sectionDTO,) async { + final response = await sectionUpdateWithHttpInfo(sectionDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SectionDTO',) as SectionDTO; + + } + return null; } /// Performs an HTTP 'PUT /api/Section/order' operation and returns the [Response]. /// Parameters: /// /// * [List] sectionDTO (required): - Future sectionUpdateOrderWithHttpInfo(List sectionDTO) async { - // Verify required params are set. - if (sectionDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: sectionDTO'); - } - + Future sectionUpdateOrderWithHttpInfo(List sectionDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/Section/order'; - Object postBody = sectionDTO; + // ignore: prefer_final_locals + Object? postBody = sectionDTO; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [List] sectionDTO (required): - Future sectionUpdateOrder(List sectionDTO) async { - final response = await sectionUpdateOrderWithHttpInfo(sectionDTO); + Future sectionUpdateOrder(List sectionDTO,) async { + final response = await sectionUpdateOrderWithHttpInfo(sectionDTO,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } } diff --git a/manager_api/lib/api/user_api.dart b/manager_api/lib/api/user_api.dart index ba77f88..989b146 100644 --- a/manager_api/lib/api/user_api.dart +++ b/manager_api/lib/api/user_api.dart @@ -1,17 +1,18 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class UserApi { - UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + UserApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,307 +20,233 @@ class UserApi { /// Parameters: /// /// * [User] user (required): - Future userCreateUserWithHttpInfo(User user) async { - // Verify required params are set. - if (user == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); - } - + Future userCreateUserWithHttpInfo(User user,) async { + // ignore: prefer_const_declarations final path = r'/api/User'; - Object postBody = user; + // ignore: prefer_final_locals + Object? postBody = user; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [User] user (required): - Future userCreateUser(User user) async { - final response = await userCreateUserWithHttpInfo(user); + Future userCreateUser(User user,) async { + final response = await userCreateUserWithHttpInfo(user,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO; + + } + return null; } /// Performs an HTTP 'DELETE /api/User/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future userDeleteUserWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future userDeleteUserWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/User/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future userDeleteUser(String id) async { - final response = await userDeleteUserWithHttpInfo(id); + Future userDeleteUser(String id,) async { + final response = await userDeleteUserWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; } /// Performs an HTTP 'GET /api/User' operation and returns the [Response]. Future userGetWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/User'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } - Future> userGet() async { + Future?> userGet() async { final response = await userGetWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) .cast() - .toList(growable: false); + .toList(); + } - return Future>.value(null); + return null; } /// Performs an HTTP 'GET /api/User/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future userGetDetailWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future userGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/User/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = []; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = []; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): - Future userGetDetail(String id) async { - final response = await userGetDetailWithHttpInfo(id); + Future userGetDetail(String id,) async { + final response = await userGetDetailWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO; + + } + return null; } /// Performs an HTTP 'PUT /api/User' operation and returns the [Response]. /// Parameters: /// /// * [User] user (required): - Future userUpdateUserWithHttpInfo(User user) async { - // Verify required params are set. - if (user == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); - } - + Future userUpdateUserWithHttpInfo(User user,) async { + // ignore: prefer_const_declarations final path = r'/api/User'; - Object postBody = user; + // ignore: prefer_final_locals + Object? postBody = user; final queryParams = []; final headerParams = {}; final formParams = {}; - final contentTypes = ['application/json']; - final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; - final authNames = ['bearer']; + const contentTypes = ['application/json']; - if ( - nullableContentType != null && - nullableContentType.toLowerCase().startsWith('multipart/form-data') - ) { - bool hasFields = false; - final mp = MultipartRequest(null, null); - if (hasFields) { - postBody = mp; - } - } else { - } - return await apiClient.invokeAPI( + return apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [User] user (required): - Future userUpdateUser(User user) async { - final response = await userUpdateUserWithHttpInfo(user); + Future userUpdateUser(User user,) async { + final response = await userUpdateUserWithHttpInfo(user,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. - if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO; + + } + return null; } } diff --git a/manager_api/lib/api_client.dart b/manager_api/lib/api_client.dart index 9b35f8a..70d5cce 100644 --- a/manager_api/lib/api_client.dart +++ b/manager_api/lib/api_client.dart @@ -1,19 +1,17 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class ApiClient { - ApiClient({this.basePath = 'http://192.168.31.140'}) { - // Setup authentications (key: authentication name, value: authentication). - _authentications[r'bearer'] = OAuth(); - } + ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication}); final String basePath; @@ -25,17 +23,12 @@ class ApiClient { Client get client => _client; /// Requests to use a new HTTP [Client] in this class. - /// - /// If the [newClient] is null, an [ArgumentError] is thrown. set client(Client newClient) { - if (newClient == null) { - throw ArgumentError('New client instance cannot be null.'); - } _client = newClient; } final _defaultHeaderMap = {}; - final _authentications = {}; + final Authentication? authentication; void addDefaultHeader(String key, String value) { _defaultHeaderMap[key] = value; @@ -43,59 +36,42 @@ class ApiClient { Map get defaultHeaderMap => _defaultHeaderMap; - /// returns an unmodifiable view of the authentications, since none should be added - /// nor deleted - Map get authentications => - Map.unmodifiable(_authentications); - - T getAuthentication(String name) { - final authentication = _authentications[name]; - return authentication is T ? authentication : null; - } - - // We don’t use a Map for queryParams. + // We don't use a Map for queryParams. // If collectionFormat is 'multi', a key might appear multiple times. Future invokeAPI( String path, String method, - Iterable queryParams, - Object body, + List queryParams, + Object? body, Map headerParams, Map formParams, - String nullableContentType, - List authNames, + String? contentType, ) async { - _updateParamsForAuth(authNames, queryParams, headerParams); + _updateParamsForAuth(queryParams, headerParams); headerParams.addAll(_defaultHeaderMap); - - final urlEncodedQueryParams = queryParams - .where((param) => param.value != null) - .map((param) => '$param'); - - final queryString = urlEncodedQueryParams.isNotEmpty - ? '?${urlEncodedQueryParams.join('&')}' - : ''; - - final url = '$basePath$path$queryString'; - - if (nullableContentType != null) { - headerParams['Content-Type'] = nullableContentType; + if (contentType != null) { + headerParams['Content-Type'] = contentType; } + final urlEncodedQueryParams = queryParams.map((param) => '$param'); + final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : ''; + final uri = Uri.parse('$basePath$path$queryString'); + try { - // Special case for uploading a single file which isn’t a 'multipart/form-data'. + // Special case for uploading a single file which isn't a 'multipart/form-data'. if ( - body is MultipartFile && (nullableContentType == null || - !nullableContentType.toLowerCase().startsWith('multipart/form-data')) + body is MultipartFile && (contentType == null || + !contentType.toLowerCase().startsWith('multipart/form-data')) ) { - final request = StreamedRequest(method, Uri.parse(url)); + final request = StreamedRequest(method, uri); request.headers.addAll(headerParams); request.contentLength = body.length; body.finalize().listen( request.sink.add, onDone: request.sink.close, - onError: (error, trace) => request.sink.close(), + // ignore: avoid_types_on_closure_parameters + onError: (Object error, StackTrace trace) => request.sink.close(), cancelOnError: true, ); final response = await _client.send(request); @@ -103,7 +79,7 @@ class ApiClient { } if (body is MultipartRequest) { - final request = MultipartRequest(method, Uri.parse(url)); + final request = MultipartRequest(method, uri); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -112,50 +88,110 @@ class ApiClient { return Response.fromStream(response); } - final msgBody = nullableContentType == 'application/x-www-form-urlencoded' + final msgBody = contentType == 'application/x-www-form-urlencoded' ? formParams - : serialize(body); + : await serializeAsync(body); final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; switch(method) { - case 'POST': return await _client.post(url, headers: nullableHeaderParams, body: msgBody,); - case 'PUT': return await _client.put(url, headers: nullableHeaderParams, body: msgBody,); - case 'DELETE': return await _client.delete(url, headers: nullableHeaderParams,); - case 'PATCH': return await _client.patch(url, headers: nullableHeaderParams, body: msgBody,); - case 'HEAD': return await _client.head(url, headers: nullableHeaderParams,); - case 'GET': return await _client.get(url, headers: nullableHeaderParams,); + case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,); + case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,); + case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,); + case 'GET': return await _client.get(uri, headers: nullableHeaderParams,); } - } on SocketException catch (e, trace) { - throw ApiException.withInner(HttpStatus.badRequest, 'Socket operation failed: $method $path', e, trace,); - } on TlsException catch (e, trace) { - throw ApiException.withInner(HttpStatus.badRequest, 'TLS/SSL communication failed: $method $path', e, trace,); - } on IOException catch (e, trace) { - throw ApiException.withInner(HttpStatus.badRequest, 'I/O operation failed: $method $path', e, trace,); - } on ClientException catch (e, trace) { - throw ApiException.withInner(HttpStatus.badRequest, 'HTTP connection failed: $method $path', e, trace,); - } on Exception catch (e, trace) { - throw ApiException.withInner(HttpStatus.badRequest, 'Exception occurred: $method $path', e, trace,); + } on SocketException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Socket operation failed: $method $path', + error, + trace, + ); + } on TlsException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'TLS/SSL communication failed: $method $path', + error, + trace, + ); + } on IOException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'I/O operation failed: $method $path', + error, + trace, + ); + } on ClientException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'HTTP connection failed: $method $path', + error, + trace, + ); + } on Exception catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Exception occurred: $method $path', + error, + trace, + ); } - throw ApiException(HttpStatus.badRequest, 'Invalid HTTP operation: $method $path',); + throw ApiException( + HttpStatus.badRequest, + 'Invalid HTTP operation: $method $path', + ); } - dynamic _deserialize(dynamic value, String targetType, {bool growable}) { + Future deserializeAsync(String json, String targetType, {bool growable = false,}) async => + // ignore: deprecated_member_use_from_same_package + deserialize(json, targetType, growable: growable); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') + dynamic deserialize(String json, String targetType, {bool growable = false,}) { + // Remove all spaces. Necessary for regular expressions as well. + targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? json + : _deserialize(jsonDecode(json), targetType, growable: growable); + } + + // ignore: deprecated_member_use_from_same_package + Future serializeAsync(Object? value) async => serialize(value); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.') + String serialize(Object? value) => value == null ? '' : json.encode(value); + + /// Update query and header parameters based on authentication settings. + void _updateParamsForAuth( + List queryParams, + Map headerParams, + ) { + if (authentication != null) { + authentication!.applyToParams(queryParams, headerParams); + } + } + + static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) { try { switch (targetType) { case 'String': - return '$value'; + return value is String ? value : value.toString(); case 'int': return value is int ? value : int.parse('$value'); + case 'double': + return value is double ? value : double.parse('$value'); case 'bool': if (value is bool) { return value; } final valueString = '$value'.toLowerCase(); return valueString == 'true' || valueString == '1'; - break; - case 'double': - return value is double ? value : double.parse('$value'); + case 'ArticleDTO': + return ArticleDTO.fromJson(value); case 'ConfigurationDTO': return ConfigurationDTO.fromJson(value); case 'DeviceDTO': @@ -174,6 +210,10 @@ class ApiClient { return ImageDTO.fromJson(value); case 'ImageGeoPoint': return ImageGeoPoint.fromJson(value); + case 'Instance': + return Instance.fromJson(value); + case 'InstanceDTO': + return InstanceDTO.fromJson(value); case 'LevelDTO': return LevelDTO.fromJson(value); case 'LoginDTO': @@ -182,7 +222,6 @@ class ApiClient { return MapDTO.fromJson(value); case 'MapTypeApp': return MapTypeAppTypeTransformer().decode(value); - case 'MenuDTO': return MenuDTO.fromJson(value); case 'PlayerMessageDTO': @@ -191,18 +230,18 @@ class ApiClient { return QuestionDTO.fromJson(value); case 'QuizzDTO': return QuizzDTO.fromJson(value); + case 'QuizzDTOBadLevel': + return QuizzDTOBadLevel.fromJson(value); case 'ResourceDTO': return ResourceDTO.fromJson(value); case 'ResourceType': return ResourceTypeTypeTransformer().decode(value); - case 'ResponseDTO': return ResponseDTO.fromJson(value); case 'SectionDTO': return SectionDTO.fromJson(value); case 'SectionType': return SectionTypeTypeTransformer().decode(value); - case 'SliderDTO': return SliderDTO.fromJson(value); case 'TokenDTO': @@ -218,58 +257,63 @@ class ApiClient { case 'WebDTO': return WebDTO.fromJson(value); default: - Match match; - if (value is List && (match = _regList.firstMatch(targetType)) != null) { - final newTargetType = match[1]; + dynamic match; + if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) { return value - .map((v) => _deserialize(v, newTargetType, growable: growable)) - .toList(growable: true == growable); + .map((dynamic v) => _deserialize(v, match, growable: growable,)) + .toList(growable: growable); } - if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { - final newTargetType = match[1]; + if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) { return value - .map((v) => _deserialize(v, newTargetType, growable: growable)) + .map((dynamic v) => _deserialize(v, match, growable: growable,)) .toSet(); } - if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { - final newTargetType = match[1]; - return Map.fromIterables( - value.keys, - value.values.map((v) => _deserialize(v, newTargetType, growable: growable)), + if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) { + return Map.fromIterables( + value.keys.cast(), + value.values.map((dynamic v) => _deserialize(v, match, growable: growable,)), ); } - break; } - } on Exception catch (e, stack) { - throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', e, stack,); + } on Exception catch (error, trace) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,); } throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); } - - dynamic deserialize(String json, String targetType, {bool growable}) { - // Remove all spaces. Necessary for reg expressions as well. - targetType = targetType.replaceAll(' ', ''); - - return targetType == 'String' - ? json - : _deserialize(jsonDecode(json), targetType, growable: true == growable); - } - - String serialize(Object obj) => obj == null ? '' : json.encode(obj); - - /// Update query and header parameters based on authentication settings. - /// @param authNames The authentications to apply - void _updateParamsForAuth( - List authNames, - List queryParams, - Map headerParams, - ) { - authNames.forEach((authName) { - final auth = _authentications[authName]; - if (auth == null) { - throw ArgumentError('Authentication undefined: $authName'); - } - auth.applyToParams(queryParams, headerParams); - }); - } } + +/// Primarily intended for use in an isolate. +class DeserializationMessage { + const DeserializationMessage({ + required this.json, + required this.targetType, + this.growable = false, + }); + + /// The JSON value to deserialize. + final String json; + + /// Target type to deserialize to. + final String targetType; + + /// Whether to make deserialized lists or maps growable. + final bool growable; +} + +/// Primarily intended for use in an isolate. +Future deserializeAsync(DeserializationMessage message) async { + // Remove all spaces. Necessary for regular expressions as well. + final targetType = message.targetType.replaceAll(' ', ''); + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? message.json + : ApiClient._deserialize( + jsonDecode(message.json), + targetType, + growable: message.growable, + ); +} + +/// Primarily intended for use in an isolate. +Future serializeAsync(Object? value) async => value == null ? '' : json.encode(value); diff --git a/manager_api/lib/api_exception.dart b/manager_api/lib/api_exception.dart index 1537c97..796f7f7 100644 --- a/manager_api/lib/api_exception.dart +++ b/manager_api/lib/api_exception.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -15,10 +16,11 @@ class ApiException implements Exception { ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String? message; + Exception? innerException; + StackTrace? stackTrace; + @override String toString() { if (message == null) { return 'ApiException'; diff --git a/manager_api/lib/api_helper.dart b/manager_api/lib/api_helper.dart index 1f73cef..fbfe3c5 100644 --- a/manager_api/lib/api_helper.dart +++ b/manager_api/lib/api_helper.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -20,31 +21,27 @@ class QueryParam { } // Ported from the Java version. -Iterable _convertParametersForCollectionFormat( - String collectionFormat, - String name, - dynamic value, -) { +Iterable _queryParams(String collectionFormat, String name, dynamic value,) { + // Assertions to run in debug mode only. + assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); + final params = []; - // preconditions - if (name != null && !name.isEmpty && value != null) { - if (value is List) { - // get the collection format, default: csv - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) - ? 'csv' - : collectionFormat; - - if (collectionFormat == 'multi') { - return value.map((v) => QueryParam(name, parameterToString(v))); - } - - final delimiter = _delimiters[collectionFormat] ?? ','; - - params.add(QueryParam(name, value.map((v) => parameterToString(v)).join(delimiter))); - } else { - params.add(QueryParam(name, parameterToString(value))); + if (value is List) { + if (collectionFormat == 'multi') { + return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); } + + // Default collection format is 'csv'. + if (collectionFormat.isEmpty) { + collectionFormat = 'csv'; // ignore: parameter_assignments + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); + } else if (value != null) { + params.add(QueryParam(name, parameterToString(value))); } return params; @@ -72,9 +69,42 @@ String parameterToString(dynamic value) { /// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' /// content type. Otherwise, returns the decoded body as decoded by dart:http package. -String _decodeBodyBytes(Response response) { +Future _decodeBodyBytes(Response response) async { final contentType = response.headers['content-type']; return contentType != null && contentType.toLowerCase().startsWith('application/json') - ? response.bodyBytes == null ? null : utf8.decode(response.bodyBytes) + ? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes) : response.body; } + +/// Returns a valid [T] value found at the specified Map [key], null otherwise. +T? mapValueOfType(dynamic map, String key) { + final dynamic value = map is Map ? map[key] : null; + return value is T ? value : null; +} + +/// Returns a valid Map found at the specified Map [key], null otherwise. +Map? mapCastOfType(dynamic map, String key) { + final dynamic value = map is Map ? map[key] : null; + return value is Map ? value.cast() : null; +} + +/// Returns a valid [DateTime] found at the specified Map [key], null otherwise. +DateTime? mapDateTime(dynamic map, String key, [String? pattern]) { + final dynamic value = map is Map ? map[key] : null; + if (value != null) { + int? millis; + if (value is int) { + millis = value; + } else if (value is String) { + if (pattern == _dateEpochMarker) { + millis = int.tryParse(value); + } else { + return DateTime.tryParse(value); + } + } + if (millis != null) { + return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true); + } + } + return null; +} diff --git a/manager_api/lib/auth/api_key_auth.dart b/manager_api/lib/auth/api_key_auth.dart index 41a4afd..e304eda 100644 --- a/manager_api/lib/auth/api_key_auth.dart +++ b/manager_api/lib/auth/api_key_auth.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -15,21 +16,25 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String apiKeyPrefix; - String apiKey; + String apiKeyPrefix = ''; + String apiKey = ''; @override void applyToParams(List queryParams, Map headerParams) { - final value = apiKeyPrefix == null ? apiKey : '$apiKeyPrefix $apiKey'; + final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; - if (location == 'query' && value != null) { - queryParams.add(QueryParam(paramName, value)); - } else if (location == 'header' && value != null) { - headerParams[paramName] = value; - } else if (location == 'cookie' && value != null) { - headerParams.update('Cookie', (String existingCookie) { - return '$existingCookie; $paramName=$value'; - }, ifAbsent: () => '$paramName=$value'); + if (paramValue.isNotEmpty) { + if (location == 'query') { + queryParams.add(QueryParam(paramName, paramValue)); + } else if (location == 'header') { + headerParams[paramName] = paramValue; + } else if (location == 'cookie') { + headerParams.update( + 'Cookie', + (existingCookie) => '$existingCookie; $paramName=$paramValue', + ifAbsent: () => '$paramName=$paramValue', + ); + } } } } diff --git a/manager_api/lib/auth/authentication.dart b/manager_api/lib/auth/authentication.dart index 5ca198d..49baf7c 100644 --- a/manager_api/lib/auth/authentication.dart +++ b/manager_api/lib/auth/authentication.dart @@ -1,14 +1,16 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; +// ignore: one_member_abstracts abstract class Authentication { /// Apply authentication settings to header and query params. void applyToParams(List queryParams, Map headerParams); diff --git a/manager_api/lib/auth/http_basic_auth.dart b/manager_api/lib/auth/http_basic_auth.dart index 6dc36a1..81abd71 100644 --- a/manager_api/lib/auth/http_basic_auth.dart +++ b/manager_api/lib/auth/http_basic_auth.dart @@ -1,21 +1,26 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class HttpBasicAuth implements Authentication { + HttpBasicAuth({this.username = '', this.password = ''}); + String username; String password; @override void applyToParams(List queryParams, Map headerParams) { - final credentials = (username ?? '') + ':' + (password ?? ''); - headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + if (username.isNotEmpty && password.isNotEmpty) { + final credentials = '$username:$password'; + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } } } diff --git a/manager_api/lib/auth/http_bearer_auth.dart b/manager_api/lib/auth/http_bearer_auth.dart index a23b65f..213f348 100644 --- a/manager_api/lib/auth/http_bearer_auth.dart +++ b/manager_api/lib/auth/http_bearer_auth.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -20,19 +21,29 @@ class HttpBearerAuth implements Authentication { set accessToken(dynamic accessToken) { if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { - throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); + throw ArgumentError('accessToken value must be either a String or a String Function().'); } - this._accessToken = accessToken; + _accessToken = accessToken; } @override void applyToParams(List queryParams, Map headerParams) { + if (_accessToken == null) { + return; + } + + String accessToken; + if (_accessToken is String) { - headerParams['Authorization'] = 'Bearer $_accessToken'; + accessToken = _accessToken; } else if (_accessToken is HttpBearerAuthProvider) { - headerParams['Authorization'] = 'Bearer ${_accessToken()}'; + accessToken = _accessToken!(); } else { - throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); + return; + } + + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; } } } diff --git a/manager_api/lib/auth/oauth.dart b/manager_api/lib/auth/oauth.dart index c0463ad..e9b87cf 100644 --- a/manager_api/lib/auth/oauth.dart +++ b/manager_api/lib/auth/oauth.dart @@ -1,22 +1,23 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class OAuth implements Authentication { - OAuth({this.accessToken}); + OAuth({this.accessToken = ''}); String accessToken; @override void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { + if (accessToken.isNotEmpty) { headerParams['Authorization'] = 'Bearer $accessToken'; } } diff --git a/manager_api/lib/model/article_dto.dart b/manager_api/lib/model/article_dto.dart new file mode 100644 index 0000000..5e6cd8f --- /dev/null +++ b/manager_api/lib/model/article_dto.dart @@ -0,0 +1,160 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ArticleDTO { + /// Returns a new [ArticleDTO] instance. + ArticleDTO({ + this.content = const [], + this.isContentTop, + this.audioIds = const [], + this.isReadAudioAuto, + this.images = const [], + }); + + List? content; + + /// + /// 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? isContentTop; + + List? audioIds; + + /// + /// 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? isReadAudioAuto; + + List? images; + + @override + bool operator ==(Object other) => identical(this, other) || other is ArticleDTO && + other.content == content && + other.isContentTop == isContentTop && + other.audioIds == audioIds && + other.isReadAudioAuto == isReadAudioAuto && + other.images == images; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (content == null ? 0 : content!.hashCode) + + (isContentTop == null ? 0 : isContentTop!.hashCode) + + (audioIds == null ? 0 : audioIds!.hashCode) + + (isReadAudioAuto == null ? 0 : isReadAudioAuto!.hashCode) + + (images == null ? 0 : images!.hashCode); + + @override + String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]'; + + Map toJson() { + final _json = {}; + if (content != null) { + _json[r'content'] = content; + } + if (isContentTop != null) { + _json[r'isContentTop'] = isContentTop; + } + if (audioIds != null) { + _json[r'audioIds'] = audioIds; + } + if (isReadAudioAuto != null) { + _json[r'isReadAudioAuto'] = isReadAudioAuto; + } + if (images != null) { + _json[r'images'] = images; + } + return _json; + } + + /// Returns a new [ArticleDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ArticleDTO? 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 "ArticleDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ArticleDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ArticleDTO( + content: TranslationDTO.listFromJson(json[r'content']) ?? const [], + isContentTop: mapValueOfType(json, r'isContentTop'), + audioIds: TranslationDTO.listFromJson(json[r'audioIds']) ?? const [], + isReadAudioAuto: mapValueOfType(json, r'isReadAudioAuto'), + images: ImageDTO.listFromJson(json[r'images']) ?? 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 = ArticleDTO.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 = ArticleDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ArticleDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ArticleDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/configuration_dto.dart b/manager_api/lib/model/configuration_dto.dart index 06db575..5b29c23 100644 --- a/manager_api/lib/model/configuration_dto.dart +++ b/manager_api/lib/model/configuration_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -14,107 +15,232 @@ class ConfigurationDTO { ConfigurationDTO({ this.id, this.label, + this.title = const [], + this.imageId, + this.imageSource, this.primaryColor, this.secondaryColor, - this.languages, + this.languages = const [], this.dateCreation, + this.isMobile, + this.isTablet, + this.isOffline, + this.instanceId, }); - String id; + String? id; - String label; + String? label; - String primaryColor; + List? title; - String secondaryColor; + String? imageId; - List languages; + String? imageSource; - DateTime dateCreation; + String? primaryColor; + + String? secondaryColor; + + List? languages; + + /// + /// 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? 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? isOffline; + + String? instanceId; @override bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && other.id == id && other.label == label && + other.title == title && + other.imageId == imageId && + other.imageSource == imageSource && other.primaryColor == primaryColor && other.secondaryColor == secondaryColor && other.languages == languages && - other.dateCreation == dateCreation; + other.dateCreation == dateCreation && + other.isMobile == isMobile && + other.isTablet == isTablet && + other.isOffline == isOffline && + other.instanceId == instanceId; @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (label == null ? 0 : label.hashCode) + - (primaryColor == null ? 0 : primaryColor.hashCode) + - (secondaryColor == null ? 0 : secondaryColor.hashCode) + - (languages == null ? 0 : languages.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (primaryColor == null ? 0 : primaryColor!.hashCode) + + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + + (languages == null ? 0 : languages!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isMobile == null ? 0 : isMobile!.hashCode) + + (isTablet == null ? 0 : isTablet!.hashCode) + + (isOffline == null ? 0 : isOffline!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation]'; + String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; + } + if (title != null) { + _json[r'title'] = title; + } + if (imageId != null) { + _json[r'imageId'] = imageId; + } + if (imageSource != null) { + _json[r'imageSource'] = imageSource; } if (primaryColor != null) { - json[r'primaryColor'] = primaryColor; + _json[r'primaryColor'] = primaryColor; } if (secondaryColor != null) { - json[r'secondaryColor'] = secondaryColor; + _json[r'secondaryColor'] = secondaryColor; } if (languages != null) { - json[r'languages'] = languages; + _json[r'languages'] = languages; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } - return json; + if (isMobile != null) { + _json[r'isMobile'] = isMobile; + } + if (isTablet != null) { + _json[r'isTablet'] = isTablet; + } + if (isOffline != null) { + _json[r'isOffline'] = isOffline; + } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } + return _json; } /// Returns a new [ConfigurationDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ConfigurationDTO fromJson(Map json) => json == null - ? null - : ConfigurationDTO( - id: json[r'id'], - label: json[r'label'], - primaryColor: json[r'primaryColor'], - secondaryColor: json[r'secondaryColor'], - languages: json[r'languages'] == null - ? null - : (json[r'languages'] as List).cast(), - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ConfigurationDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ConfigurationDTO.fromJson(v)).toList(growable: true == growable); + // 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 "ConfigurationDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ConfigurationDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ConfigurationDTO( + id: mapValueOfType(json, r'id'), + label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + primaryColor: mapValueOfType(json, r'primaryColor'), + secondaryColor: mapValueOfType(json, r'secondaryColor'), + languages: json[r'languages'] is List + ? (json[r'languages'] as List).cast() + : const [], + dateCreation: mapDateTime(json, r'dateCreation', ''), + isMobile: mapValueOfType(json, r'isMobile'), + isTablet: mapValueOfType(json, r'isTablet'), + isOffline: mapValueOfType(json, r'isOffline'), + instanceId: mapValueOfType(json, r'instanceId'), + ); + } + 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 = ConfigurationDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ConfigurationDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ConfigurationDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ConfigurationDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ConfigurationDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/device_detail_dto.dart b/manager_api/lib/model/device_detail_dto.dart index f8b686c..88ec18f 100644 --- a/manager_api/lib/model/device_detail_dto.dart +++ b/manager_api/lib/model/device_detail_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -22,39 +23,72 @@ class DeviceDetailDTO { this.connected, this.dateCreation, this.dateUpdate, + this.instanceId, this.connectionLevel, this.lastConnectionLevel, this.batteryLevel, this.lastBatteryLevel, }); - String id; + String? id; - String identifier; + String? identifier; - String name; + String? name; - String ipAddressWLAN; + String? ipAddressWLAN; - String ipAddressETH; + String? ipAddressETH; - String configurationId; + String? configurationId; - String configuration; + String? configuration; - bool connected; + /// + /// 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? connected; - 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. + /// + DateTime? dateCreation; - DateTime dateUpdate; + /// + /// 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? dateUpdate; - String connectionLevel; + String? instanceId; - DateTime lastConnectionLevel; + String? connectionLevel; - String batteryLevel; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? lastConnectionLevel; - DateTime lastBatteryLevel; + String? batteryLevel; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? lastBatteryLevel; @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && @@ -68,6 +102,7 @@ class DeviceDetailDTO { other.connected == connected && other.dateCreation == dateCreation && other.dateUpdate == dateUpdate && + other.instanceId == instanceId && other.connectionLevel == connectionLevel && other.lastConnectionLevel == lastConnectionLevel && other.batteryLevel == batteryLevel && @@ -75,122 +110,159 @@ class DeviceDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (identifier == null ? 0 : identifier.hashCode) + - (name == null ? 0 : name.hashCode) + - (ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) + - (ipAddressETH == null ? 0 : ipAddressETH.hashCode) + - (configurationId == null ? 0 : configurationId.hashCode) + - (configuration == null ? 0 : configuration.hashCode) + - (connected == null ? 0 : connected.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode) + - (dateUpdate == null ? 0 : dateUpdate.hashCode) + - (connectionLevel == null ? 0 : connectionLevel.hashCode) + - (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + - (batteryLevel == null ? 0 : batteryLevel.hashCode) + - (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (identifier == null ? 0 : identifier!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (ipAddressWLAN == null ? 0 : ipAddressWLAN!.hashCode) + + (ipAddressETH == null ? 0 : ipAddressETH!.hashCode) + + (configurationId == null ? 0 : configurationId!.hashCode) + + (configuration == null ? 0 : configuration!.hashCode) + + (connected == null ? 0 : connected!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (dateUpdate == null ? 0 : dateUpdate!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (connectionLevel == null ? 0 : connectionLevel!.hashCode) + + (lastConnectionLevel == null ? 0 : lastConnectionLevel!.hashCode) + + (batteryLevel == null ? 0 : batteryLevel!.hashCode) + + (lastBatteryLevel == null ? 0 : lastBatteryLevel!.hashCode); @override - String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (identifier != null) { - json[r'identifier'] = identifier; + _json[r'identifier'] = identifier; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (ipAddressWLAN != null) { - json[r'ipAddressWLAN'] = ipAddressWLAN; + _json[r'ipAddressWLAN'] = ipAddressWLAN; } if (ipAddressETH != null) { - json[r'ipAddressETH'] = ipAddressETH; + _json[r'ipAddressETH'] = ipAddressETH; } if (configurationId != null) { - json[r'configurationId'] = configurationId; + _json[r'configurationId'] = configurationId; } if (configuration != null) { - json[r'configuration'] = configuration; + _json[r'configuration'] = configuration; } if (connected != null) { - json[r'connected'] = connected; + _json[r'connected'] = connected; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } if (dateUpdate != null) { - json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); + _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String(); + } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; } if (connectionLevel != null) { - json[r'connectionLevel'] = connectionLevel; + _json[r'connectionLevel'] = connectionLevel; } if (lastConnectionLevel != null) { - json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); + _json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String(); } if (batteryLevel != null) { - json[r'batteryLevel'] = batteryLevel; + _json[r'batteryLevel'] = batteryLevel; } if (lastBatteryLevel != null) { - json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); + _json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String(); } - return json; + return _json; } /// Returns a new [DeviceDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static DeviceDetailDTO fromJson(Map json) => json == null - ? null - : DeviceDetailDTO( - id: json[r'id'], - identifier: json[r'identifier'], - name: json[r'name'], - ipAddressWLAN: json[r'ipAddressWLAN'], - ipAddressETH: json[r'ipAddressETH'], - configurationId: json[r'configurationId'], - configuration: json[r'configuration'], - connected: json[r'connected'], - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - dateUpdate: json[r'dateUpdate'] == null - ? null - : DateTime.parse(json[r'dateUpdate']), - connectionLevel: json[r'connectionLevel'], - lastConnectionLevel: json[r'lastConnectionLevel'] == null - ? null - : DateTime.parse(json[r'lastConnectionLevel']), - batteryLevel: json[r'batteryLevel'], - lastBatteryLevel: json[r'lastBatteryLevel'] == null - ? null - : DateTime.parse(json[r'lastBatteryLevel']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static DeviceDetailDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable); + // 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 "DeviceDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "DeviceDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return DeviceDetailDTO( + id: mapValueOfType(json, r'id'), + identifier: mapValueOfType(json, r'identifier'), + name: mapValueOfType(json, r'name'), + ipAddressWLAN: mapValueOfType(json, r'ipAddressWLAN'), + ipAddressETH: mapValueOfType(json, r'ipAddressETH'), + configurationId: mapValueOfType(json, r'configurationId'), + configuration: mapValueOfType(json, r'configuration'), + connected: mapValueOfType(json, r'connected'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + dateUpdate: mapDateTime(json, r'dateUpdate', ''), + instanceId: mapValueOfType(json, r'instanceId'), + connectionLevel: mapValueOfType(json, r'connectionLevel'), + lastConnectionLevel: mapDateTime(json, r'lastConnectionLevel', ''), + batteryLevel: mapValueOfType(json, r'batteryLevel'), + lastBatteryLevel: mapDateTime(json, r'lastBatteryLevel', ''), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = DeviceDetailDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of DeviceDetailDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceDetailDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/device_detail_dto_all_of.dart b/manager_api/lib/model/device_detail_dto_all_of.dart index 9025552..cc7cfb6 100644 --- a/manager_api/lib/model/device_detail_dto_all_of.dart +++ b/manager_api/lib/model/device_detail_dto_all_of.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -18,13 +19,25 @@ class DeviceDetailDTOAllOf { this.lastBatteryLevel, }); - String connectionLevel; + String? connectionLevel; - DateTime lastConnectionLevel; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? lastConnectionLevel; - String batteryLevel; + String? batteryLevel; - DateTime lastBatteryLevel; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? lastBatteryLevel; @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && @@ -35,68 +48,104 @@ class DeviceDetailDTOAllOf { @override int get hashCode => - (connectionLevel == null ? 0 : connectionLevel.hashCode) + - (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + - (batteryLevel == null ? 0 : batteryLevel.hashCode) + - (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); + // ignore: unnecessary_parenthesis + (connectionLevel == null ? 0 : connectionLevel!.hashCode) + + (lastConnectionLevel == null ? 0 : lastConnectionLevel!.hashCode) + + (batteryLevel == null ? 0 : batteryLevel!.hashCode) + + (lastBatteryLevel == null ? 0 : lastBatteryLevel!.hashCode); @override String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; Map toJson() { - final json = {}; + final _json = {}; if (connectionLevel != null) { - json[r'connectionLevel'] = connectionLevel; + _json[r'connectionLevel'] = connectionLevel; } if (lastConnectionLevel != null) { - json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); + _json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String(); } if (batteryLevel != null) { - json[r'batteryLevel'] = batteryLevel; + _json[r'batteryLevel'] = batteryLevel; } if (lastBatteryLevel != null) { - json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); + _json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String(); } - return json; + return _json; } /// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static DeviceDetailDTOAllOf fromJson(Map json) => json == null - ? null - : DeviceDetailDTOAllOf( - connectionLevel: json[r'connectionLevel'], - lastConnectionLevel: json[r'lastConnectionLevel'] == null - ? null - : DateTime.parse(json[r'lastConnectionLevel']), - batteryLevel: json[r'batteryLevel'], - lastBatteryLevel: json[r'lastBatteryLevel'] == null - ? null - : DateTime.parse(json[r'lastBatteryLevel']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static DeviceDetailDTOAllOf? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "DeviceDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "DeviceDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return DeviceDetailDTOAllOf( + connectionLevel: mapValueOfType(json, r'connectionLevel'), + lastConnectionLevel: mapDateTime(json, r'lastConnectionLevel', ''), + batteryLevel: mapValueOfType(json, r'batteryLevel'), + lastBatteryLevel: mapDateTime(json, r'lastBatteryLevel', ''), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = DeviceDetailDTOAllOf.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of DeviceDetailDTOAllOf-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/device_dto.dart b/manager_api/lib/model/device_dto.dart index 19a5677..7915fb8 100644 --- a/manager_api/lib/model/device_dto.dart +++ b/manager_api/lib/model/device_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -22,27 +23,48 @@ class DeviceDTO { this.connected, this.dateCreation, this.dateUpdate, + this.instanceId, }); - String id; + String? id; - String identifier; + String? identifier; - String name; + String? name; - String ipAddressWLAN; + String? ipAddressWLAN; - String ipAddressETH; + String? ipAddressETH; - String configurationId; + String? configurationId; - String configuration; + String? configuration; - bool connected; + /// + /// 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? connected; - 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. + /// + DateTime? dateCreation; - DateTime dateUpdate; + /// + /// 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? dateUpdate; + + String? instanceId; @override bool operator ==(Object other) => identical(this, other) || other is DeviceDTO && @@ -55,102 +77,144 @@ class DeviceDTO { other.configuration == configuration && other.connected == connected && other.dateCreation == dateCreation && - other.dateUpdate == dateUpdate; + other.dateUpdate == dateUpdate && + other.instanceId == instanceId; @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (identifier == null ? 0 : identifier.hashCode) + - (name == null ? 0 : name.hashCode) + - (ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) + - (ipAddressETH == null ? 0 : ipAddressETH.hashCode) + - (configurationId == null ? 0 : configurationId.hashCode) + - (configuration == null ? 0 : configuration.hashCode) + - (connected == null ? 0 : connected.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode) + - (dateUpdate == null ? 0 : dateUpdate.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (identifier == null ? 0 : identifier!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (ipAddressWLAN == null ? 0 : ipAddressWLAN!.hashCode) + + (ipAddressETH == null ? 0 : ipAddressETH!.hashCode) + + (configurationId == null ? 0 : configurationId!.hashCode) + + (configuration == null ? 0 : configuration!.hashCode) + + (connected == null ? 0 : connected!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (dateUpdate == null ? 0 : dateUpdate!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate]'; + String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (identifier != null) { - json[r'identifier'] = identifier; + _json[r'identifier'] = identifier; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (ipAddressWLAN != null) { - json[r'ipAddressWLAN'] = ipAddressWLAN; + _json[r'ipAddressWLAN'] = ipAddressWLAN; } if (ipAddressETH != null) { - json[r'ipAddressETH'] = ipAddressETH; + _json[r'ipAddressETH'] = ipAddressETH; } if (configurationId != null) { - json[r'configurationId'] = configurationId; + _json[r'configurationId'] = configurationId; } if (configuration != null) { - json[r'configuration'] = configuration; + _json[r'configuration'] = configuration; } if (connected != null) { - json[r'connected'] = connected; + _json[r'connected'] = connected; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } if (dateUpdate != null) { - json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); + _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String(); } - return json; + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } + return _json; } /// Returns a new [DeviceDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static DeviceDTO fromJson(Map json) => json == null - ? null - : DeviceDTO( - id: json[r'id'], - identifier: json[r'identifier'], - name: json[r'name'], - ipAddressWLAN: json[r'ipAddressWLAN'], - ipAddressETH: json[r'ipAddressETH'], - configurationId: json[r'configurationId'], - configuration: json[r'configuration'], - connected: json[r'connected'], - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - dateUpdate: json[r'dateUpdate'] == null - ? null - : DateTime.parse(json[r'dateUpdate']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static DeviceDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => DeviceDTO.fromJson(v)).toList(growable: true == growable); + // 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 "DeviceDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "DeviceDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return DeviceDTO( + id: mapValueOfType(json, r'id'), + identifier: mapValueOfType(json, r'identifier'), + name: mapValueOfType(json, r'name'), + ipAddressWLAN: mapValueOfType(json, r'ipAddressWLAN'), + ipAddressETH: mapValueOfType(json, r'ipAddressETH'), + configurationId: mapValueOfType(json, r'configurationId'), + configuration: mapValueOfType(json, r'configuration'), + connected: mapValueOfType(json, r'connected'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + dateUpdate: mapDateTime(json, r'dateUpdate', ''), + instanceId: mapValueOfType(json, r'instanceId'), + ); + } + 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 = DeviceDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = DeviceDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of DeviceDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = DeviceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/export_configuration_dto.dart b/manager_api/lib/model/export_configuration_dto.dart index 3e2a8a2..ac75edc 100644 --- a/manager_api/lib/model/export_configuration_dto.dart +++ b/manager_api/lib/model/export_configuration_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -14,125 +15,250 @@ class ExportConfigurationDTO { ExportConfigurationDTO({ this.id, this.label, + this.title = const [], + this.imageId, + this.imageSource, this.primaryColor, this.secondaryColor, - this.languages, + this.languages = const [], this.dateCreation, - this.sections, - this.resources, + this.isMobile, + this.isTablet, + this.isOffline, + this.instanceId, + this.sections = const [], + this.resources = const [], }); - String id; + String? id; - String label; + String? label; - String primaryColor; + List? title; - String secondaryColor; + String? imageId; - List languages; + String? imageSource; - DateTime dateCreation; + String? primaryColor; - List sections; + String? secondaryColor; - List resources; + List? languages; + + /// + /// 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? 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? isOffline; + + String? instanceId; + + List? sections; + + List? resources; @override bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO && other.id == id && other.label == label && + other.title == title && + other.imageId == imageId && + other.imageSource == imageSource && other.primaryColor == primaryColor && other.secondaryColor == secondaryColor && other.languages == languages && other.dateCreation == dateCreation && + other.isMobile == isMobile && + other.isTablet == isTablet && + other.isOffline == isOffline && + other.instanceId == instanceId && other.sections == sections && other.resources == resources; @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (label == null ? 0 : label.hashCode) + - (primaryColor == null ? 0 : primaryColor.hashCode) + - (secondaryColor == null ? 0 : secondaryColor.hashCode) + - (languages == null ? 0 : languages.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode) + - (sections == null ? 0 : sections.hashCode) + - (resources == null ? 0 : resources.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (primaryColor == null ? 0 : primaryColor!.hashCode) + + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + + (languages == null ? 0 : languages!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isMobile == null ? 0 : isMobile!.hashCode) + + (isTablet == null ? 0 : isTablet!.hashCode) + + (isOffline == null ? 0 : isOffline!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (sections == null ? 0 : sections!.hashCode) + + (resources == null ? 0 : resources!.hashCode); @override - String toString() => 'ExportConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, sections=$sections, resources=$resources]'; + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sections=$sections, resources=$resources]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; + } + if (title != null) { + _json[r'title'] = title; + } + if (imageId != null) { + _json[r'imageId'] = imageId; + } + if (imageSource != null) { + _json[r'imageSource'] = imageSource; } if (primaryColor != null) { - json[r'primaryColor'] = primaryColor; + _json[r'primaryColor'] = primaryColor; } if (secondaryColor != null) { - json[r'secondaryColor'] = secondaryColor; + _json[r'secondaryColor'] = secondaryColor; } if (languages != null) { - json[r'languages'] = languages; + _json[r'languages'] = languages; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); + } + if (isMobile != null) { + _json[r'isMobile'] = isMobile; + } + if (isTablet != null) { + _json[r'isTablet'] = isTablet; + } + if (isOffline != null) { + _json[r'isOffline'] = isOffline; + } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; } if (sections != null) { - json[r'sections'] = sections; + _json[r'sections'] = sections; } if (resources != null) { - json[r'resources'] = resources; + _json[r'resources'] = resources; } - return json; + return _json; } /// Returns a new [ExportConfigurationDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ExportConfigurationDTO fromJson(Map json) => json == null - ? null - : ExportConfigurationDTO( - id: json[r'id'], - label: json[r'label'], - primaryColor: json[r'primaryColor'], - secondaryColor: json[r'secondaryColor'], - languages: json[r'languages'] == null - ? null - : (json[r'languages'] as List).cast(), - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - sections: SectionDTO.listFromJson(json[r'sections']), - resources: ResourceDTO.listFromJson(json[r'resources']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ExportConfigurationDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ExportConfigurationDTO.fromJson(v)).toList(growable: true == growable); + // 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 "ExportConfigurationDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ExportConfigurationDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ExportConfigurationDTO( + id: mapValueOfType(json, r'id'), + label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + primaryColor: mapValueOfType(json, r'primaryColor'), + secondaryColor: mapValueOfType(json, r'secondaryColor'), + languages: json[r'languages'] is List + ? (json[r'languages'] as List).cast() + : const [], + dateCreation: mapDateTime(json, r'dateCreation', ''), + isMobile: mapValueOfType(json, r'isMobile'), + isTablet: mapValueOfType(json, r'isTablet'), + isOffline: mapValueOfType(json, r'isOffline'), + instanceId: mapValueOfType(json, r'instanceId'), + sections: SectionDTO.listFromJson(json[r'sections']) ?? const [], + resources: ResourceDTO.listFromJson(json[r'resources']) ?? 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 = ExportConfigurationDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ExportConfigurationDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ExportConfigurationDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ExportConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/export_configuration_dto_all_of.dart b/manager_api/lib/model/export_configuration_dto_all_of.dart index 4d93a48..28c86a7 100644 --- a/manager_api/lib/model/export_configuration_dto_all_of.dart +++ b/manager_api/lib/model/export_configuration_dto_all_of.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,13 +13,13 @@ part of openapi.api; class ExportConfigurationDTOAllOf { /// Returns a new [ExportConfigurationDTOAllOf] instance. ExportConfigurationDTOAllOf({ - this.sections, - this.resources, + this.sections = const [], + this.resources = const [], }); - List sections; + List? sections; - List resources; + List? resources; @override bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTOAllOf && @@ -27,54 +28,94 @@ class ExportConfigurationDTOAllOf { @override int get hashCode => - (sections == null ? 0 : sections.hashCode) + - (resources == null ? 0 : resources.hashCode); + // ignore: unnecessary_parenthesis + (sections == null ? 0 : sections!.hashCode) + + (resources == null ? 0 : resources!.hashCode); @override String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]'; Map toJson() { - final json = {}; + final _json = {}; if (sections != null) { - json[r'sections'] = sections; + _json[r'sections'] = sections; } if (resources != null) { - json[r'resources'] = resources; + _json[r'resources'] = resources; } - return json; + return _json; } /// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ExportConfigurationDTOAllOf fromJson(Map json) => json == null - ? null - : ExportConfigurationDTOAllOf( - sections: SectionDTO.listFromJson(json[r'sections']), - resources: ResourceDTO.listFromJson(json[r'resources']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ExportConfigurationDTOAllOf? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ExportConfigurationDTOAllOf.fromJson(v)).toList(growable: true == growable); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ExportConfigurationDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ExportConfigurationDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ExportConfigurationDTOAllOf( + sections: SectionDTO.listFromJson(json[r'sections']) ?? const [], + resources: ResourceDTO.listFromJson(json[r'resources']) ?? 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 = ExportConfigurationDTOAllOf.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ExportConfigurationDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ExportConfigurationDTOAllOf-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ExportConfigurationDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/geo_point_dto.dart b/manager_api/lib/model/geo_point_dto.dart index 15363a1..28600c5 100644 --- a/manager_api/lib/model/geo_point_dto.dart +++ b/manager_api/lib/model/geo_point_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -13,24 +14,30 @@ class GeoPointDTO { /// Returns a new [GeoPointDTO] instance. GeoPointDTO({ this.id, - this.title, - this.description, - this.images, + this.title = const [], + this.description = const [], + this.images = const [], this.latitude, this.longitude, }); - int id; + /// + /// 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? id; - List title; + List? title; - List description; + List? description; - List images; + List? images; - String latitude; + String? latitude; - String longitude; + String? longitude; @override bool operator ==(Object other) => identical(this, other) || other is GeoPointDTO && @@ -43,74 +50,114 @@ class GeoPointDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (title == null ? 0 : title.hashCode) + - (description == null ? 0 : description.hashCode) + - (images == null ? 0 : images.hashCode) + - (latitude == null ? 0 : latitude.hashCode) + - (longitude == null ? 0 : longitude.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (images == null ? 0 : images!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode); @override String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (title != null) { - json[r'title'] = title; + _json[r'title'] = title; } if (description != null) { - json[r'description'] = description; + _json[r'description'] = description; } if (images != null) { - json[r'images'] = images; + _json[r'images'] = images; } if (latitude != null) { - json[r'latitude'] = latitude; + _json[r'latitude'] = latitude; } if (longitude != null) { - json[r'longitude'] = longitude; + _json[r'longitude'] = longitude; } - return json; + return _json; } /// Returns a new [GeoPointDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GeoPointDTO fromJson(Map json) => json == null - ? null - : GeoPointDTO( - id: json[r'id'], - title: TranslationDTO.listFromJson(json[r'title']), - description: TranslationDTO.listFromJson(json[r'description']), - images: ImageGeoPoint.listFromJson(json[r'images']), - latitude: json[r'latitude'], - longitude: json[r'longitude'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeoPointDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => GeoPointDTO.fromJson(v)).toList(growable: true == growable); + // 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 "GeoPointDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GeoPointDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GeoPointDTO( + id: mapValueOfType(json, r'id'), + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + description: TranslationDTO.listFromJson(json[r'description']) ?? const [], + images: ImageGeoPoint.listFromJson(json[r'images']) ?? const [], + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + ); + } + 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 = GeoPointDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = GeoPointDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GeoPointDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GeoPointDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = GeoPointDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GeoPointDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/image_dto.dart b/manager_api/lib/model/image_dto.dart index 8ea812c..b72c787 100644 --- a/manager_api/lib/model/image_dto.dart +++ b/manager_api/lib/model/image_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,22 +13,28 @@ part of openapi.api; class ImageDTO { /// Returns a new [ImageDTO] instance. ImageDTO({ - this.title, - this.description, + this.title = const [], + this.description = const [], this.resourceId, this.source_, this.order, }); - List title; + List? title; - List description; + List? description; - String resourceId; + String? resourceId; - String source_; + String? source_; - 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. + /// + int? order; @override bool operator ==(Object other) => identical(this, other) || other is ImageDTO && @@ -39,69 +46,109 @@ class ImageDTO { @override int get hashCode => - (title == null ? 0 : title.hashCode) + - (description == null ? 0 : description.hashCode) + - (resourceId == null ? 0 : resourceId.hashCode) + - (source_ == null ? 0 : source_.hashCode) + - (order == null ? 0 : order.hashCode); + // ignore: unnecessary_parenthesis + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (source_ == null ? 0 : source_!.hashCode) + + (order == null ? 0 : order!.hashCode); @override String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]'; Map toJson() { - final json = {}; + final _json = {}; if (title != null) { - json[r'title'] = title; + _json[r'title'] = title; } if (description != null) { - json[r'description'] = description; + _json[r'description'] = description; } if (resourceId != null) { - json[r'resourceId'] = resourceId; + _json[r'resourceId'] = resourceId; } if (source_ != null) { - json[r'source'] = source_; + _json[r'source'] = source_; } if (order != null) { - json[r'order'] = order; + _json[r'order'] = order; } - return json; + return _json; } /// Returns a new [ImageDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ImageDTO fromJson(Map json) => json == null - ? null - : ImageDTO( - title: TranslationDTO.listFromJson(json[r'title']), - description: TranslationDTO.listFromJson(json[r'description']), - resourceId: json[r'resourceId'], - source_: json[r'source'], - order: json[r'order'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ImageDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ImageDTO.fromJson(v)).toList(growable: true == growable); + // 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 "ImageDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ImageDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ImageDTO( + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + description: TranslationDTO.listFromJson(json[r'description']) ?? const [], + resourceId: mapValueOfType(json, r'resourceId'), + source_: mapValueOfType(json, r'source'), + order: mapValueOfType(json, r'order'), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ImageDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ImageDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ImageDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ImageDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ImageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ImageDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/image_geo_point.dart b/manager_api/lib/model/image_geo_point.dart index 923877f..8291c85 100644 --- a/manager_api/lib/model/image_geo_point.dart +++ b/manager_api/lib/model/image_geo_point.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -16,9 +17,9 @@ class ImageGeoPoint { this.imageSource, }); - String imageResourceId; + String? imageResourceId; - String imageSource; + String? imageSource; @override bool operator ==(Object other) => identical(this, other) || other is ImageGeoPoint && @@ -27,54 +28,94 @@ class ImageGeoPoint { @override int get hashCode => - (imageResourceId == null ? 0 : imageResourceId.hashCode) + - (imageSource == null ? 0 : imageSource.hashCode); + // ignore: unnecessary_parenthesis + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode); @override String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]'; Map toJson() { - final json = {}; + final _json = {}; if (imageResourceId != null) { - json[r'imageResourceId'] = imageResourceId; + _json[r'imageResourceId'] = imageResourceId; } if (imageSource != null) { - json[r'imageSource'] = imageSource; + _json[r'imageSource'] = imageSource; } - return json; + return _json; } /// Returns a new [ImageGeoPoint] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ImageGeoPoint fromJson(Map json) => json == null - ? null - : ImageGeoPoint( - imageResourceId: json[r'imageResourceId'], - imageSource: json[r'imageSource'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ImageGeoPoint? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ImageGeoPoint.fromJson(v)).toList(growable: true == growable); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ImageGeoPoint[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ImageGeoPoint[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ImageGeoPoint( + imageResourceId: mapValueOfType(json, r'imageResourceId'), + imageSource: mapValueOfType(json, r'imageSource'), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ImageGeoPoint.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ImageGeoPoint.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ImageGeoPoint.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ImageGeoPoint-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ImageGeoPoint.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ImageGeoPoint.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/instance.dart b/manager_api/lib/model/instance.dart new file mode 100644 index 0000000..74e7ca8 --- /dev/null +++ b/manager_api/lib/model/instance.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Instance { + /// Returns a new [Instance] instance. + Instance({ + this.id, + this.name, + this.dateCreation, + }); + + String? id; + + String? name; + + /// + /// 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; + + @override + bool operator ==(Object other) => identical(this, other) || other is Instance && + other.id == id && + other.name == name && + other.dateCreation == dateCreation; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode); + + @override + String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]'; + + Map toJson() { + final _json = {}; + if (id != null) { + _json[r'id'] = id; + } + if (name != null) { + _json[r'name'] = name; + } + if (dateCreation != null) { + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); + } + return _json; + } + + /// Returns a new [Instance] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Instance? 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 "Instance[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Instance[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Instance( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + ); + } + 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 = Instance.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 = Instance.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Instance-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Instance.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/instance_dto.dart b/manager_api/lib/model/instance_dto.dart new file mode 100644 index 0000000..a1d77a7 --- /dev/null +++ b/manager_api/lib/model/instance_dto.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class InstanceDTO { + /// Returns a new [InstanceDTO] instance. + InstanceDTO({ + this.id, + this.name, + this.dateCreation, + }); + + String? id; + + String? name; + + /// + /// 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; + + @override + bool operator ==(Object other) => identical(this, other) || other is InstanceDTO && + other.id == id && + other.name == name && + other.dateCreation == dateCreation; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode); + + @override + String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]'; + + Map toJson() { + final _json = {}; + if (id != null) { + _json[r'id'] = id; + } + if (name != null) { + _json[r'name'] = name; + } + if (dateCreation != null) { + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); + } + return _json; + } + + /// Returns a new [InstanceDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static InstanceDTO? 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 "InstanceDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "InstanceDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return InstanceDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + ); + } + 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 = InstanceDTO.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 = InstanceDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of InstanceDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = InstanceDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/level_dto.dart b/manager_api/lib/model/level_dto.dart index c9a5f17..58cfe04 100644 --- a/manager_api/lib/model/level_dto.dart +++ b/manager_api/lib/model/level_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,16 +13,16 @@ part of openapi.api; class LevelDTO { /// Returns a new [LevelDTO] instance. LevelDTO({ - this.label, + this.label = const [], this.resourceId, this.source_, }); - List label; + List? label; - String resourceId; + String? resourceId; - String source_; + String? source_; @override bool operator ==(Object other) => identical(this, other) || other is LevelDTO && @@ -31,59 +32,99 @@ class LevelDTO { @override int get hashCode => - (label == null ? 0 : label.hashCode) + - (resourceId == null ? 0 : resourceId.hashCode) + - (source_ == null ? 0 : source_.hashCode); + // ignore: unnecessary_parenthesis + (label == null ? 0 : label!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (source_ == null ? 0 : source_!.hashCode); @override String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]'; Map toJson() { - final json = {}; + final _json = {}; if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; } if (resourceId != null) { - json[r'resourceId'] = resourceId; + _json[r'resourceId'] = resourceId; } if (source_ != null) { - json[r'source'] = source_; + _json[r'source'] = source_; } - return json; + return _json; } /// Returns a new [LevelDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static LevelDTO fromJson(Map json) => json == null - ? null - : LevelDTO( - label: TranslationDTO.listFromJson(json[r'label']), - resourceId: json[r'resourceId'], - source_: json[r'source'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static LevelDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => LevelDTO.fromJson(v)).toList(growable: true == growable); + // 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 "LevelDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "LevelDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return LevelDTO( + label: TranslationDTO.listFromJson(json[r'label']) ?? const [], + resourceId: mapValueOfType(json, r'resourceId'), + source_: mapValueOfType(json, r'source'), + ); + } + 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 = LevelDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = LevelDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = LevelDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of LevelDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = LevelDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = LevelDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/login_dto.dart b/manager_api/lib/model/login_dto.dart index ff0bed5..e5543ec 100644 --- a/manager_api/lib/model/login_dto.dart +++ b/manager_api/lib/model/login_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -16,9 +17,9 @@ class LoginDTO { this.password, }); - String email; + String? email; - String password; + String? password; @override bool operator ==(Object other) => identical(this, other) || other is LoginDTO && @@ -27,54 +28,94 @@ class LoginDTO { @override int get hashCode => - (email == null ? 0 : email.hashCode) + - (password == null ? 0 : password.hashCode); + // ignore: unnecessary_parenthesis + (email == null ? 0 : email!.hashCode) + + (password == null ? 0 : password!.hashCode); @override String toString() => 'LoginDTO[email=$email, password=$password]'; Map toJson() { - final json = {}; + final _json = {}; if (email != null) { - json[r'email'] = email; + _json[r'email'] = email; } if (password != null) { - json[r'password'] = password; + _json[r'password'] = password; } - return json; + return _json; } /// Returns a new [LoginDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static LoginDTO fromJson(Map json) => json == null - ? null - : LoginDTO( - email: json[r'email'], - password: json[r'password'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static LoginDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => LoginDTO.fromJson(v)).toList(growable: true == growable); + // 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 "LoginDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "LoginDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return LoginDTO( + email: mapValueOfType(json, r'email'), + password: mapValueOfType(json, r'password'), + ); + } + 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 = LoginDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = LoginDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = LoginDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of LoginDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = LoginDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = LoginDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/map_dto.dart b/manager_api/lib/model/map_dto.dart index f8e229d..8a283e6 100644 --- a/manager_api/lib/model/map_dto.dart +++ b/manager_api/lib/model/map_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -14,20 +15,32 @@ class MapDTO { MapDTO({ this.zoom, this.mapType, - this.points, + this.points = const [], this.iconResourceId, this.iconSource, }); - int zoom; + /// + /// 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? zoom; - MapTypeApp mapType; + /// + /// 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. + /// + MapTypeApp? mapType; - List points; + List? points; - String iconResourceId; + String? iconResourceId; - String iconSource; + String? iconSource; @override bool operator ==(Object other) => identical(this, other) || other is MapDTO && @@ -39,69 +52,109 @@ class MapDTO { @override int get hashCode => - (zoom == null ? 0 : zoom.hashCode) + - (mapType == null ? 0 : mapType.hashCode) + - (points == null ? 0 : points.hashCode) + - (iconResourceId == null ? 0 : iconResourceId.hashCode) + - (iconSource == null ? 0 : iconSource.hashCode); + // ignore: unnecessary_parenthesis + (zoom == null ? 0 : zoom!.hashCode) + + (mapType == null ? 0 : mapType!.hashCode) + + (points == null ? 0 : points!.hashCode) + + (iconResourceId == null ? 0 : iconResourceId!.hashCode) + + (iconSource == null ? 0 : iconSource!.hashCode); @override String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]'; Map toJson() { - final json = {}; + final _json = {}; if (zoom != null) { - json[r'zoom'] = zoom; + _json[r'zoom'] = zoom; } if (mapType != null) { - json[r'mapType'] = mapType; + _json[r'mapType'] = mapType; } if (points != null) { - json[r'points'] = points; + _json[r'points'] = points; } if (iconResourceId != null) { - json[r'iconResourceId'] = iconResourceId; + _json[r'iconResourceId'] = iconResourceId; } if (iconSource != null) { - json[r'iconSource'] = iconSource; + _json[r'iconSource'] = iconSource; } - return json; + return _json; } /// Returns a new [MapDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static MapDTO fromJson(Map json) => json == null - ? null - : MapDTO( - zoom: json[r'zoom'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapDTO? 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 "MapDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "MapDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapDTO( + zoom: mapValueOfType(json, r'zoom'), mapType: MapTypeApp.fromJson(json[r'mapType']), - points: GeoPointDTO.listFromJson(json[r'points']), - iconResourceId: json[r'iconResourceId'], - iconSource: json[r'iconSource'], - ); + points: GeoPointDTO.listFromJson(json[r'points']) ?? const [], + iconResourceId: mapValueOfType(json, r'iconResourceId'), + iconSource: mapValueOfType(json, r'iconSource'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => MapDTO.fromJson(v)).toList(growable: true == growable); + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } - static Map mapFromJson(Map json) { + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = MapDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MapDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of MapDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = MapDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MapDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/map_type_app.dart b/manager_api/lib/model/map_type_app.dart index 893968e..9fd93be 100644 --- a/manager_api/lib/model/map_type_app.dart +++ b/manager_api/lib/model/map_type_app.dart @@ -1,32 +1,33 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; - +/// 0 = none 1 = normal 2 = satellite 3 = terrain 4 = hybrid class MapTypeApp { /// Instantiate a new enum with the provided [value]. const MapTypeApp._(this.value); /// The underlying value of this enum member. - final String value; + final int value; @override - String toString() => value; + String toString() => value.toString(); - String toJson() => value; + int toJson() => value; - static const none = MapTypeApp._(r'none'); - static const normal = MapTypeApp._(r'normal'); - static const satellite = MapTypeApp._(r'satellite'); - static const terrain = MapTypeApp._(r'terrain'); - static const hybrid = MapTypeApp._(r'hybrid'); + static const none = MapTypeApp._(0); + static const normal = MapTypeApp._(1); + static const satellite = MapTypeApp._(2); + static const terrain = MapTypeApp._(3); + static const hybrid = MapTypeApp._(4); /// List of all possible values in this [enum][MapTypeApp]. static const values = [ @@ -37,25 +38,30 @@ class MapTypeApp { hybrid, ]; - static MapTypeApp fromJson(dynamic value) => - MapTypeAppTypeTransformer().decode(value); + static MapTypeApp? fromJson(dynamic value) => MapTypeAppTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => MapTypeApp.fromJson(value)) - .toList(growable: true == growable); + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapTypeApp.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } -/// Transformation class that can [encode] an instance of [MapTypeApp] to String, +/// Transformation class that can [encode] an instance of [MapTypeApp] to int, /// and [decode] dynamic data back to [MapTypeApp]. class MapTypeAppTypeTransformer { + factory MapTypeAppTypeTransformer() => _instance ??= const MapTypeAppTypeTransformer._(); + const MapTypeAppTypeTransformer._(); - factory MapTypeAppTypeTransformer() => _instance ??= MapTypeAppTypeTransformer._(); - - String encode(MapTypeApp data) => data.value; + int encode(MapTypeApp data) => data.value; /// Decodes a [dynamic value][data] to a MapTypeApp. /// @@ -65,21 +71,24 @@ class MapTypeAppTypeTransformer { /// /// 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. - MapTypeApp decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'none': return MapTypeApp.none; - case r'normal': return MapTypeApp.normal; - case r'satellite': return MapTypeApp.satellite; - case r'terrain': return MapTypeApp.terrain; - case r'hybrid': return MapTypeApp.hybrid; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + MapTypeApp? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'none': return MapTypeApp.none; + case r'normal': return MapTypeApp.normal; + case r'satellite': return MapTypeApp.satellite; + case r'terrain': return MapTypeApp.terrain; + case r'hybrid': return MapTypeApp.hybrid; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [MapTypeAppTypeTransformer] instance. - static MapTypeAppTypeTransformer _instance; + static MapTypeAppTypeTransformer? _instance; } + diff --git a/manager_api/lib/model/menu_dto.dart b/manager_api/lib/model/menu_dto.dart index bcde011..feb29a8 100644 --- a/manager_api/lib/model/menu_dto.dart +++ b/manager_api/lib/model/menu_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,10 +13,10 @@ part of openapi.api; class MenuDTO { /// Returns a new [MenuDTO] instance. MenuDTO({ - this.sections, + this.sections = const [], }); - List sections; + List? sections; @override bool operator ==(Object other) => identical(this, other) || other is MenuDTO && @@ -23,49 +24,89 @@ class MenuDTO { @override int get hashCode => - (sections == null ? 0 : sections.hashCode); + // ignore: unnecessary_parenthesis + (sections == null ? 0 : sections!.hashCode); @override String toString() => 'MenuDTO[sections=$sections]'; Map toJson() { - final json = {}; + final _json = {}; if (sections != null) { - json[r'sections'] = sections; + _json[r'sections'] = sections; } - return json; + return _json; } /// Returns a new [MenuDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static MenuDTO fromJson(Map json) => json == null - ? null - : MenuDTO( - sections: SectionDTO.listFromJson(json[r'sections']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MenuDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => MenuDTO.fromJson(v)).toList(growable: true == growable); + // 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 "MenuDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "MenuDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return MenuDTO( + sections: SectionDTO.listFromJson(json[r'sections']) ?? 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 = MenuDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = MenuDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MenuDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of MenuDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = MenuDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MenuDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/player_message_dto.dart b/manager_api/lib/model/player_message_dto.dart index 0341a99..c51ce09 100644 --- a/manager_api/lib/model/player_message_dto.dart +++ b/manager_api/lib/model/player_message_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -16,9 +17,21 @@ class PlayerMessageDTO { this.isDeleted, }); - bool configChanged; + /// + /// 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? configChanged; - bool isDeleted; + /// + /// 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? isDeleted; @override bool operator ==(Object other) => identical(this, other) || other is PlayerMessageDTO && @@ -27,54 +40,94 @@ class PlayerMessageDTO { @override int get hashCode => - (configChanged == null ? 0 : configChanged.hashCode) + - (isDeleted == null ? 0 : isDeleted.hashCode); + // ignore: unnecessary_parenthesis + (configChanged == null ? 0 : configChanged!.hashCode) + + (isDeleted == null ? 0 : isDeleted!.hashCode); @override String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]'; Map toJson() { - final json = {}; + final _json = {}; if (configChanged != null) { - json[r'configChanged'] = configChanged; + _json[r'configChanged'] = configChanged; } if (isDeleted != null) { - json[r'isDeleted'] = isDeleted; + _json[r'isDeleted'] = isDeleted; } - return json; + return _json; } /// Returns a new [PlayerMessageDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static PlayerMessageDTO fromJson(Map json) => json == null - ? null - : PlayerMessageDTO( - configChanged: json[r'configChanged'], - isDeleted: json[r'isDeleted'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PlayerMessageDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => PlayerMessageDTO.fromJson(v)).toList(growable: true == growable); + // 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 "PlayerMessageDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PlayerMessageDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return PlayerMessageDTO( + configChanged: mapValueOfType(json, r'configChanged'), + isDeleted: mapValueOfType(json, r'isDeleted'), + ); + } + 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 = PlayerMessageDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = PlayerMessageDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PlayerMessageDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of PlayerMessageDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = PlayerMessageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PlayerMessageDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/question_dto.dart b/manager_api/lib/model/question_dto.dart index 0584111..0e7f86b 100644 --- a/manager_api/lib/model/question_dto.dart +++ b/manager_api/lib/model/question_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,22 +13,28 @@ part of openapi.api; class QuestionDTO { /// Returns a new [QuestionDTO] instance. QuestionDTO({ - this.label, - this.responses, + this.label = const [], + this.responses = const [], this.resourceId, this.source_, this.order, }); - List label; + List? label; - List responses; + List? responses; - String resourceId; + String? resourceId; - String source_; + String? source_; - 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. + /// + int? order; @override bool operator ==(Object other) => identical(this, other) || other is QuestionDTO && @@ -39,69 +46,109 @@ class QuestionDTO { @override int get hashCode => - (label == null ? 0 : label.hashCode) + - (responses == null ? 0 : responses.hashCode) + - (resourceId == null ? 0 : resourceId.hashCode) + - (source_ == null ? 0 : source_.hashCode) + - (order == null ? 0 : order.hashCode); + // ignore: unnecessary_parenthesis + (label == null ? 0 : label!.hashCode) + + (responses == null ? 0 : responses!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (source_ == null ? 0 : source_!.hashCode) + + (order == null ? 0 : order!.hashCode); @override String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]'; Map toJson() { - final json = {}; + final _json = {}; if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; } if (responses != null) { - json[r'responses'] = responses; + _json[r'responses'] = responses; } if (resourceId != null) { - json[r'resourceId'] = resourceId; + _json[r'resourceId'] = resourceId; } if (source_ != null) { - json[r'source'] = source_; + _json[r'source'] = source_; } if (order != null) { - json[r'order'] = order; + _json[r'order'] = order; } - return json; + return _json; } /// Returns a new [QuestionDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static QuestionDTO fromJson(Map json) => json == null - ? null - : QuestionDTO( - label: TranslationDTO.listFromJson(json[r'label']), - responses: ResponseDTO.listFromJson(json[r'responses']), - resourceId: json[r'resourceId'], - source_: json[r'source'], - order: json[r'order'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static QuestionDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => QuestionDTO.fromJson(v)).toList(growable: true == growable); + // 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 "QuestionDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "QuestionDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return QuestionDTO( + label: TranslationDTO.listFromJson(json[r'label']) ?? const [], + responses: ResponseDTO.listFromJson(json[r'responses']) ?? const [], + resourceId: mapValueOfType(json, r'resourceId'), + source_: mapValueOfType(json, r'source'), + order: mapValueOfType(json, r'order'), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = QuestionDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = QuestionDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = QuestionDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of QuestionDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = QuestionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = QuestionDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/quizz_dto.dart b/manager_api/lib/model/quizz_dto.dart index 20c22f2..d4cfd58 100644 --- a/manager_api/lib/model/quizz_dto.dart +++ b/manager_api/lib/model/quizz_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,22 +13,22 @@ part of openapi.api; class QuizzDTO { /// Returns a new [QuizzDTO] instance. QuizzDTO({ - this.questions, + this.questions = const [], this.badLevel, this.mediumLevel, this.goodLevel, this.greatLevel, }); - List questions; + List? questions; - LevelDTO badLevel; + QuizzDTOBadLevel? badLevel; - LevelDTO mediumLevel; + QuizzDTOBadLevel? mediumLevel; - LevelDTO goodLevel; + QuizzDTOBadLevel? goodLevel; - LevelDTO greatLevel; + QuizzDTOBadLevel? greatLevel; @override bool operator ==(Object other) => identical(this, other) || other is QuizzDTO && @@ -39,69 +40,109 @@ class QuizzDTO { @override int get hashCode => - (questions == null ? 0 : questions.hashCode) + - (badLevel == null ? 0 : badLevel.hashCode) + - (mediumLevel == null ? 0 : mediumLevel.hashCode) + - (goodLevel == null ? 0 : goodLevel.hashCode) + - (greatLevel == null ? 0 : greatLevel.hashCode); + // ignore: unnecessary_parenthesis + (questions == null ? 0 : questions!.hashCode) + + (badLevel == null ? 0 : badLevel!.hashCode) + + (mediumLevel == null ? 0 : mediumLevel!.hashCode) + + (goodLevel == null ? 0 : goodLevel!.hashCode) + + (greatLevel == null ? 0 : greatLevel!.hashCode); @override String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]'; Map toJson() { - final json = {}; + final _json = {}; if (questions != null) { - json[r'questions'] = questions; + _json[r'questions'] = questions; } if (badLevel != null) { - json[r'bad_level'] = badLevel; + _json[r'bad_level'] = badLevel; } if (mediumLevel != null) { - json[r'medium_level'] = mediumLevel; + _json[r'medium_level'] = mediumLevel; } if (goodLevel != null) { - json[r'good_level'] = goodLevel; + _json[r'good_level'] = goodLevel; } if (greatLevel != null) { - json[r'great_level'] = greatLevel; + _json[r'great_level'] = greatLevel; } - return json; + return _json; } /// Returns a new [QuizzDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static QuizzDTO fromJson(Map json) => json == null - ? null - : QuizzDTO( - questions: QuestionDTO.listFromJson(json[r'questions']), - badLevel: LevelDTO.fromJson(json[r'bad_level']), - mediumLevel: LevelDTO.fromJson(json[r'medium_level']), - goodLevel: LevelDTO.fromJson(json[r'good_level']), - greatLevel: LevelDTO.fromJson(json[r'great_level']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static QuizzDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => QuizzDTO.fromJson(v)).toList(growable: true == growable); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "QuizzDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "QuizzDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return QuizzDTO( + questions: QuestionDTO.listFromJson(json[r'questions']) ?? const [], + badLevel: QuizzDTOBadLevel.fromJson(json[r'bad_level']), + mediumLevel: QuizzDTOBadLevel.fromJson(json[r'medium_level']), + goodLevel: QuizzDTOBadLevel.fromJson(json[r'good_level']), + greatLevel: QuizzDTOBadLevel.fromJson(json[r'great_level']), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = QuizzDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = QuizzDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = QuizzDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of QuizzDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = QuizzDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = QuizzDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/quizz_dto_bad_level.dart b/manager_api/lib/model/quizz_dto_bad_level.dart new file mode 100644 index 0000000..f18f478 --- /dev/null +++ b/manager_api/lib/model/quizz_dto_bad_level.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QuizzDTOBadLevel { + /// Returns a new [QuizzDTOBadLevel] instance. + QuizzDTOBadLevel({ + this.label = const [], + this.resourceId, + this.source_, + }); + + List? label; + + String? resourceId; + + String? source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is QuizzDTOBadLevel && + other.label == label && + other.resourceId == resourceId && + other.source_ == source_; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (label == null ? 0 : label!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (source_ == null ? 0 : source_!.hashCode); + + @override + String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, source_=$source_]'; + + Map toJson() { + final _json = {}; + if (label != null) { + _json[r'label'] = label; + } + if (resourceId != null) { + _json[r'resourceId'] = resourceId; + } + if (source_ != null) { + _json[r'source'] = source_; + } + return _json; + } + + /// Returns a new [QuizzDTOBadLevel] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static QuizzDTOBadLevel? fromJson(dynamic value) { + 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 "QuizzDTOBadLevel[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "QuizzDTOBadLevel[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return QuizzDTOBadLevel( + label: TranslationDTO.listFromJson(json[r'label']) ?? const [], + resourceId: mapValueOfType(json, r'resourceId'), + source_: mapValueOfType(json, r'source'), + ); + } + 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 = QuizzDTOBadLevel.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 = QuizzDTOBadLevel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of QuizzDTOBadLevel-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = QuizzDTOBadLevel.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/resource_dto.dart b/manager_api/lib/model/resource_dto.dart index 81f6382..72a3f52 100644 --- a/manager_api/lib/model/resource_dto.dart +++ b/manager_api/lib/model/resource_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -15,95 +16,154 @@ class ResourceDTO { this.id, this.type, this.label, - this.dateCreation, this.data, + this.dateCreation, + this.instanceId, }); - String id; + String? id; - ResourceType type; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + ResourceType? type; - String label; + String? label; - DateTime dateCreation; + String? data; - String data; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? dateCreation; + + String? instanceId; @override bool operator ==(Object other) => identical(this, other) || other is ResourceDTO && other.id == id && other.type == type && other.label == label && + other.data == data && other.dateCreation == dateCreation && - other.data == data; + other.instanceId == instanceId; @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (type == null ? 0 : type.hashCode) + - (label == null ? 0 : label.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode) + - (data == null ? 0 : data.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (data == null ? 0 : data!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data]'; + String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data, dateCreation=$dateCreation, instanceId=$instanceId]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (label != null) { - json[r'label'] = label; - } - if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'label'] = label; } if (data != null) { - json[r'data'] = data; + _json[r'data'] = data; } - return json; + if (dateCreation != null) { + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); + } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } + return _json; } /// Returns a new [ResourceDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ResourceDTO fromJson(Map json) => json == null - ? null - : ResourceDTO( - id: json[r'id'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ResourceDTO? 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 "ResourceDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ResourceDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ResourceDTO( + id: mapValueOfType(json, r'id'), type: ResourceType.fromJson(json[r'type']), - label: json[r'label'], - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - data: json[r'data'], - ); + label: mapValueOfType(json, r'label'), + data: mapValueOfType(json, r'data'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + instanceId: mapValueOfType(json, r'instanceId'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ResourceDTO.fromJson(v)).toList(growable: true == growable); + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ResourceDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } - static Map mapFromJson(Map json) { + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ResourceDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ResourceDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ResourceDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ResourceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ResourceDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/resource_type.dart b/manager_api/lib/model/resource_type.dart index cb501a3..adeadd3 100644 --- a/manager_api/lib/model/resource_type.dart +++ b/manager_api/lib/model/resource_type.dart @@ -1,31 +1,33 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; - +/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio class ResourceType { /// Instantiate a new enum with the provided [value]. const ResourceType._(this.value); /// The underlying value of this enum member. - final String value; + final int value; @override - String toString() => value; + String toString() => value.toString(); - String toJson() => value; + int toJson() => value; - static const image = ResourceType._(r'Image'); - static const video = ResourceType._(r'Video'); - static const imageUrl = ResourceType._(r'ImageUrl'); - static const videoUrl = ResourceType._(r'VideoUrl'); + static const image = ResourceType._(0); + static const video = ResourceType._(1); + static const imageUrl = ResourceType._(2); + static const videoUrl = ResourceType._(3); + static const audio = ResourceType._(4); /// List of all possible values in this [enum][ResourceType]. static const values = [ @@ -33,27 +35,33 @@ class ResourceType { video, imageUrl, videoUrl, + audio, ]; - static ResourceType fromJson(dynamic value) => - ResourceTypeTypeTransformer().decode(value); + static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ResourceType.fromJson(value)) - .toList(growable: true == growable); + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ResourceType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } -/// Transformation class that can [encode] an instance of [ResourceType] to String, +/// Transformation class that can [encode] an instance of [ResourceType] to int, /// and [decode] dynamic data back to [ResourceType]. class ResourceTypeTypeTransformer { + factory ResourceTypeTypeTransformer() => _instance ??= const ResourceTypeTypeTransformer._(); + const ResourceTypeTypeTransformer._(); - factory ResourceTypeTypeTransformer() => _instance ??= ResourceTypeTypeTransformer._(); - - String encode(ResourceType data) => data.value; + int encode(ResourceType data) => data.value; /// Decodes a [dynamic value][data] to a ResourceType. /// @@ -63,20 +71,24 @@ class ResourceTypeTypeTransformer { /// /// 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. - ResourceType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Image': return ResourceType.image; - case r'Video': return ResourceType.video; - case r'ImageUrl': return ResourceType.imageUrl; - case r'VideoUrl': return ResourceType.videoUrl; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ResourceType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'image': return ResourceType.image; + case r'video': return ResourceType.video; + case r'imageUrl': return ResourceType.imageUrl; + case r'videoUrl': return ResourceType.videoUrl; + case r'audio': return ResourceType.audio; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ResourceTypeTypeTransformer] instance. - static ResourceTypeTypeTransformer _instance; + static ResourceTypeTypeTransformer? _instance; } + diff --git a/manager_api/lib/model/response_dto.dart b/manager_api/lib/model/response_dto.dart index 1415493..266f6a9 100644 --- a/manager_api/lib/model/response_dto.dart +++ b/manager_api/lib/model/response_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,16 +13,28 @@ part of openapi.api; class ResponseDTO { /// Returns a new [ResponseDTO] instance. ResponseDTO({ - this.label, + this.label = const [], this.isGood, this.order, }); - List label; + List? label; - bool isGood; + /// + /// 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? isGood; - 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. + /// + int? order; @override bool operator ==(Object other) => identical(this, other) || other is ResponseDTO && @@ -31,59 +44,99 @@ class ResponseDTO { @override int get hashCode => - (label == null ? 0 : label.hashCode) + - (isGood == null ? 0 : isGood.hashCode) + - (order == null ? 0 : order.hashCode); + // ignore: unnecessary_parenthesis + (label == null ? 0 : label!.hashCode) + + (isGood == null ? 0 : isGood!.hashCode) + + (order == null ? 0 : order!.hashCode); @override String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]'; Map toJson() { - final json = {}; + final _json = {}; if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; } if (isGood != null) { - json[r'isGood'] = isGood; + _json[r'isGood'] = isGood; } if (order != null) { - json[r'order'] = order; + _json[r'order'] = order; } - return json; + return _json; } /// Returns a new [ResponseDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ResponseDTO fromJson(Map json) => json == null - ? null - : ResponseDTO( - label: TranslationDTO.listFromJson(json[r'label']), - isGood: json[r'isGood'], - order: json[r'order'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ResponseDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ResponseDTO.fromJson(v)).toList(growable: true == growable); + // 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 "ResponseDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ResponseDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ResponseDTO( + label: TranslationDTO.listFromJson(json[r'label']) ?? const [], + isGood: mapValueOfType(json, r'isGood'), + order: mapValueOfType(json, r'order'), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ResponseDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = ResponseDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ResponseDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ResponseDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = ResponseDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ResponseDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/section_dto.dart b/manager_api/lib/model/section_dto.dart index 7d29c5e..eea0ebf 100644 --- a/manager_api/lib/model/section_dto.dart +++ b/manager_api/lib/model/section_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -14,8 +15,8 @@ class SectionDTO { SectionDTO({ this.id, this.label, - this.title, - this.description, + this.title = const [], + this.description = const [], this.imageId, this.imageSource, this.configurationId, @@ -25,33 +26,81 @@ class SectionDTO { this.data, this.dateCreation, this.order, + this.instanceId, + this.latitude, + this.longitude, + this.meterZoneGPS, + this.isBeacon, + this.beaconId, }); - String id; + String? id; - String label; + String? label; - List title; + List? title; - List description; + List? description; - String imageId; + String? imageId; - String imageSource; + String? imageSource; - String configurationId; + String? configurationId; - bool isSubSection; + /// + /// 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; + String? parentId; - SectionType type; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + SectionType? type; - String data; + String? data; - 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. + /// + DateTime? dateCreation; - 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. + /// + 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; + + String? beaconId; @override bool operator ==(Object other) => identical(this, other) || other is SectionDTO && @@ -67,115 +116,189 @@ class SectionDTO { other.type == type && other.data == data && other.dateCreation == dateCreation && - other.order == order; + other.order == order && + other.instanceId == instanceId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS && + other.isBeacon == isBeacon && + other.beaconId == beaconId; @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (label == null ? 0 : label.hashCode) + - (title == null ? 0 : title.hashCode) + - (description == null ? 0 : description.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) + - (data == null ? 0 : data.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode) + - (order == null ? 0 : order.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.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) + + (data == null ? 0 : data!.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); @override - String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order]'; + String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; } if (title != null) { - json[r'title'] = title; + _json[r'title'] = title; } if (description != null) { - json[r'description'] = description; + _json[r'description'] = description; } if (imageId != null) { - json[r'imageId'] = imageId; + _json[r'imageId'] = imageId; } if (imageSource != null) { - json[r'imageSource'] = imageSource; + _json[r'imageSource'] = imageSource; } if (configurationId != null) { - json[r'configurationId'] = configurationId; + _json[r'configurationId'] = configurationId; } if (isSubSection != null) { - json[r'isSubSection'] = isSubSection; + _json[r'isSubSection'] = isSubSection; } if (parentId != null) { - json[r'parentId'] = parentId; + _json[r'parentId'] = parentId; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (data != null) { - json[r'data'] = data; + _json[r'data'] = data; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } if (order != null) { - json[r'order'] = order; + _json[r'order'] = order; } - return json; + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } + if (latitude != null) { + _json[r'latitude'] = latitude; + } + if (longitude != null) { + _json[r'longitude'] = longitude; + } + if (meterZoneGPS != null) { + _json[r'meterZoneGPS'] = meterZoneGPS; + } + if (isBeacon != null) { + _json[r'isBeacon'] = isBeacon; + } + if (beaconId != null) { + _json[r'beaconId'] = beaconId; + } + return _json; } /// Returns a new [SectionDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static SectionDTO fromJson(Map json) => json == null - ? null - : SectionDTO( - id: json[r'id'], - label: json[r'label'], - title: TranslationDTO.listFromJson(json[r'title']), - description: TranslationDTO.listFromJson(json[r'description']), - imageId: json[r'imageId'], - imageSource: json[r'imageSource'], - configurationId: json[r'configurationId'], - isSubSection: json[r'isSubSection'], - parentId: json[r'parentId'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionDTO? 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 "SectionDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SectionDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionDTO( + id: mapValueOfType(json, r'id'), + label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + description: TranslationDTO.listFromJson(json[r'description']) ?? const [], + 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']), - data: json[r'data'], - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - order: json[r'order'], - ); + data: mapValueOfType(json, r'data'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + 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'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => SectionDTO.fromJson(v)).toList(growable: true == growable); + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } - static Map mapFromJson(Map json) { + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = SectionDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of SectionDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = SectionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/section_type.dart b/manager_api/lib/model/section_type.dart index 4d6cbc2..a2e2985 100644 --- a/manager_api/lib/model/section_type.dart +++ b/manager_api/lib/model/section_type.dart @@ -1,33 +1,35 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; - +/// 0 = Map 1 = Slider 2 = Video 3 = Web 4 = Menu 5 = Quizz 6 = Article class SectionType { /// Instantiate a new enum with the provided [value]. const SectionType._(this.value); /// The underlying value of this enum member. - final String value; + final int value; @override - String toString() => value; + String toString() => value.toString(); - String toJson() => value; + int toJson() => value; - static const map = SectionType._(r'Map'); - static const slider = SectionType._(r'Slider'); - static const video = SectionType._(r'Video'); - static const web = SectionType._(r'Web'); - static const menu = SectionType._(r'Menu'); - static const quizz = SectionType._(r'Quizz'); + static const map = SectionType._(0); + static const slider = SectionType._(1); + static const video = SectionType._(2); + static const web = SectionType._(3); + static const menu = SectionType._(4); + static const quizz = SectionType._(5); + static const article = SectionType._(6); /// List of all possible values in this [enum][SectionType]. static const values = [ @@ -37,27 +39,33 @@ class SectionType { web, menu, quizz, + article, ]; - static SectionType fromJson(dynamic value) => - SectionTypeTypeTransformer().decode(value); + static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => SectionType.fromJson(value)) - .toList(growable: true == growable); + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } -/// Transformation class that can [encode] an instance of [SectionType] to String, +/// Transformation class that can [encode] an instance of [SectionType] to int, /// and [decode] dynamic data back to [SectionType]. class SectionTypeTypeTransformer { + factory SectionTypeTypeTransformer() => _instance ??= const SectionTypeTypeTransformer._(); + const SectionTypeTypeTransformer._(); - factory SectionTypeTypeTransformer() => _instance ??= SectionTypeTypeTransformer._(); - - String encode(SectionType data) => data.value; + int encode(SectionType data) => data.value; /// Decodes a [dynamic value][data] to a SectionType. /// @@ -67,22 +75,26 @@ class SectionTypeTypeTransformer { /// /// 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. - SectionType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Map': return SectionType.map; - case r'Slider': return SectionType.slider; - case r'Video': return SectionType.video; - case r'Web': return SectionType.web; - case r'Menu': return SectionType.menu; - case r'Quizz': return SectionType.quizz; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + SectionType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'map': return SectionType.map; + case r'slider': return SectionType.slider; + case r'video': return SectionType.video; + case r'web': return SectionType.web; + case r'menu': return SectionType.menu; + case r'quizz': return SectionType.quizz; + case r'article': return SectionType.article; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [SectionTypeTypeTransformer] instance. - static SectionTypeTypeTransformer _instance; + static SectionTypeTypeTransformer? _instance; } + diff --git a/manager_api/lib/model/slider_dto.dart b/manager_api/lib/model/slider_dto.dart index fd714c7..f6ab5ec 100644 --- a/manager_api/lib/model/slider_dto.dart +++ b/manager_api/lib/model/slider_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -12,10 +13,10 @@ part of openapi.api; class SliderDTO { /// Returns a new [SliderDTO] instance. SliderDTO({ - this.images, + this.images = const [], }); - List images; + List? images; @override bool operator ==(Object other) => identical(this, other) || other is SliderDTO && @@ -23,49 +24,89 @@ class SliderDTO { @override int get hashCode => - (images == null ? 0 : images.hashCode); + // ignore: unnecessary_parenthesis + (images == null ? 0 : images!.hashCode); @override String toString() => 'SliderDTO[images=$images]'; Map toJson() { - final json = {}; + final _json = {}; if (images != null) { - json[r'images'] = images; + _json[r'images'] = images; } - return json; + return _json; } /// Returns a new [SliderDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static SliderDTO fromJson(Map json) => json == null - ? null - : SliderDTO( - images: ImageDTO.listFromJson(json[r'images']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SliderDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => SliderDTO.fromJson(v)).toList(growable: true == growable); + // 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 "SliderDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SliderDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return SliderDTO( + images: ImageDTO.listFromJson(json[r'images']) ?? 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 = SliderDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = SliderDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SliderDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of SliderDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = SliderDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SliderDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/token_dto.dart b/manager_api/lib/model/token_dto.dart index 5ef4e57..5f89ba2 100644 --- a/manager_api/lib/model/token_dto.dart +++ b/manager_api/lib/model/token_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -18,19 +19,34 @@ class TokenDTO { this.tokenType, this.expiresIn, this.expiration, + this.instanceId, }); - String accessToken; + String? accessToken; - String refreshToken; + String? refreshToken; - String scope; + String? scope; - String tokenType; + String? tokenType; - int expiresIn; + /// + /// 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? expiresIn; - DateTime expiration; + /// + /// 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? expiration; + + String? instanceId; @override bool operator ==(Object other) => identical(this, other) || other is TokenDTO && @@ -39,80 +55,124 @@ class TokenDTO { other.scope == scope && other.tokenType == tokenType && other.expiresIn == expiresIn && - other.expiration == expiration; + other.expiration == expiration && + other.instanceId == instanceId; @override int get hashCode => - (accessToken == null ? 0 : accessToken.hashCode) + - (refreshToken == null ? 0 : refreshToken.hashCode) + - (scope == null ? 0 : scope.hashCode) + - (tokenType == null ? 0 : tokenType.hashCode) + - (expiresIn == null ? 0 : expiresIn.hashCode) + - (expiration == null ? 0 : expiration.hashCode); + // ignore: unnecessary_parenthesis + (accessToken == null ? 0 : accessToken!.hashCode) + + (refreshToken == null ? 0 : refreshToken!.hashCode) + + (scope == null ? 0 : scope!.hashCode) + + (tokenType == null ? 0 : tokenType!.hashCode) + + (expiresIn == null ? 0 : expiresIn!.hashCode) + + (expiration == null ? 0 : expiration!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration]'; + String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId]'; Map toJson() { - final json = {}; + final _json = {}; if (accessToken != null) { - json[r'access_token'] = accessToken; + _json[r'access_token'] = accessToken; } if (refreshToken != null) { - json[r'refresh_token'] = refreshToken; + _json[r'refresh_token'] = refreshToken; } if (scope != null) { - json[r'scope'] = scope; + _json[r'scope'] = scope; } if (tokenType != null) { - json[r'token_type'] = tokenType; + _json[r'token_type'] = tokenType; } if (expiresIn != null) { - json[r'expires_in'] = expiresIn; + _json[r'expires_in'] = expiresIn; } if (expiration != null) { - json[r'expiration'] = expiration.toUtc().toIso8601String(); + _json[r'expiration'] = expiration!.toUtc().toIso8601String(); } - return json; + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } + return _json; } /// Returns a new [TokenDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static TokenDTO fromJson(Map json) => json == null - ? null - : TokenDTO( - accessToken: json[r'access_token'], - refreshToken: json[r'refresh_token'], - scope: json[r'scope'], - tokenType: json[r'token_type'], - expiresIn: json[r'expires_in'], - expiration: json[r'expiration'] == null - ? null - : DateTime.parse(json[r'expiration']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TokenDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => TokenDTO.fromJson(v)).toList(growable: true == growable); + // 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 "TokenDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "TokenDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return TokenDTO( + accessToken: mapValueOfType(json, r'access_token'), + refreshToken: mapValueOfType(json, r'refresh_token'), + scope: mapValueOfType(json, r'scope'), + tokenType: mapValueOfType(json, r'token_type'), + expiresIn: mapValueOfType(json, r'expires_in'), + expiration: mapDateTime(json, r'expiration', ''), + instanceId: mapValueOfType(json, r'instanceId'), + ); + } + 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 = TokenDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = TokenDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TokenDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of TokenDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = TokenDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TokenDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/translation_dto.dart b/manager_api/lib/model/translation_dto.dart index 186d9c1..bc4c2da 100644 --- a/manager_api/lib/model/translation_dto.dart +++ b/manager_api/lib/model/translation_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -16,9 +17,9 @@ class TranslationDTO { this.value, }); - String language; + String? language; - String value; + String? value; @override bool operator ==(Object other) => identical(this, other) || other is TranslationDTO && @@ -27,54 +28,94 @@ class TranslationDTO { @override int get hashCode => - (language == null ? 0 : language.hashCode) + - (value == null ? 0 : value.hashCode); + // ignore: unnecessary_parenthesis + (language == null ? 0 : language!.hashCode) + + (value == null ? 0 : value!.hashCode); @override String toString() => 'TranslationDTO[language=$language, value=$value]'; Map toJson() { - final json = {}; + final _json = {}; if (language != null) { - json[r'language'] = language; + _json[r'language'] = language; } if (value != null) { - json[r'value'] = value; + _json[r'value'] = value; } - return json; + return _json; } /// Returns a new [TranslationDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static TranslationDTO fromJson(Map json) => json == null - ? null - : TranslationDTO( - language: json[r'language'], - value: json[r'value'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TranslationDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => TranslationDTO.fromJson(v)).toList(growable: true == growable); + // 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 "TranslationDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "TranslationDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return TranslationDTO( + language: mapValueOfType(json, r'language'), + value: mapValueOfType(json, r'value'), + ); + } + 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 = TranslationDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = TranslationDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TranslationDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of TranslationDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = TranslationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TranslationDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/user.dart b/manager_api/lib/model/user.dart index 58d6440..e50ca10 100644 --- a/manager_api/lib/model/user.dart +++ b/manager_api/lib/model/user.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -19,21 +20,30 @@ class User { this.lastName, this.token, this.dateCreation, + this.instanceId, }); - String id; + String? id; - String email; + String? email; - String password; + String? password; - String firstName; + String? firstName; - String lastName; + String? lastName; - String token; + String? token; - 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. + /// + DateTime? dateCreation; + + String? instanceId; @override bool operator ==(Object other) => identical(this, other) || other is User && @@ -43,85 +53,129 @@ class User { other.firstName == firstName && other.lastName == lastName && other.token == token && - other.dateCreation == dateCreation; + other.dateCreation == dateCreation && + other.instanceId == instanceId; @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (email == null ? 0 : email.hashCode) + - (password == null ? 0 : password.hashCode) + - (firstName == null ? 0 : firstName.hashCode) + - (lastName == null ? 0 : lastName.hashCode) + - (token == null ? 0 : token.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (email == null ? 0 : email!.hashCode) + + (password == null ? 0 : password!.hashCode) + + (firstName == null ? 0 : firstName!.hashCode) + + (lastName == null ? 0 : lastName!.hashCode) + + (token == null ? 0 : token!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation]'; + String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation, instanceId=$instanceId]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (email != null) { - json[r'email'] = email; + _json[r'email'] = email; } if (password != null) { - json[r'password'] = password; + _json[r'password'] = password; } if (firstName != null) { - json[r'firstName'] = firstName; + _json[r'firstName'] = firstName; } if (lastName != null) { - json[r'lastName'] = lastName; + _json[r'lastName'] = lastName; } if (token != null) { - json[r'token'] = token; + _json[r'token'] = token; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } - return json; + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } + return _json; } /// Returns a new [User] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static User fromJson(Map json) => json == null - ? null - : User( - id: json[r'id'], - email: json[r'email'], - password: json[r'password'], - firstName: json[r'firstName'], - lastName: json[r'lastName'], - token: json[r'token'], - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static User? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => User.fromJson(v)).toList(growable: true == growable); + // 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 "User[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "User[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return User( + id: mapValueOfType(json, r'id'), + email: mapValueOfType(json, r'email'), + password: mapValueOfType(json, r'password'), + firstName: mapValueOfType(json, r'firstName'), + lastName: mapValueOfType(json, r'lastName'), + token: mapValueOfType(json, r'token'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + instanceId: mapValueOfType(json, r'instanceId'), + ); + } + 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 = User.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = User.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = User.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of User-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = User.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = User.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/user_detail_dto.dart b/manager_api/lib/model/user_detail_dto.dart index 0b67418..33727ba 100644 --- a/manager_api/lib/model/user_detail_dto.dart +++ b/manager_api/lib/model/user_detail_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -18,13 +19,13 @@ class UserDetailDTO { this.lastName, }); - String id; + String? id; - String email; + String? email; - String firstName; + String? firstName; - String lastName; + String? lastName; @override bool operator ==(Object other) => identical(this, other) || other is UserDetailDTO && @@ -35,64 +36,104 @@ class UserDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (email == null ? 0 : email.hashCode) + - (firstName == null ? 0 : firstName.hashCode) + - (lastName == null ? 0 : lastName.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (email == null ? 0 : email!.hashCode) + + (firstName == null ? 0 : firstName!.hashCode) + + (lastName == null ? 0 : lastName!.hashCode); @override String toString() => 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (email != null) { - json[r'email'] = email; + _json[r'email'] = email; } if (firstName != null) { - json[r'firstName'] = firstName; + _json[r'firstName'] = firstName; } if (lastName != null) { - json[r'lastName'] = lastName; + _json[r'lastName'] = lastName; } - return json; + return _json; } /// Returns a new [UserDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static UserDetailDTO fromJson(Map json) => json == null - ? null - : UserDetailDTO( - id: json[r'id'], - email: json[r'email'], - firstName: json[r'firstName'], - lastName: json[r'lastName'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static UserDetailDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => UserDetailDTO.fromJson(v)).toList(growable: true == growable); + // 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 "UserDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "UserDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return UserDetailDTO( + id: mapValueOfType(json, r'id'), + email: mapValueOfType(json, r'email'), + firstName: mapValueOfType(json, r'firstName'), + lastName: mapValueOfType(json, r'lastName'), + ); + } + 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 = UserDetailDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = UserDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UserDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of UserDetailDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = UserDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UserDetailDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/video_dto.dart b/manager_api/lib/model/video_dto.dart index 339d04b..49bceae 100644 --- a/manager_api/lib/model/video_dto.dart +++ b/manager_api/lib/model/video_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -15,7 +16,7 @@ class VideoDTO { this.source_, }); - String source_; + String? source_; @override bool operator ==(Object other) => identical(this, other) || other is VideoDTO && @@ -23,49 +24,89 @@ class VideoDTO { @override int get hashCode => - (source_ == null ? 0 : source_.hashCode); + // ignore: unnecessary_parenthesis + (source_ == null ? 0 : source_!.hashCode); @override String toString() => 'VideoDTO[source_=$source_]'; Map toJson() { - final json = {}; + final _json = {}; if (source_ != null) { - json[r'source'] = source_; + _json[r'source'] = source_; } - return json; + return _json; } /// Returns a new [VideoDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static VideoDTO fromJson(Map json) => json == null - ? null - : VideoDTO( - source_: json[r'source'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static VideoDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => VideoDTO.fromJson(v)).toList(growable: true == growable); + // 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 "VideoDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "VideoDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return VideoDTO( + source_: mapValueOfType(json, r'source'), + ); + } + 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 = VideoDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = VideoDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = VideoDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of VideoDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = VideoDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = VideoDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/lib/model/web_dto.dart b/manager_api/lib/model/web_dto.dart index 5dc905b..f5d6fa7 100644 --- a/manager_api/lib/model/web_dto.dart +++ b/manager_api/lib/model/web_dto.dart @@ -1,10 +1,11 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; @@ -15,7 +16,7 @@ class WebDTO { this.source_, }); - String source_; + String? source_; @override bool operator ==(Object other) => identical(this, other) || other is WebDTO && @@ -23,49 +24,89 @@ class WebDTO { @override int get hashCode => - (source_ == null ? 0 : source_.hashCode); + // ignore: unnecessary_parenthesis + (source_ == null ? 0 : source_!.hashCode); @override String toString() => 'WebDTO[source_=$source_]'; Map toJson() { - final json = {}; + final _json = {}; if (source_ != null) { - json[r'source'] = source_; + _json[r'source'] = source_; } - return json; + return _json; } /// Returns a new [WebDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static WebDTO fromJson(Map json) => json == null - ? null - : WebDTO( - source_: json[r'source'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static WebDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => WebDTO.fromJson(v)).toList(growable: true == growable); + // 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 "WebDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "WebDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return WebDTO( + source_: mapValueOfType(json, r'source'), + ); + } + 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 = WebDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { final map = {}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) => map[key] = WebDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = WebDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of WebDTO-objects as value to a dart map - static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic v) { - map[key] = WebDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); - }); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = WebDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } } return map; } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; } diff --git a/manager_api/pubspec.lock b/manager_api/pubspec.lock new file mode 100644 index 0000000..6796c53 --- /dev/null +++ b/manager_api/pubspec.lock @@ -0,0 +1,405 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "4826f97faae3af9761f26c52e56b2aa5ffd18d2c1721d984ad85137721c25f43" + url: "https://pub.dev" + source: hosted + version: "31.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "7337610c3f9cd13e6b7c6bb0f410644091cf63c9a1436e73352a70f3286abb03" + url: "https://pub.dev" + source: hosted + version: "2.8.0" + args: + dependency: transitive + description: + name: args + sha256: "139d809800a412ebb26a3892da228b2d0ba36f0ef5d9a82166e5e52ec8d61611" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + async: + dependency: transitive + description: + name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + url: "https://pub.dev" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" + source: hosted + version: "1.17.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + coverage: + dependency: transitive + description: + name: coverage + sha256: ad538fa2e8f6b828d54c04a438af816ce814de404690136d3b9dfb3a436cd01c + url: "https://pub.dev" + source: hosted + version: "1.0.3" + crypto: + dependency: transitive + description: + name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" + source: hosted + version: "3.0.2" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + glob: + dependency: transitive + description: + name: glob + sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + http: + dependency: "direct main" + description: + name: http + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" + source: hosted + version: "0.13.5" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: "323b7c70073cccf6b9b8d8b334be418a3293cfb612a560dc2737160a37bf61bd" + url: "https://pub.dev" + source: hosted + version: "0.6.6" + logging: + dependency: transitive + description: + name: logging + sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946 + url: "https://pub.dev" + source: hosted + version: "1.1.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: "2e2c34e631f93410daa3ee3410250eadc77ac6befc02a040eda8a123f34e6f5a" + url: "https://pub.dev" + source: hosted + version: "0.12.11" + meta: + dependency: "direct main" + description: + name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + pedantic: + dependency: transitive + description: + name: pedantic + sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + shelf: + dependency: transitive + description: + name: shelf + sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + url: "https://pub.dev" + source: hosted + version: "1.4.0" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 + url: "https://pub.dev" + source: hosted + version: "3.0.1" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + url: "https://pub.dev" + source: hosted + version: "1.1.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "490098075234dcedb83c5d949b4c93dad5e6b7702748de000be2b57b8e6b2427" + url: "https://pub.dev" + source: hosted + version: "0.10.11" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: "direct dev" + description: + name: test + sha256: d8df85e0659006d6dd09dd5d1d4bf81848d34fbe5b1fdd2b2a90e690aaa8195e + url: "https://pub.dev" + source: hosted + version: "1.17.12" + test_api: + dependency: transitive + description: + name: test_api + sha256: "3c3c3eb64242eec8aeb7a7e530cd541737a84bb01fc08b363b429aaa4a91060d" + url: "https://pub.dev" + source: hosted + version: "0.4.3" + test_core: + dependency: transitive + description: + name: test_core + sha256: f269e59fdd3abd14d6d92d3da9a03f69e931e9dd9140d6f06f94fc2204584741 + url: "https://pub.dev" + source: hosted + version: "0.4.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "35ef1bbae978d7158e09c98dcdfe8673b58a30eb53e82833cc027e0aab2d5213" + url: "https://pub.dev" + source: hosted + version: "7.5.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b + url: "https://pub.dev" + source: hosted + version: "2.3.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" + source: hosted + version: "3.1.1" +sdks: + dart: ">=2.19.0-345.0.dev <4.0.0" diff --git a/manager_api/pubspec.yaml b/manager_api/pubspec.yaml index 8a6a2bc..67848de 100644 --- a/manager_api/pubspec.yaml +++ b/manager_api/pubspec.yaml @@ -2,19 +2,15 @@ # AUTO-GENERATED FILE, DO NOT MODIFY! # -name: 'managerapi' +name: 'manager_api' version: '1.0.0' description: 'OpenAPI API client' -authors: - - 'Author ' homepage: 'homepage' environment: - sdk: '>=2.0.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - http: '>=0.12.0 <0.13.0' - intl: '^0.16.1' + http: '>=0.13.0 <0.14.0' + intl: '^0.17.0' meta: '^1.1.8' - dev_dependencies: - test: '>=1.3.0 <1.16.0' - + test: '>=1.16.0 <1.18.0' diff --git a/manager_api/test/article_dto_test.dart b/manager_api/test/article_dto_test.dart new file mode 100644 index 0000000..7be3235 --- /dev/null +++ b/manager_api/test/article_dto_test.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for ArticleDTO +void main() { + // final instance = ArticleDTO(); + + group('test ArticleDTO', () { + // List content (default value: const []) + test('to test the property `content`', () async { + // TODO + }); + + // bool isContentTop + test('to test the property `isContentTop`', () async { + // TODO + }); + + // List audioIds (default value: const []) + test('to test the property `audioIds`', () async { + // TODO + }); + + // bool isReadAudioAuto + test('to test the property `isReadAudioAuto`', () async { + // TODO + }); + + // List images (default value: const []) + test('to test the property `images`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/authentication_api_test.dart b/manager_api/test/authentication_api_test.dart index 36facc7..ef083f1 100644 --- a/manager_api/test/authentication_api_test.dart +++ b/manager_api/test/authentication_api_test.dart @@ -1,19 +1,20 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; /// tests for AuthenticationApi void main() { - final instance = AuthenticationApi(); + // final instance = AuthenticationApi(); group('tests for AuthenticationApi', () { //Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async diff --git a/manager_api/test/configuration_api_test.dart b/manager_api/test/configuration_api_test.dart index 66671d7..4844853 100644 --- a/manager_api/test/configuration_api_test.dart +++ b/manager_api/test/configuration_api_test.dart @@ -1,19 +1,20 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; /// tests for ConfigurationApi void main() { - final instance = ConfigurationApi(); + // final instance = ConfigurationApi(); group('tests for ConfigurationApi', () { //Future configurationCreate(ConfigurationDTO configurationDTO) async @@ -26,7 +27,12 @@ void main() { // TODO }); - //Future> configurationGet() async + //Future configurationExport(String id) async + test('test configurationExport', () async { + // TODO + }); + + //Future> configurationGet({ String instanceId }) async test('test configurationGet', () async { // TODO }); @@ -36,6 +42,11 @@ void main() { // TODO }); + //Future configurationImport(ExportConfigurationDTO exportConfigurationDTO) async + test('test configurationImport', () async { + // TODO + }); + //Future configurationUpdate(ConfigurationDTO configurationDTO) async test('test configurationUpdate', () async { // TODO diff --git a/manager_api/test/configuration_dto_test.dart b/manager_api/test/configuration_dto_test.dart index 083682b..5c4461f 100644 --- a/manager_api/test/configuration_dto_test.dart +++ b/manager_api/test/configuration_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ConfigurationDTO void main() { - final instance = ConfigurationDTO(); + // final instance = ConfigurationDTO(); group('test ConfigurationDTO', () { // String id @@ -25,6 +26,21 @@ void main() { // TODO }); + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + // String primaryColor test('to test the property `primaryColor`', () async { // TODO @@ -45,6 +61,26 @@ void main() { // TODO }); + // bool isMobile + test('to test the property `isMobile`', () async { + // TODO + }); + + // bool isTablet + test('to test the property `isTablet`', () async { + // TODO + }); + + // bool isOffline + test('to test the property `isOffline`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + }); diff --git a/manager_api/test/device_api_test.dart b/manager_api/test/device_api_test.dart index d9267a1..acdb174 100644 --- a/manager_api/test/device_api_test.dart +++ b/manager_api/test/device_api_test.dart @@ -1,19 +1,20 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; /// tests for DeviceApi void main() { - final instance = DeviceApi(); + // final instance = DeviceApi(); group('tests for DeviceApi', () { //Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async @@ -26,7 +27,7 @@ void main() { // TODO }); - //Future> deviceGet() async + //Future> deviceGet({ String instanceId }) async test('test deviceGet', () async { // TODO }); diff --git a/manager_api/test/device_detail_dto_all_of_test.dart b/manager_api/test/device_detail_dto_all_of_test.dart index 52e846c..9839d16 100644 --- a/manager_api/test/device_detail_dto_all_of_test.dart +++ b/manager_api/test/device_detail_dto_all_of_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceDetailDTOAllOf void main() { - final instance = DeviceDetailDTOAllOf(); + // final instance = DeviceDetailDTOAllOf(); group('test DeviceDetailDTOAllOf', () { // String connectionLevel diff --git a/manager_api/test/device_detail_dto_test.dart b/manager_api/test/device_detail_dto_test.dart index 6ad6492..9732639 100644 --- a/manager_api/test/device_detail_dto_test.dart +++ b/manager_api/test/device_detail_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceDetailDTO void main() { - final instance = DeviceDetailDTO(); + // final instance = DeviceDetailDTO(); group('test DeviceDetailDTO', () { // String id @@ -20,13 +21,23 @@ void main() { // TODO }); + // String identifier + test('to test the property `identifier`', () async { + // TODO + }); + // String name test('to test the property `name`', () async { // TODO }); - // String ipAddress - test('to test the property `ipAddress`', () async { + // String ipAddressWLAN + test('to test the property `ipAddressWLAN`', () async { + // TODO + }); + + // String ipAddressETH + test('to test the property `ipAddressETH`', () async { // TODO }); @@ -50,6 +61,16 @@ void main() { // TODO }); + // DateTime dateUpdate + test('to test the property `dateUpdate`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + // String connectionLevel test('to test the property `connectionLevel`', () async { // TODO diff --git a/manager_api/test/device_dto_test.dart b/manager_api/test/device_dto_test.dart index 6557c52..7e02aa0 100644 --- a/manager_api/test/device_dto_test.dart +++ b/manager_api/test/device_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceDTO void main() { - final instance = DeviceDTO(); + // final instance = DeviceDTO(); group('test DeviceDTO', () { // String id @@ -20,13 +21,23 @@ void main() { // TODO }); + // String identifier + test('to test the property `identifier`', () async { + // TODO + }); + // String name test('to test the property `name`', () async { // TODO }); - // String ipAddress - test('to test the property `ipAddress`', () async { + // String ipAddressWLAN + test('to test the property `ipAddressWLAN`', () async { + // TODO + }); + + // String ipAddressETH + test('to test the property `ipAddressETH`', () async { // TODO }); @@ -50,6 +61,16 @@ void main() { // TODO }); + // DateTime dateUpdate + test('to test the property `dateUpdate`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + }); diff --git a/manager_api/test/export_configuration_dto_all_of_test.dart b/manager_api/test/export_configuration_dto_all_of_test.dart index b497052..5967e3f 100644 --- a/manager_api/test/export_configuration_dto_all_of_test.dart +++ b/manager_api/test/export_configuration_dto_all_of_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ExportConfigurationDTOAllOf void main() { - final instance = ExportConfigurationDTOAllOf(); + // final instance = ExportConfigurationDTOAllOf(); group('test ExportConfigurationDTOAllOf', () { // List sections (default value: const []) diff --git a/manager_api/test/export_configuration_dto_test.dart b/manager_api/test/export_configuration_dto_test.dart index adc2fb5..222334d 100644 --- a/manager_api/test/export_configuration_dto_test.dart +++ b/manager_api/test/export_configuration_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ExportConfigurationDTO void main() { - final instance = ExportConfigurationDTO(); + // final instance = ExportConfigurationDTO(); group('test ExportConfigurationDTO', () { // String id @@ -25,6 +26,21 @@ void main() { // TODO }); + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + // String primaryColor test('to test the property `primaryColor`', () async { // TODO @@ -45,6 +61,26 @@ void main() { // TODO }); + // bool isMobile + test('to test the property `isMobile`', () async { + // TODO + }); + + // bool isTablet + test('to test the property `isTablet`', () async { + // TODO + }); + + // bool isOffline + test('to test the property `isOffline`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + // List sections (default value: const []) test('to test the property `sections`', () async { // TODO diff --git a/manager_api/test/geo_point_dto_test.dart b/manager_api/test/geo_point_dto_test.dart index e274af9..b04737e 100644 --- a/manager_api/test/geo_point_dto_test.dart +++ b/manager_api/test/geo_point_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for GeoPointDTO void main() { - final instance = GeoPointDTO(); + // final instance = GeoPointDTO(); group('test GeoPointDTO', () { // int id diff --git a/manager_api/test/image_dto_test.dart b/manager_api/test/image_dto_test.dart index 3d051c5..01be4eb 100644 --- a/manager_api/test/image_dto_test.dart +++ b/manager_api/test/image_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ImageDTO void main() { - final instance = ImageDTO(); + // final instance = ImageDTO(); group('test ImageDTO', () { // List title (default value: const []) diff --git a/manager_api/test/image_geo_point_test.dart b/manager_api/test/image_geo_point_test.dart index 527fe9c..58988c5 100644 --- a/manager_api/test/image_geo_point_test.dart +++ b/manager_api/test/image_geo_point_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ImageGeoPoint void main() { - final instance = ImageGeoPoint(); + // final instance = ImageGeoPoint(); group('test ImageGeoPoint', () { // String imageResourceId diff --git a/manager_api/test/instance_api_test.dart b/manager_api/test/instance_api_test.dart new file mode 100644 index 0000000..d603922 --- /dev/null +++ b/manager_api/test/instance_api_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + + +/// tests for InstanceApi +void main() { + // final instance = InstanceApi(); + + group('tests for InstanceApi', () { + //Future instanceCreateInstance(Instance instance) async + test('test instanceCreateInstance', () async { + // TODO + }); + + //Future instanceDeleteInstance(String id) async + test('test instanceDeleteInstance', () async { + // TODO + }); + + //Future> instanceGet() async + test('test instanceGet', () async { + // TODO + }); + + //Future instanceGetDetail(String id) async + test('test instanceGetDetail', () async { + // TODO + }); + + //Future instanceUpdateinstance(Instance instance) async + test('test instanceUpdateinstance', () async { + // TODO + }); + + }); +} diff --git a/manager_api/test/instance_dto_test.dart b/manager_api/test/instance_dto_test.dart new file mode 100644 index 0000000..e8c6878 --- /dev/null +++ b/manager_api/test/instance_dto_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for InstanceDTO +void main() { + // final instance = InstanceDTO(); + + group('test InstanceDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/instance_test.dart b/manager_api/test/instance_test.dart new file mode 100644 index 0000000..9133f85 --- /dev/null +++ b/manager_api/test/instance_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for Instance +void main() { + // final instance = Instance(); + + group('test Instance', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/level_dto_test.dart b/manager_api/test/level_dto_test.dart index 9120f3b..b75bfe3 100644 --- a/manager_api/test/level_dto_test.dart +++ b/manager_api/test/level_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for LevelDTO void main() { - final instance = LevelDTO(); + // final instance = LevelDTO(); group('test LevelDTO', () { // List label (default value: const []) diff --git a/manager_api/test/login_dto_test.dart b/manager_api/test/login_dto_test.dart index b313772..cc59980 100644 --- a/manager_api/test/login_dto_test.dart +++ b/manager_api/test/login_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for LoginDTO void main() { - final instance = LoginDTO(); + // final instance = LoginDTO(); group('test LoginDTO', () { // String email diff --git a/manager_api/test/map_dto_test.dart b/manager_api/test/map_dto_test.dart index 5775d96..6045184 100644 --- a/manager_api/test/map_dto_test.dart +++ b/manager_api/test/map_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for MapDTO void main() { - final instance = MapDTO(); + // final instance = MapDTO(); group('test MapDTO', () { // int zoom @@ -20,7 +21,7 @@ void main() { // TODO }); - // MapType mapType + // MapTypeApp mapType test('to test the property `mapType`', () async { // TODO }); diff --git a/manager_api/test/map_type_app_test.dart b/manager_api/test/map_type_app_test.dart index 4145313..891c231 100644 --- a/manager_api/test/map_type_app_test.dart +++ b/manager_api/test/map_type_app_test.dart @@ -1,13 +1,14 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for MapTypeApp diff --git a/manager_api/test/menu_dto_test.dart b/manager_api/test/menu_dto_test.dart index 9414c07..a1233e6 100644 --- a/manager_api/test/menu_dto_test.dart +++ b/manager_api/test/menu_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for MenuDTO void main() { - final instance = MenuDTO(); + // final instance = MenuDTO(); group('test MenuDTO', () { // List sections (default value: const []) diff --git a/manager_api/test/player_message_dto_test.dart b/manager_api/test/player_message_dto_test.dart index 44cd9f8..08639bf 100644 --- a/manager_api/test/player_message_dto_test.dart +++ b/manager_api/test/player_message_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for PlayerMessageDTO void main() { - final instance = PlayerMessageDTO(); + // final instance = PlayerMessageDTO(); group('test PlayerMessageDTO', () { // bool configChanged @@ -20,6 +21,11 @@ void main() { // TODO }); + // bool isDeleted + test('to test the property `isDeleted`', () async { + // TODO + }); + }); diff --git a/manager_api/test/question_dto_test.dart b/manager_api/test/question_dto_test.dart index e4e2f99..6f46cbd 100644 --- a/manager_api/test/question_dto_test.dart +++ b/manager_api/test/question_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for QuestionDTO void main() { - final instance = QuestionDTO(); + // final instance = QuestionDTO(); group('test QuestionDTO', () { // List label (default value: const []) diff --git a/manager_api/test/quizz_dto_bad_level_test.dart b/manager_api/test/quizz_dto_bad_level_test.dart new file mode 100644 index 0000000..9055db6 --- /dev/null +++ b/manager_api/test/quizz_dto_bad_level_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for QuizzDTOBadLevel +void main() { + // final instance = QuizzDTOBadLevel(); + + group('test QuizzDTOBadLevel', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/quizz_dto_test.dart b/manager_api/test/quizz_dto_test.dart index e30067d..837e987 100644 --- a/manager_api/test/quizz_dto_test.dart +++ b/manager_api/test/quizz_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for QuizzDTO void main() { - final instance = QuizzDTO(); + // final instance = QuizzDTO(); group('test QuizzDTO', () { // List questions (default value: const []) @@ -20,22 +21,22 @@ void main() { // TODO }); - // OneOfLevelDTO badLevel + // QuizzDTOBadLevel badLevel test('to test the property `badLevel`', () async { // TODO }); - // OneOfLevelDTO mediumLevel + // QuizzDTOBadLevel mediumLevel test('to test the property `mediumLevel`', () async { // TODO }); - // OneOfLevelDTO goodLevel + // QuizzDTOBadLevel goodLevel test('to test the property `goodLevel`', () async { // TODO }); - // OneOfLevelDTO greatLevel + // QuizzDTOBadLevel greatLevel test('to test the property `greatLevel`', () async { // TODO }); diff --git a/manager_api/test/resource_api_test.dart b/manager_api/test/resource_api_test.dart index eade329..b28bd40 100644 --- a/manager_api/test/resource_api_test.dart +++ b/manager_api/test/resource_api_test.dart @@ -1,22 +1,23 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; /// tests for ResourceApi void main() { - final instance = ResourceApi(); + // final instance = ResourceApi(); group('tests for ResourceApi', () { - //Future resourceCreate(ResourceDetailDTO resourceDetailDTO) async + //Future resourceCreate(ResourceDTO resourceDTO) async test('test resourceCreate', () async { // TODO }); @@ -26,12 +27,12 @@ void main() { // TODO }); - //Future> resourceGet() async + //Future> resourceGet({ String instanceId, List types }) async test('test resourceGet', () async { // TODO }); - //Future resourceGetDetail(String id) async + //Future resourceGetDetail(String id) async test('test resourceGetDetail', () async { // TODO }); @@ -41,12 +42,12 @@ void main() { // TODO }); - //Future resourceUpdate(ResourceDetailDTO resourceDetailDTO) async + //Future resourceUpdate(ResourceDTO resourceDTO) async test('test resourceUpdate', () async { // TODO }); - //Future resourceUpload({ String label, String type }) async + //Future resourceUpload({ String label, String type, String instanceId }) async test('test resourceUpload', () async { // TODO }); diff --git a/manager_api/test/resource_dto_test.dart b/manager_api/test/resource_dto_test.dart index 7001e72..5943a30 100644 --- a/manager_api/test/resource_dto_test.dart +++ b/manager_api/test/resource_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ResourceDTO void main() { - final instance = ResourceDTO(); + // final instance = ResourceDTO(); group('test ResourceDTO', () { // String id @@ -35,6 +36,16 @@ void main() { // TODO }); + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + }); diff --git a/manager_api/test/resource_type_test.dart b/manager_api/test/resource_type_test.dart index d96076b..9315f53 100644 --- a/manager_api/test/resource_type_test.dart +++ b/manager_api/test/resource_type_test.dart @@ -1,13 +1,14 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ResourceType diff --git a/manager_api/test/response_dto_test.dart b/manager_api/test/response_dto_test.dart index e96de00..bb1b970 100644 --- a/manager_api/test/response_dto_test.dart +++ b/manager_api/test/response_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for ResponseDTO void main() { - final instance = ResponseDTO(); + // final instance = ResponseDTO(); group('test ResponseDTO', () { // List label (default value: const []) diff --git a/manager_api/test/section_api_test.dart b/manager_api/test/section_api_test.dart index e830b11..0d98fba 100644 --- a/manager_api/test/section_api_test.dart +++ b/manager_api/test/section_api_test.dart @@ -1,19 +1,20 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; /// tests for SectionApi void main() { - final instance = SectionApi(); + // final instance = SectionApi(); group('tests for SectionApi', () { //Future sectionCreate(SectionDTO sectionDTO) async @@ -31,7 +32,7 @@ void main() { // TODO }); - //Future> sectionGet() async + //Future> sectionGet({ String instanceId }) async test('test sectionGet', () async { // TODO }); @@ -41,6 +42,11 @@ void main() { // TODO }); + //Future sectionGetArticleDTO() async + test('test sectionGetArticleDTO', () async { + // TODO + }); + //Future sectionGetDetail(String id) async test('test sectionGetDetail', () async { // TODO @@ -61,6 +67,11 @@ void main() { // TODO }); + //Future sectionGetQuizzDTO() async + test('test sectionGetQuizzDTO', () async { + // TODO + }); + //Future sectionGetSliderDTO() async test('test sectionGetSliderDTO', () async { // TODO @@ -76,6 +87,11 @@ void main() { // TODO }); + //Future sectionPlayerMessageDTO() async + test('test sectionPlayerMessageDTO', () async { + // TODO + }); + //Future sectionUpdate(SectionDTO sectionDTO) async test('test sectionUpdate', () async { // TODO diff --git a/manager_api/test/section_dto_test.dart b/manager_api/test/section_dto_test.dart index 1bb51a7..5c6177e 100644 --- a/manager_api/test/section_dto_test.dart +++ b/manager_api/test/section_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for SectionDTO void main() { - final instance = SectionDTO(); + // final instance = SectionDTO(); group('test SectionDTO', () { // String id @@ -80,6 +81,36 @@ void main() { // TODO }); + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // int meterZoneGPS + test('to test the property `meterZoneGPS`', () async { + // TODO + }); + + // bool isBeacon + test('to test the property `isBeacon`', () async { + // TODO + }); + + // String beaconId + test('to test the property `beaconId`', () async { + // TODO + }); + }); diff --git a/manager_api/test/section_type_test.dart b/manager_api/test/section_type_test.dart index f0b8fb6..0a2e8ee 100644 --- a/manager_api/test/section_type_test.dart +++ b/manager_api/test/section_type_test.dart @@ -1,13 +1,14 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for SectionType diff --git a/manager_api/test/slider_dto_test.dart b/manager_api/test/slider_dto_test.dart index 19da350..3a67b30 100644 --- a/manager_api/test/slider_dto_test.dart +++ b/manager_api/test/slider_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for SliderDTO void main() { - final instance = SliderDTO(); + // final instance = SliderDTO(); group('test SliderDTO', () { // List images (default value: const []) diff --git a/manager_api/test/token_dto_test.dart b/manager_api/test/token_dto_test.dart index df90e8c..6b83f0b 100644 --- a/manager_api/test/token_dto_test.dart +++ b/manager_api/test/token_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for TokenDTO void main() { - final instance = TokenDTO(); + // final instance = TokenDTO(); group('test TokenDTO', () { // String accessToken @@ -45,6 +46,11 @@ void main() { // TODO }); + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + }); diff --git a/manager_api/test/translation_dto_test.dart b/manager_api/test/translation_dto_test.dart index 46f0c5e..44f45c2 100644 --- a/manager_api/test/translation_dto_test.dart +++ b/manager_api/test/translation_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for TranslationDTO void main() { - final instance = TranslationDTO(); + // final instance = TranslationDTO(); group('test TranslationDTO', () { // String language diff --git a/manager_api/test/user_api_test.dart b/manager_api/test/user_api_test.dart index 9edeebe..dd6ecc2 100644 --- a/manager_api/test/user_api_test.dart +++ b/manager_api/test/user_api_test.dart @@ -1,19 +1,20 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; /// tests for UserApi void main() { - final instance = UserApi(); + // final instance = UserApi(); group('tests for UserApi', () { //Future userCreateUser(User user) async diff --git a/manager_api/test/user_detail_dto_test.dart b/manager_api/test/user_detail_dto_test.dart index c52b019..a8b4bd9 100644 --- a/manager_api/test/user_detail_dto_test.dart +++ b/manager_api/test/user_detail_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for UserDetailDTO void main() { - final instance = UserDetailDTO(); + // final instance = UserDetailDTO(); group('test UserDetailDTO', () { // String id diff --git a/manager_api/test/user_test.dart b/manager_api/test/user_test.dart index 6b22208..a80a97d 100644 --- a/manager_api/test/user_test.dart +++ b/manager_api/test/user_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for User void main() { - final instance = User(); + // final instance = User(); group('test User', () { // String id @@ -50,6 +51,11 @@ void main() { // TODO }); + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + }); diff --git a/manager_api/test/video_dto_test.dart b/manager_api/test/video_dto_test.dart index ac0e810..298cf4d 100644 --- a/manager_api/test/video_dto_test.dart +++ b/manager_api/test/video_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for VideoDTO void main() { - final instance = VideoDTO(); + // final instance = VideoDTO(); group('test VideoDTO', () { // String source_ diff --git a/manager_api/test/web_dto_test.dart b/manager_api/test/web_dto_test.dart index cdbc614..d3b4bec 100644 --- a/manager_api/test/web_dto_test.dart +++ b/manager_api/test/web_dto_test.dart @@ -1,18 +1,19 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.0 +// @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars -import 'package:managerapi/api.dart'; +import 'package:manager_api/api.dart'; import 'package:test/test.dart'; // tests for WebDTO void main() { - final instance = WebDTO(); + // final instance = WebDTO(); group('test WebDTO', () { // String source_ diff --git a/manager_api_old/.gitignore b/manager_api_old/.gitignore new file mode 100644 index 0000000..7c28044 --- /dev/null +++ b/manager_api_old/.gitignore @@ -0,0 +1,27 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock diff --git a/manager_api_old/.openapi-generator-ignore b/manager_api_old/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/manager_api_old/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/manager_api_old/.openapi-generator/FILES b/manager_api_old/.openapi-generator/FILES new file mode 100644 index 0000000..605784e --- /dev/null +++ b/manager_api_old/.openapi-generator/FILES @@ -0,0 +1,90 @@ +.gitignore +.travis.yml +README.md +doc/AuthenticationApi.md +doc/ConfigurationApi.md +doc/ConfigurationDTO.md +doc/DeviceApi.md +doc/DeviceDTO.md +doc/DeviceDetailDTO.md +doc/DeviceDetailDTOAllOf.md +doc/ExportConfigurationDTO.md +doc/ExportConfigurationDTOAllOf.md +doc/GeoPointDTO.md +doc/ImageDTO.md +doc/ImageGeoPoint.md +doc/LevelDTO.md +doc/LoginDTO.md +doc/MapDTO.md +doc/MapTypeApp.md +doc/MenuDTO.md +doc/PlayerMessageDTO.md +doc/QuestionDTO.md +doc/QuizzDTO.md +doc/ResourceApi.md +doc/ResourceDTO.md +doc/ResourceType.md +doc/ResponseDTO.md +doc/SectionApi.md +doc/SectionDTO.md +doc/SectionType.md +doc/SliderDTO.md +doc/TokenDTO.md +doc/TranslationDTO.md +doc/User.md +doc/UserApi.md +doc/UserDetailDTO.md +doc/VideoDTO.md +doc/WebDTO.md +git_push.sh +lib/api.dart +lib/api/authentication_api.dart +lib/api/configuration_api.dart +lib/api/device_api.dart +lib/api/resource_api.dart +lib/api/section_api.dart +lib/api/user_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/configuration_dto.dart +lib/model/device_detail_dto.dart +lib/model/device_detail_dto_all_of.dart +lib/model/device_dto.dart +lib/model/export_configuration_dto.dart +lib/model/export_configuration_dto_all_of.dart +lib/model/geo_point_dto.dart +lib/model/image_dto.dart +lib/model/image_geo_point.dart +lib/model/level_dto.dart +lib/model/login_dto.dart +lib/model/map_dto.dart +lib/model/map_type_app.dart +lib/model/menu_dto.dart +lib/model/player_message_dto.dart +lib/model/question_dto.dart +lib/model/quizz_dto.dart +lib/model/resource_dto.dart +lib/model/resource_type.dart +lib/model/response_dto.dart +lib/model/section_dto.dart +lib/model/section_type.dart +lib/model/slider_dto.dart +lib/model/token_dto.dart +lib/model/translation_dto.dart +lib/model/user.dart +lib/model/user_detail_dto.dart +lib/model/video_dto.dart +lib/model/web_dto.dart +pubspec.yaml +test/export_configuration_dto_all_of_test.dart +test/export_configuration_dto_test.dart +test/level_dto_test.dart +test/question_dto_test.dart +test/quizz_dto_test.dart +test/response_dto_test.dart diff --git a/manager_api_old/.openapi-generator/VERSION b/manager_api_old/.openapi-generator/VERSION new file mode 100644 index 0000000..acf69b4 --- /dev/null +++ b/manager_api_old/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/manager_api_old/.travis.yml b/manager_api_old/.travis.yml new file mode 100644 index 0000000..1a3af66 --- /dev/null +++ b/manager_api_old/.travis.yml @@ -0,0 +1,14 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/manager_api_old/README.md b/manager_api_old/README.md new file mode 100644 index 0000000..c06ab5c --- /dev/null +++ b/manager_api_old/README.md @@ -0,0 +1,161 @@ +# managerapi +API Manager Service + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: Version Alpha +- Build package: org.openapitools.codegen.languages.DartClientCodegen + +## Requirements + +Dart 2.0 or later + +## Installation & Usage + +### Github +If this Dart package is published to Github, add the following dependency to your pubspec.yaml +``` +dependencies: + managerapi: + git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` + +### Local +To use the package in your local drive, add the following dependency to your pubspec.yaml +``` +dependencies: + managerapi: + path: /path/to/managerapi +``` + +## Tests + +TODO + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:managerapi/api.dart'; + +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AuthenticationApi(); +final grantType = grantType_example; // String | +final username = username_example; // String | +final password = password_example; // String | +final clientId = clientId_example; // String | +final clientSecret = clientSecret_example; // String | + +try { + final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret); + print(result); +} catch (e) { + print('Exception when calling AuthenticationApi->authenticationAuthenticateWithForm: $e\n'); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://192.168.31.140* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthenticationApi* | [**authenticationAuthenticateWithForm**](doc\/AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | +*AuthenticationApi* | [**authenticationAuthenticateWithJson**](doc\/AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | +*ConfigurationApi* | [**configurationCreate**](doc\/ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration | +*ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | +*ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | +*ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | +*ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | +*ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | +*ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | +*DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/Device | +*DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} | +*DeviceApi* | [**deviceGet**](doc\/DeviceApi.md#deviceget) | **GET** /api/Device | +*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | +*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | +*DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | +*ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource | +*ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | +*ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource | +*ResourceApi* | [**resourceGetDetail**](doc\/ResourceApi.md#resourcegetdetail) | **GET** /api/Resource/{id}/detail | +*ResourceApi* | [**resourceShow**](doc\/ResourceApi.md#resourceshow) | **GET** /api/Resource/{id} | +*ResourceApi* | [**resourceUpdate**](doc\/ResourceApi.md#resourceupdate) | **PUT** /api/Resource | +*ResourceApi* | [**resourceUpload**](doc\/ResourceApi.md#resourceupload) | **POST** /api/Resource/upload | +*SectionApi* | [**sectionCreate**](doc\/SectionApi.md#sectioncreate) | **POST** /api/Section | +*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | +*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | +*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | +*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | +*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | +*SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | +*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | +*SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | +*SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | +*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | +*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | +*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | +*SectionApi* | [**sectionPlayerMessageDTO**](doc\/SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO | +*SectionApi* | [**sectionUpdate**](doc\/SectionApi.md#sectionupdate) | **PUT** /api/Section | +*SectionApi* | [**sectionUpdateOrder**](doc\/SectionApi.md#sectionupdateorder) | **PUT** /api/Section/order | +*UserApi* | [**userCreateUser**](doc\/UserApi.md#usercreateuser) | **POST** /api/User | +*UserApi* | [**userDeleteUser**](doc\/UserApi.md#userdeleteuser) | **DELETE** /api/User/{id} | +*UserApi* | [**userGet**](doc\/UserApi.md#userget) | **GET** /api/User | +*UserApi* | [**userGetDetail**](doc\/UserApi.md#usergetdetail) | **GET** /api/User/{id} | +*UserApi* | [**userUpdateUser**](doc\/UserApi.md#userupdateuser) | **PUT** /api/User | + + +## Documentation For Models + + - [ConfigurationDTO](doc\/ConfigurationDTO.md) + - [DeviceDTO](doc\/DeviceDTO.md) + - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) + - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) + - [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md) + - [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md) + - [GeoPointDTO](doc\/GeoPointDTO.md) + - [ImageDTO](doc\/ImageDTO.md) + - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [LevelDTO](doc\/LevelDTO.md) + - [LoginDTO](doc\/LoginDTO.md) + - [MapDTO](doc\/MapDTO.md) + - [MapTypeApp](doc\/MapTypeApp.md) + - [MenuDTO](doc\/MenuDTO.md) + - [PlayerMessageDTO](doc\/PlayerMessageDTO.md) + - [QuestionDTO](doc\/QuestionDTO.md) + - [QuizzDTO](doc\/QuizzDTO.md) + - [ResourceDTO](doc\/ResourceDTO.md) + - [ResourceType](doc\/ResourceType.md) + - [ResponseDTO](doc\/ResponseDTO.md) + - [SectionDTO](doc\/SectionDTO.md) + - [SectionType](doc\/SectionType.md) + - [SliderDTO](doc\/SliderDTO.md) + - [TokenDTO](doc\/TokenDTO.md) + - [TranslationDTO](doc\/TranslationDTO.md) + - [User](doc\/User.md) + - [UserDetailDTO](doc\/UserDetailDTO.md) + - [VideoDTO](doc\/VideoDTO.md) + - [WebDTO](doc\/WebDTO.md) + + +## Documentation For Authorization + + +## bearer + +- **Type**: OAuth +- **Flow**: password +- **Authorization URL**: /authentication/Token +- **Scopes**: + - **Manager-api**: Manager WebAPI + + +## Author + + + + diff --git a/manager_api_old/doc/AuthenticationApi.md b/manager_api_old/doc/AuthenticationApi.md new file mode 100644 index 0000000..240d621 --- /dev/null +++ b/manager_api_old/doc/AuthenticationApi.md @@ -0,0 +1,109 @@ +# managerapi.api.AuthenticationApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authenticationAuthenticateWithForm**](AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | +[**authenticationAuthenticateWithJson**](AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | + + +# **authenticationAuthenticateWithForm** +> TokenDTO authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AuthenticationApi(); +final grantType = grantType_example; // String | +final username = username_example; // String | +final password = password_example; // String | +final clientId = clientId_example; // String | +final clientSecret = clientSecret_example; // String | + +try { + final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret); + print(result); +} catch (e) { + print('Exception when calling AuthenticationApi->authenticationAuthenticateWithForm: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **grantType** | **String**| | [optional] + **username** | **String**| | [optional] + **password** | **String**| | [optional] + **clientId** | **String**| | [optional] + **clientSecret** | **String**| | [optional] + +### Return type + +[**TokenDTO**](TokenDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **authenticationAuthenticateWithJson** +> TokenDTO authenticationAuthenticateWithJson(loginDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AuthenticationApi(); +final loginDTO = LoginDTO(); // LoginDTO | + +try { + final result = api_instance.authenticationAuthenticateWithJson(loginDTO); + print(result); +} catch (e) { + print('Exception when calling AuthenticationApi->authenticationAuthenticateWithJson: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loginDTO** | [**LoginDTO**](LoginDTO.md)| | + +### Return type + +[**TokenDTO**](TokenDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_old/doc/ConfigurationApi.md b/manager_api_old/doc/ConfigurationApi.md new file mode 100644 index 0000000..9783da9 --- /dev/null +++ b/manager_api_old/doc/ConfigurationApi.md @@ -0,0 +1,317 @@ +# managerapi.api.ConfigurationApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**configurationCreate**](ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration | +[**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | +[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | +[**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration | +[**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | +[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | +[**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | + + +# **configurationCreate** +> ConfigurationDTO configurationCreate(configurationDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); +final configurationDTO = ConfigurationDTO(); // ConfigurationDTO | + +try { + final result = api_instance.configurationCreate(configurationDTO); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **configurationDTO** | [**ConfigurationDTO**](ConfigurationDTO.md)| | + +### Return type + +[**ConfigurationDTO**](ConfigurationDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **configurationDelete** +> String configurationDelete(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); +final id = id_example; // String | + +try { + final result = api_instance.configurationDelete(id); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **configurationExport** +> ExportConfigurationDTO configurationExport(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); +final id = id_example; // String | + +try { + final result = api_instance.configurationExport(id); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationExport: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**ExportConfigurationDTO**](ExportConfigurationDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **configurationGet** +> List configurationGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); + +try { + final result = api_instance.configurationGet(); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](ConfigurationDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **configurationGetDetail** +> ConfigurationDTO configurationGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); +final id = id_example; // String | + +try { + final result = api_instance.configurationGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**ConfigurationDTO**](ConfigurationDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **configurationImport** +> String configurationImport(exportConfigurationDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); +final exportConfigurationDTO = ExportConfigurationDTO(); // ExportConfigurationDTO | + +try { + final result = api_instance.configurationImport(exportConfigurationDTO); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationImport: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exportConfigurationDTO** | [**ExportConfigurationDTO**](ExportConfigurationDTO.md)| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **configurationUpdate** +> ConfigurationDTO configurationUpdate(configurationDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ConfigurationApi(); +final configurationDTO = ConfigurationDTO(); // ConfigurationDTO | + +try { + final result = api_instance.configurationUpdate(configurationDTO); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **configurationDTO** | [**ConfigurationDTO**](ConfigurationDTO.md)| | + +### Return type + +[**ConfigurationDTO**](ConfigurationDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_old/doc/ConfigurationDTO.md b/manager_api_old/doc/ConfigurationDTO.md new file mode 100644 index 0000000..425da4d --- /dev/null +++ b/manager_api_old/doc/ConfigurationDTO.md @@ -0,0 +1,20 @@ +# managerapi.model.ConfigurationDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**label** | **String** | | [optional] +**primaryColor** | **String** | | [optional] +**secondaryColor** | **String** | | [optional] +**languages** | **List** | | [optional] [default to const []] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/DeviceApi.md b/manager_api_old/doc/DeviceApi.md new file mode 100644 index 0000000..da2f466 --- /dev/null +++ b/manager_api_old/doc/DeviceApi.md @@ -0,0 +1,273 @@ +# managerapi.api.DeviceApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/Device | +[**deviceDelete**](DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} | +[**deviceGet**](DeviceApi.md#deviceget) | **GET** /api/Device | +[**deviceGetDetail**](DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | +[**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/Device | +[**deviceUpdateMainInfos**](DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | + + +# **deviceCreate** +> DeviceDetailDTO deviceCreate(deviceDetailDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | + +try { + final result = api_instance.deviceCreate(deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceDelete** +> String deviceDelete(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final id = id_example; // String | + +try { + final result = api_instance.deviceDelete(id); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceGet** +> List deviceGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); + +try { + final result = api_instance.deviceGet(); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](DeviceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceGetDetail** +> DeviceDetailDTO deviceGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final id = id_example; // String | + +try { + final result = api_instance.deviceGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceUpdate** +> DeviceDetailDTO deviceUpdate(deviceDetailDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | + +try { + final result = api_instance.deviceUpdate(deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceUpdateMainInfos** +> DeviceDTO deviceUpdateMainInfos(deviceDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceDTO = DeviceDTO(); // DeviceDTO | + +try { + final result = api_instance.deviceUpdateMainInfos(deviceDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceUpdateMainInfos: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceDTO** | [**DeviceDTO**](DeviceDTO.md)| | + +### Return type + +[**DeviceDTO**](DeviceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_old/doc/DeviceDTO.md b/manager_api_old/doc/DeviceDTO.md new file mode 100644 index 0000000..62df565 --- /dev/null +++ b/manager_api_old/doc/DeviceDTO.md @@ -0,0 +1,24 @@ +# managerapi.model.DeviceDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**identifier** | **String** | | [optional] +**name** | **String** | | [optional] +**ipAddressWLAN** | **String** | | [optional] +**ipAddressETH** | **String** | | [optional] +**configurationId** | **String** | | [optional] +**configuration** | **String** | | [optional] +**connected** | **bool** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**dateUpdate** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/DeviceDetailDTO.md b/manager_api_old/doc/DeviceDetailDTO.md new file mode 100644 index 0000000..4968995 --- /dev/null +++ b/manager_api_old/doc/DeviceDetailDTO.md @@ -0,0 +1,28 @@ +# managerapi.model.DeviceDetailDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**identifier** | **String** | | [optional] +**name** | **String** | | [optional] +**ipAddressWLAN** | **String** | | [optional] +**ipAddressETH** | **String** | | [optional] +**configurationId** | **String** | | [optional] +**configuration** | **String** | | [optional] +**connected** | **bool** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**connectionLevel** | **String** | | [optional] +**lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] +**batteryLevel** | **String** | | [optional] +**lastBatteryLevel** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/DeviceDetailDTOAllOf.md b/manager_api_old/doc/DeviceDetailDTOAllOf.md new file mode 100644 index 0000000..0cc0886 --- /dev/null +++ b/manager_api_old/doc/DeviceDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# managerapi.model.DeviceDetailDTOAllOf + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connectionLevel** | **String** | | [optional] +**lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] +**batteryLevel** | **String** | | [optional] +**lastBatteryLevel** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/ExportConfigurationDTO.md b/manager_api_old/doc/ExportConfigurationDTO.md new file mode 100644 index 0000000..7c7c3f9 --- /dev/null +++ b/manager_api_old/doc/ExportConfigurationDTO.md @@ -0,0 +1,22 @@ +# managerapi.model.ExportConfigurationDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**label** | **String** | | [optional] +**primaryColor** | **String** | | [optional] +**secondaryColor** | **String** | | [optional] +**languages** | **List** | | [optional] [default to const []] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] +**resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/ExportConfigurationDTOAllOf.md b/manager_api_old/doc/ExportConfigurationDTOAllOf.md new file mode 100644 index 0000000..e369543 --- /dev/null +++ b/manager_api_old/doc/ExportConfigurationDTOAllOf.md @@ -0,0 +1,16 @@ +# managerapi.model.ExportConfigurationDTOAllOf + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] +**resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/GeoPointDTO.md b/manager_api_old/doc/GeoPointDTO.md new file mode 100644 index 0000000..bb5d545 --- /dev/null +++ b/manager_api_old/doc/GeoPointDTO.md @@ -0,0 +1,20 @@ +# managerapi.model.GeoPointDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**images** | [**List**](ImageGeoPoint.md) | | [optional] [default to const []] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/ImageDTO.md b/manager_api_old/doc/ImageDTO.md new file mode 100644 index 0000000..1f2c7b5 --- /dev/null +++ b/manager_api_old/doc/ImageDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.ImageDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**source_** | **String** | | [optional] +**order** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/ImageGeoPoint.md b/manager_api_old/doc/ImageGeoPoint.md new file mode 100644 index 0000000..e290427 --- /dev/null +++ b/manager_api_old/doc/ImageGeoPoint.md @@ -0,0 +1,16 @@ +# managerapi.model.ImageGeoPoint + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**imageResourceId** | **String** | | [optional] +**imageSource** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/LevelDTO.md b/manager_api_old/doc/LevelDTO.md new file mode 100644 index 0000000..af91156 --- /dev/null +++ b/manager_api_old/doc/LevelDTO.md @@ -0,0 +1,17 @@ +# managerapi.model.LevelDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/LoginDTO.md b/manager_api_old/doc/LoginDTO.md new file mode 100644 index 0000000..c5d85da --- /dev/null +++ b/manager_api_old/doc/LoginDTO.md @@ -0,0 +1,16 @@ +# managerapi.model.LoginDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] +**password** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/MapDTO.md b/manager_api_old/doc/MapDTO.md new file mode 100644 index 0000000..656bd08 --- /dev/null +++ b/manager_api_old/doc/MapDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.MapDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**zoom** | **int** | | [optional] +**mapType** | [**MapTypeApp**](MapTypeApp.md) | | [optional] +**points** | [**List**](GeoPointDTO.md) | | [optional] [default to const []] +**iconResourceId** | **String** | | [optional] +**iconSource** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/MapType.md b/manager_api_old/doc/MapType.md similarity index 100% rename from manager_api/doc/MapType.md rename to manager_api_old/doc/MapType.md diff --git a/manager_api_old/doc/MapTypeApp.md b/manager_api_old/doc/MapTypeApp.md new file mode 100644 index 0000000..4d1d1a4 --- /dev/null +++ b/manager_api_old/doc/MapTypeApp.md @@ -0,0 +1,14 @@ +# managerapi.model.MapTypeApp + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/MenuDTO.md b/manager_api_old/doc/MenuDTO.md new file mode 100644 index 0000000..960de2c --- /dev/null +++ b/manager_api_old/doc/MenuDTO.md @@ -0,0 +1,15 @@ +# managerapi.model.MenuDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/PlayerMessageDTO.md b/manager_api_old/doc/PlayerMessageDTO.md new file mode 100644 index 0000000..0f07218 --- /dev/null +++ b/manager_api_old/doc/PlayerMessageDTO.md @@ -0,0 +1,16 @@ +# managerapi.model.PlayerMessageDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**configChanged** | **bool** | | [optional] +**isDeleted** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/QuestionDTO.md b/manager_api_old/doc/QuestionDTO.md new file mode 100644 index 0000000..1827076 --- /dev/null +++ b/manager_api_old/doc/QuestionDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.QuestionDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**responses** | [**List**](ResponseDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**source_** | **String** | | [optional] +**order** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/QuizzDTO.md b/manager_api_old/doc/QuizzDTO.md new file mode 100644 index 0000000..953a3d7 --- /dev/null +++ b/manager_api_old/doc/QuizzDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.QuizzDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**questions** | [**List**](QuestionDTO.md) | | [optional] [default to const []] +**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/ResourceApi.md b/manager_api_old/doc/ResourceApi.md new file mode 100644 index 0000000..8efbe20 --- /dev/null +++ b/manager_api_old/doc/ResourceApi.md @@ -0,0 +1,319 @@ +# managerapi.api.ResourceApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**resourceCreate**](ResourceApi.md#resourcecreate) | **POST** /api/Resource | +[**resourceDelete**](ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | +[**resourceGet**](ResourceApi.md#resourceget) | **GET** /api/Resource | +[**resourceGetDetail**](ResourceApi.md#resourcegetdetail) | **GET** /api/Resource/{id}/detail | +[**resourceShow**](ResourceApi.md#resourceshow) | **GET** /api/Resource/{id} | +[**resourceUpdate**](ResourceApi.md#resourceupdate) | **PUT** /api/Resource | +[**resourceUpload**](ResourceApi.md#resourceupload) | **POST** /api/Resource/upload | + + +# **resourceCreate** +> ResourceDTO resourceCreate(resourceDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); +final resourceDTO = ResourceDTO(); // ResourceDTO | + +try { + final result = api_instance.resourceCreate(resourceDTO); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resourceDTO** | [**ResourceDTO**](ResourceDTO.md)| | + +### Return type + +[**ResourceDTO**](ResourceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resourceDelete** +> String resourceDelete(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); +final id = id_example; // String | + +try { + final result = api_instance.resourceDelete(id); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resourceGet** +> List resourceGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); + +try { + final result = api_instance.resourceGet(); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](ResourceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resourceGetDetail** +> ResourceDTO resourceGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); +final id = id_example; // String | + +try { + final result = api_instance.resourceGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**ResourceDTO**](ResourceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resourceShow** +> MultipartFile resourceShow(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); +final id = id_example; // String | + +try { + final result = api_instance.resourceShow(id); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceShow: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resourceUpdate** +> ResourceDTO resourceUpdate(resourceDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); +final resourceDTO = ResourceDTO(); // ResourceDTO | + +try { + final result = api_instance.resourceUpdate(resourceDTO); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resourceDTO** | [**ResourceDTO**](ResourceDTO.md)| | + +### Return type + +[**ResourceDTO**](ResourceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resourceUpload** +> String resourceUpload(label, type) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ResourceApi(); +final label = label_example; // String | +final type = type_example; // String | + +try { + final result = api_instance.resourceUpload(label, type); + print(result); +} catch (e) { + print('Exception when calling ResourceApi->resourceUpload: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label** | **String**| | [optional] + **type** | **String**| | [optional] + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_old/doc/ResourceDTO.md b/manager_api_old/doc/ResourceDTO.md new file mode 100644 index 0000000..d2acd16 --- /dev/null +++ b/manager_api_old/doc/ResourceDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.ResourceDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**type** | [**ResourceType**](ResourceType.md) | | [optional] +**label** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**data** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/ResourceDetailDTO.md b/manager_api_old/doc/ResourceDetailDTO.md similarity index 100% rename from manager_api/doc/ResourceDetailDTO.md rename to manager_api_old/doc/ResourceDetailDTO.md diff --git a/manager_api_old/doc/ResourceType.md b/manager_api_old/doc/ResourceType.md new file mode 100644 index 0000000..05e673f --- /dev/null +++ b/manager_api_old/doc/ResourceType.md @@ -0,0 +1,14 @@ +# managerapi.model.ResourceType + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/ResponseDTO.md b/manager_api_old/doc/ResponseDTO.md new file mode 100644 index 0000000..4b5334a --- /dev/null +++ b/manager_api_old/doc/ResponseDTO.md @@ -0,0 +1,17 @@ +# managerapi.model.ResponseDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**isGood** | **bool** | | [optional] +**order** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/SectionApi.md b/manager_api_old/doc/SectionApi.md new file mode 100644 index 0000000..0d62dd8 --- /dev/null +++ b/manager_api_old/doc/SectionApi.md @@ -0,0 +1,685 @@ +# managerapi.api.SectionApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**sectionCreate**](SectionApi.md#sectioncreate) | **POST** /api/Section | +[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | +[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | +[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | +[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | +[**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | +[**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | +[**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | +[**sectionGetMenuDTO**](SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | +[**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | +[**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | +[**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | +[**sectionGetWebDTO**](SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | +[**sectionPlayerMessageDTO**](SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO | +[**sectionUpdate**](SectionApi.md#sectionupdate) | **PUT** /api/Section | +[**sectionUpdateOrder**](SectionApi.md#sectionupdateorder) | **PUT** /api/Section/order | + + +# **sectionCreate** +> SectionDTO sectionCreate(sectionDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final sectionDTO = SectionDTO(); // SectionDTO | + +try { + final result = api_instance.sectionCreate(sectionDTO); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sectionDTO** | [**SectionDTO**](SectionDTO.md)| | + +### Return type + +[**SectionDTO**](SectionDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionDelete** +> String sectionDelete(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final id = id_example; // String | + +try { + final result = api_instance.sectionDelete(id); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionDeleteAllForConfiguration** +> String sectionDeleteAllForConfiguration(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final id = id_example; // String | + +try { + final result = api_instance.sectionDeleteAllForConfiguration(id); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionDeleteAllForConfiguration: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGet** +> List sectionGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGet(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](SectionDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetAllSectionSubSections** +> List sectionGetAllSectionSubSections(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final id = id_example; // String | + +try { + final result = api_instance.sectionGetAllSectionSubSections(id); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetAllSectionSubSections: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**List**](Object.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetDetail** +> SectionDTO sectionGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final id = id_example; // String | + +try { + final result = api_instance.sectionGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**SectionDTO**](SectionDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetFromConfiguration** +> List sectionGetFromConfiguration(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final id = id_example; // String | + +try { + final result = api_instance.sectionGetFromConfiguration(id); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetFromConfiguration: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**List**](SectionDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetMapDTO** +> MapDTO sectionGetMapDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetMapDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetMapDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**MapDTO**](MapDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetMenuDTO** +> MenuDTO sectionGetMenuDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetMenuDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetMenuDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**MenuDTO**](MenuDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetQuizzDTO** +> QuizzDTO sectionGetQuizzDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetQuizzDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetQuizzDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**QuizzDTO**](QuizzDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetSliderDTO** +> SliderDTO sectionGetSliderDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetSliderDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetSliderDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**SliderDTO**](SliderDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetVideoDTO** +> VideoDTO sectionGetVideoDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetVideoDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetVideoDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**VideoDTO**](VideoDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetWebDTO** +> WebDTO sectionGetWebDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetWebDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetWebDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebDTO**](WebDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionPlayerMessageDTO** +> PlayerMessageDTO sectionPlayerMessageDTO() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionPlayerMessageDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionPlayerMessageDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PlayerMessageDTO**](PlayerMessageDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionUpdate** +> SectionDTO sectionUpdate(sectionDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final sectionDTO = SectionDTO(); // SectionDTO | + +try { + final result = api_instance.sectionUpdate(sectionDTO); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sectionDTO** | [**SectionDTO**](SectionDTO.md)| | + +### Return type + +[**SectionDTO**](SectionDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionUpdateOrder** +> String sectionUpdateOrder(sectionDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final sectionDTO = [List()]; // List | + +try { + final result = api_instance.sectionUpdateOrder(sectionDTO); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionUpdateOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sectionDTO** | [**List**](SectionDTO.md)| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_old/doc/SectionDTO.md b/manager_api_old/doc/SectionDTO.md new file mode 100644 index 0000000..46dec96 --- /dev/null +++ b/manager_api_old/doc/SectionDTO.md @@ -0,0 +1,27 @@ +# managerapi.model.SectionDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**label** | **String** | | [optional] +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] +**configurationId** | **String** | | [optional] +**isSubSection** | **bool** | | [optional] +**parentId** | **String** | | [optional] +**type** | [**SectionType**](SectionType.md) | | [optional] +**data** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**order** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/SectionType.md b/manager_api_old/doc/SectionType.md new file mode 100644 index 0000000..c192bbd --- /dev/null +++ b/manager_api_old/doc/SectionType.md @@ -0,0 +1,14 @@ +# managerapi.model.SectionType + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/SliderDTO.md b/manager_api_old/doc/SliderDTO.md new file mode 100644 index 0000000..a5df1e8 --- /dev/null +++ b/manager_api_old/doc/SliderDTO.md @@ -0,0 +1,15 @@ +# managerapi.model.SliderDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**images** | [**List**](ImageDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/TokenDTO.md b/manager_api_old/doc/TokenDTO.md new file mode 100644 index 0000000..e031252 --- /dev/null +++ b/manager_api_old/doc/TokenDTO.md @@ -0,0 +1,20 @@ +# managerapi.model.TokenDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessToken** | **String** | | [optional] +**refreshToken** | **String** | | [optional] +**scope** | **String** | | [optional] +**tokenType** | **String** | | [optional] +**expiresIn** | **int** | | [optional] +**expiration** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/TranslationDTO.md b/manager_api_old/doc/TranslationDTO.md new file mode 100644 index 0000000..fef92bf --- /dev/null +++ b/manager_api_old/doc/TranslationDTO.md @@ -0,0 +1,16 @@ +# managerapi.model.TranslationDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language** | **String** | | [optional] +**value** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/User.md b/manager_api_old/doc/User.md new file mode 100644 index 0000000..e1f1f90 --- /dev/null +++ b/manager_api_old/doc/User.md @@ -0,0 +1,21 @@ +# managerapi.model.User + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**token** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/UserApi.md b/manager_api_old/doc/UserApi.md new file mode 100644 index 0000000..4f53b8e --- /dev/null +++ b/manager_api_old/doc/UserApi.md @@ -0,0 +1,229 @@ +# managerapi.api.UserApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**userCreateUser**](UserApi.md#usercreateuser) | **POST** /api/User | +[**userDeleteUser**](UserApi.md#userdeleteuser) | **DELETE** /api/User/{id} | +[**userGet**](UserApi.md#userget) | **GET** /api/User | +[**userGetDetail**](UserApi.md#usergetdetail) | **GET** /api/User/{id} | +[**userUpdateUser**](UserApi.md#userupdateuser) | **PUT** /api/User | + + +# **userCreateUser** +> UserDetailDTO userCreateUser(user) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final user = User(); // User | + +try { + final result = api_instance.userCreateUser(user); + print(result); +} catch (e) { + print('Exception when calling UserApi->userCreateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| | + +### Return type + +[**UserDetailDTO**](UserDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **userDeleteUser** +> String userDeleteUser(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final id = id_example; // String | + +try { + final result = api_instance.userDeleteUser(id); + print(result); +} catch (e) { + print('Exception when calling UserApi->userDeleteUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **userGet** +> List userGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); + +try { + final result = api_instance.userGet(); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](User.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **userGetDetail** +> UserDetailDTO userGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final id = id_example; // String | + +try { + final result = api_instance.userGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**UserDetailDTO**](UserDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **userUpdateUser** +> UserDetailDTO userUpdateUser(user) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final user = User(); // User | + +try { + final result = api_instance.userUpdateUser(user); + print(result); +} catch (e) { + print('Exception when calling UserApi->userUpdateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| | + +### Return type + +[**UserDetailDTO**](UserDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_old/doc/UserDetailDTO.md b/manager_api_old/doc/UserDetailDTO.md new file mode 100644 index 0000000..6b1a0e9 --- /dev/null +++ b/manager_api_old/doc/UserDetailDTO.md @@ -0,0 +1,18 @@ +# managerapi.model.UserDetailDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**email** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/VideoDTO.md b/manager_api_old/doc/VideoDTO.md new file mode 100644 index 0000000..08c8315 --- /dev/null +++ b/manager_api_old/doc/VideoDTO.md @@ -0,0 +1,15 @@ +# managerapi.model.VideoDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/doc/WebDTO.md b/manager_api_old/doc/WebDTO.md new file mode 100644 index 0000000..3b26ea1 --- /dev/null +++ b/manager_api_old/doc/WebDTO.md @@ -0,0 +1,15 @@ +# managerapi.model.WebDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_old/git_push.sh b/manager_api_old/git_push.sh new file mode 100644 index 0000000..ced3be2 --- /dev/null +++ b/manager_api_old/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/manager_api_old/lib/api.dart b/manager_api_old/lib/api.dart new file mode 100644 index 0000000..942b8c8 --- /dev/null +++ b/manager_api_old/lib/api.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +library openapi.api; + +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:http/http.dart'; +import 'package:intl/intl.dart'; + +import 'package:meta/meta.dart'; + +part 'api_client.dart'; +part 'api_helper.dart'; +part 'api_exception.dart'; +part 'auth/authentication.dart'; +part 'auth/api_key_auth.dart'; +part 'auth/oauth.dart'; +part 'auth/http_basic_auth.dart'; +part 'auth/http_bearer_auth.dart'; + +part 'api/authentication_api.dart'; +part 'api/configuration_api.dart'; +part 'api/device_api.dart'; +part 'api/resource_api.dart'; +part 'api/section_api.dart'; +part 'api/user_api.dart'; + +part 'model/configuration_dto.dart'; +part 'model/device_dto.dart'; +part 'model/device_detail_dto.dart'; +part 'model/device_detail_dto_all_of.dart'; +part 'model/export_configuration_dto.dart'; +part 'model/export_configuration_dto_all_of.dart'; +part 'model/geo_point_dto.dart'; +part 'model/image_dto.dart'; +part 'model/image_geo_point.dart'; +part 'model/level_dto.dart'; +part 'model/login_dto.dart'; +part 'model/map_dto.dart'; +part 'model/map_type_app.dart'; +part 'model/menu_dto.dart'; +part 'model/player_message_dto.dart'; +part 'model/question_dto.dart'; +part 'model/quizz_dto.dart'; +part 'model/resource_dto.dart'; +part 'model/resource_type.dart'; +part 'model/response_dto.dart'; +part 'model/section_dto.dart'; +part 'model/section_type.dart'; +part 'model/slider_dto.dart'; +part 'model/token_dto.dart'; +part 'model/translation_dto.dart'; +part 'model/user.dart'; +part 'model/user_detail_dto.dart'; +part 'model/video_dto.dart'; +part 'model/web_dto.dart'; + + +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ApiClient defaultApiClient = ApiClient(); diff --git a/manager_api_old/lib/api/authentication_api.dart b/manager_api_old/lib/api/authentication_api.dart new file mode 100644 index 0000000..8868812 --- /dev/null +++ b/manager_api_old/lib/api/authentication_api.dart @@ -0,0 +1,191 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class AuthenticationApi { + AuthenticationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Authentication/Token' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] grantType: + /// + /// * [String] username: + /// + /// * [String] password: + /// + /// * [String] clientId: + /// + /// * [String] clientSecret: + Future authenticationAuthenticateWithFormWithHttpInfo({ String grantType, String username, String password, String clientId, String clientSecret }) async { + // Verify required params are set. + + final path = r'/api/Authentication/Token'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['multipart/form-data']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (grantType != null) { + hasFields = true; + mp.fields[r'grant_type'] = parameterToString(grantType); + } + if (username != null) { + hasFields = true; + mp.fields[r'username'] = parameterToString(username); + } + if (password != null) { + hasFields = true; + mp.fields[r'password'] = parameterToString(password); + } + if (clientId != null) { + hasFields = true; + mp.fields[r'client_id'] = parameterToString(clientId); + } + if (clientSecret != null) { + hasFields = true; + mp.fields[r'client_secret'] = parameterToString(clientSecret); + } + if (hasFields) { + postBody = mp; + } + } else { + if (grantType != null) { + formParams[r'grant_type'] = parameterToString(grantType); + } + if (username != null) { + formParams[r'username'] = parameterToString(username); + } + if (password != null) { + formParams[r'password'] = parameterToString(password); + } + if (clientId != null) { + formParams[r'client_id'] = parameterToString(clientId); + } + if (clientSecret != null) { + formParams[r'client_secret'] = parameterToString(clientSecret); + } + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] grantType: + /// + /// * [String] username: + /// + /// * [String] password: + /// + /// * [String] clientId: + /// + /// * [String] clientSecret: + Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async { + final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'POST /api/Authentication/Authenticate' operation and returns the [Response]. + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + Future authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO) async { + // Verify required params are set. + if (loginDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO'); + } + + final path = r'/api/Authentication/Authenticate'; + + Object postBody = loginDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async { + final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO; + } + return Future.value(null); + } +} diff --git a/manager_api_old/lib/api/configuration_api.dart b/manager_api_old/lib/api/configuration_api.dart new file mode 100644 index 0000000..342f0f0 --- /dev/null +++ b/manager_api_old/lib/api/configuration_api.dart @@ -0,0 +1,452 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ConfigurationApi { + ConfigurationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Configuration' operation and returns the [Response]. + /// Parameters: + /// + /// * [ConfigurationDTO] configurationDTO (required): + Future configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO) async { + // Verify required params are set. + if (configurationDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO'); + } + + final path = r'/api/Configuration'; + + Object postBody = configurationDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ConfigurationDTO] configurationDTO (required): + Future configurationCreate(ConfigurationDTO configurationDTO) async { + final response = await configurationCreateWithHttpInfo(configurationDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Configuration/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future configurationDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Configuration/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future configurationDelete(String id) async { + final response = await configurationDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future configurationExportWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Configuration/{id}/export' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future configurationExport(String id) async { + final response = await configurationExportWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ExportConfigurationDTO') as ExportConfigurationDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. + Future configurationGetWithHttpInfo() async { + final path = r'/api/Configuration'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> configurationGet() async { + final response = await configurationGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future configurationGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Configuration/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future configurationGetDetail(String id) async { + final response = await configurationGetDetailWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response]. + /// Parameters: + /// + /// * [ExportConfigurationDTO] exportConfigurationDTO (required): + Future configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async { + // Verify required params are set. + if (exportConfigurationDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO'); + } + + final path = r'/api/Configuration/import'; + + Object postBody = exportConfigurationDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ExportConfigurationDTO] exportConfigurationDTO (required): + Future configurationImport(ExportConfigurationDTO exportConfigurationDTO) async { + final response = await configurationImportWithHttpInfo(exportConfigurationDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response]. + /// Parameters: + /// + /// * [ConfigurationDTO] configurationDTO (required): + Future configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO) async { + // Verify required params are set. + if (configurationDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO'); + } + + final path = r'/api/Configuration'; + + Object postBody = configurationDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ConfigurationDTO] configurationDTO (required): + Future configurationUpdate(ConfigurationDTO configurationDTO) async { + final response = await configurationUpdateWithHttpInfo(configurationDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; + } + return Future.value(null); + } +} diff --git a/manager_api_old/lib/api/device_api.dart b/manager_api_old/lib/api/device_api.dart new file mode 100644 index 0000000..7162ac9 --- /dev/null +++ b/manager_api_old/lib/api/device_api.dart @@ -0,0 +1,388 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class DeviceApi { + DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Device' operation and returns the [Response]. + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/Device'; + + Object postBody = deviceDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceCreateWithHttpInfo(deviceDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future deviceDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Device/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future deviceDelete(String id) async { + final response = await deviceDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. + Future deviceGetWithHttpInfo() async { + final path = r'/api/Device'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> deviceGet() async { + final response = await deviceGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future deviceGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Device/{id}/detail' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future deviceGetDetail(String id) async { + final response = await deviceGetDetailWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Device' operation and returns the [Response]. + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/Device'; + + Object postBody = deviceDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceUpdate(DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceUpdateWithHttpInfo(deviceDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Device/mainInfos' operation and returns the [Response]. + /// Parameters: + /// + /// * [DeviceDTO] deviceDTO (required): + Future deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO) async { + // Verify required params are set. + if (deviceDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDTO'); + } + + final path = r'/api/Device/mainInfos'; + + Object postBody = deviceDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [DeviceDTO] deviceDTO (required): + Future deviceUpdateMainInfos(DeviceDTO deviceDTO) async { + final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDTO') as DeviceDTO; + } + return Future.value(null); + } +} diff --git a/manager_api_old/lib/api/resource_api.dart b/manager_api_old/lib/api/resource_api.dart new file mode 100644 index 0000000..6423466 --- /dev/null +++ b/manager_api_old/lib/api/resource_api.dart @@ -0,0 +1,467 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ResourceApi { + ResourceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Resource' operation and returns the [Response]. + /// Parameters: + /// + /// * [ResourceDTO] resourceDTO (required): + Future resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async { + // Verify required params are set. + if (resourceDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO'); + } + + final path = r'/api/Resource'; + + Object postBody = resourceDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ResourceDTO] resourceDTO (required): + Future resourceCreate(ResourceDTO resourceDTO) async { + final response = await resourceCreateWithHttpInfo(resourceDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future resourceDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Resource/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future resourceDelete(String id) async { + final response = await resourceDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Resource' operation and returns the [Response]. + Future resourceGetWithHttpInfo() async { + final path = r'/api/Resource'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> resourceGet() async { + final response = await resourceGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Resource/{id}/detail' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future resourceGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Resource/{id}/detail' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future resourceGetDetail(String id) async { + final response = await resourceGetDetailWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future resourceShowWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Resource/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future resourceShow(String id) async { + final response = await resourceShowWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response]. + /// Parameters: + /// + /// * [ResourceDTO] resourceDTO (required): + Future resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async { + // Verify required params are set. + if (resourceDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO'); + } + + final path = r'/api/Resource'; + + Object postBody = resourceDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ResourceDTO] resourceDTO (required): + Future resourceUpdate(ResourceDTO resourceDTO) async { + final response = await resourceUpdateWithHttpInfo(resourceDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] label: + /// + /// * [String] type: + Future resourceUploadWithHttpInfo({ String label, String type }) async { + // Verify required params are set. + + final path = r'/api/Resource/upload'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['multipart/form-data']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (label != null) { + hasFields = true; + mp.fields[r'label'] = parameterToString(label); + } + if (type != null) { + hasFields = true; + mp.fields[r'type'] = parameterToString(type); + } + if (hasFields) { + postBody = mp; + } + } else { + if (label != null) { + formParams[r'label'] = parameterToString(label); + } + if (type != null) { + formParams[r'type'] = parameterToString(type); + } + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] label: + /// + /// * [String] type: + Future resourceUpload({ String label, String type }) async { + final response = await resourceUploadWithHttpInfo( label: label, type: type ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } +} diff --git a/manager_api_old/lib/api/section_api.dart b/manager_api_old/lib/api/section_api.dart new file mode 100644 index 0000000..1b2ff7f --- /dev/null +++ b/manager_api_old/lib/api/section_api.dart @@ -0,0 +1,948 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class SectionApi { + SectionApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Section' operation and returns the [Response]. + /// Parameters: + /// + /// * [SectionDTO] sectionDTO (required): + Future sectionCreateWithHttpInfo(SectionDTO sectionDTO) async { + // Verify required params are set. + if (sectionDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: sectionDTO'); + } + + final path = r'/api/Section'; + + Object postBody = sectionDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [SectionDTO] sectionDTO (required): + Future sectionCreate(SectionDTO sectionDTO) async { + final response = await sectionCreateWithHttpInfo(sectionDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Section/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future sectionDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Section/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future sectionDelete(String id) async { + final response = await sectionDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Section/configuration/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future sectionDeleteAllForConfigurationWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Section/configuration/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future sectionDeleteAllForConfiguration(String id) async { + final response = await sectionDeleteAllForConfigurationWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. + Future sectionGetWithHttpInfo() async { + final path = r'/api/Section'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> sectionGet() async { + final response = await sectionGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Section/{id}/subsections' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future sectionGetAllSectionSubSectionsWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Section/{id}/subsections' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future> sectionGetAllSectionSubSections(String id) async { + final response = await sectionGetAllSectionSubSectionsWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Section/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future sectionGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Section/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future sectionGetDetail(String id) async { + final response = await sectionGetDetailWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/configuration/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future sectionGetFromConfigurationWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Section/configuration/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future> sectionGetFromConfiguration(String id) async { + final response = await sectionGetFromConfigurationWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Section/MapDTO' operation and returns the [Response]. + Future sectionGetMapDTOWithHttpInfo() async { + final path = r'/api/Section/MapDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetMapDTO() async { + final response = await sectionGetMapDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MapDTO') as MapDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/MenuDTO' operation and returns the [Response]. + Future sectionGetMenuDTOWithHttpInfo() async { + final path = r'/api/Section/MenuDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetMenuDTO() async { + final response = await sectionGetMenuDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MenuDTO') as MenuDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response]. + Future sectionGetQuizzDTOWithHttpInfo() async { + final path = r'/api/Section/QuizzDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetQuizzDTO() async { + final response = await sectionGetQuizzDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'QuizzDTO') as QuizzDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/SliderDTO' operation and returns the [Response]. + Future sectionGetSliderDTOWithHttpInfo() async { + final path = r'/api/Section/SliderDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetSliderDTO() async { + final response = await sectionGetSliderDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'SliderDTO') as SliderDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/VideoDTO' operation and returns the [Response]. + Future sectionGetVideoDTOWithHttpInfo() async { + final path = r'/api/Section/VideoDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetVideoDTO() async { + final response = await sectionGetVideoDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'VideoDTO') as VideoDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/WebDTO' operation and returns the [Response]. + Future sectionGetWebDTOWithHttpInfo() async { + final path = r'/api/Section/WebDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetWebDTO() async { + final response = await sectionGetWebDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'WebDTO') as WebDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Section/PlayerMessageDTO' operation and returns the [Response]. + Future sectionPlayerMessageDTOWithHttpInfo() async { + final path = r'/api/Section/PlayerMessageDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionPlayerMessageDTO() async { + final response = await sectionPlayerMessageDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'PlayerMessageDTO') as PlayerMessageDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Section' operation and returns the [Response]. + /// Parameters: + /// + /// * [SectionDTO] sectionDTO (required): + Future sectionUpdateWithHttpInfo(SectionDTO sectionDTO) async { + // Verify required params are set. + if (sectionDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: sectionDTO'); + } + + final path = r'/api/Section'; + + Object postBody = sectionDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [SectionDTO] sectionDTO (required): + Future sectionUpdate(SectionDTO sectionDTO) async { + final response = await sectionUpdateWithHttpInfo(sectionDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Section/order' operation and returns the [Response]. + /// Parameters: + /// + /// * [List] sectionDTO (required): + Future sectionUpdateOrderWithHttpInfo(List sectionDTO) async { + // Verify required params are set. + if (sectionDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: sectionDTO'); + } + + final path = r'/api/Section/order'; + + Object postBody = sectionDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [List] sectionDTO (required): + Future sectionUpdateOrder(List sectionDTO) async { + final response = await sectionUpdateOrderWithHttpInfo(sectionDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } +} diff --git a/manager_api_old/lib/api/user_api.dart b/manager_api_old/lib/api/user_api.dart new file mode 100644 index 0000000..ba77f88 --- /dev/null +++ b/manager_api_old/lib/api/user_api.dart @@ -0,0 +1,325 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class UserApi { + UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/User' operation and returns the [Response]. + /// Parameters: + /// + /// * [User] user (required): + Future userCreateUserWithHttpInfo(User user) async { + // Verify required params are set. + if (user == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); + } + + final path = r'/api/User'; + + Object postBody = user; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [User] user (required): + Future userCreateUser(User user) async { + final response = await userCreateUserWithHttpInfo(user); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/User/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future userDeleteUserWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/User/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future userDeleteUser(String id) async { + final response = await userDeleteUserWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/User' operation and returns the [Response]. + Future userGetWithHttpInfo() async { + final path = r'/api/User'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> userGet() async { + final response = await userGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/User/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future userGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/User/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future userGetDetail(String id) async { + final response = await userGetDetailWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/User' operation and returns the [Response]. + /// Parameters: + /// + /// * [User] user (required): + Future userUpdateUserWithHttpInfo(User user) async { + // Verify required params are set. + if (user == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); + } + + final path = r'/api/User'; + + Object postBody = user; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [User] user (required): + Future userUpdateUser(User user) async { + final response = await userUpdateUserWithHttpInfo(user); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; + } + return Future.value(null); + } +} diff --git a/manager_api_old/lib/api_client.dart b/manager_api_old/lib/api_client.dart new file mode 100644 index 0000000..9b35f8a --- /dev/null +++ b/manager_api_old/lib/api_client.dart @@ -0,0 +1,275 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiClient { + ApiClient({this.basePath = 'http://192.168.31.140'}) { + // Setup authentications (key: authentication name, value: authentication). + _authentications[r'bearer'] = OAuth(); + } + + final String basePath; + + var _client = Client(); + + /// Returns the current HTTP [Client] instance to use in this class. + /// + /// The return value is guaranteed to never be null. + Client get client => _client; + + /// Requests to use a new HTTP [Client] in this class. + /// + /// If the [newClient] is null, an [ArgumentError] is thrown. + set client(Client newClient) { + if (newClient == null) { + throw ArgumentError('New client instance cannot be null.'); + } + _client = newClient; + } + + final _defaultHeaderMap = {}; + final _authentications = {}; + + void addDefaultHeader(String key, String value) { + _defaultHeaderMap[key] = value; + } + + Map get defaultHeaderMap => _defaultHeaderMap; + + /// returns an unmodifiable view of the authentications, since none should be added + /// nor deleted + Map get authentications => + Map.unmodifiable(_authentications); + + T getAuthentication(String name) { + final authentication = _authentications[name]; + return authentication is T ? authentication : null; + } + + // We don’t use a Map for queryParams. + // If collectionFormat is 'multi', a key might appear multiple times. + Future invokeAPI( + String path, + String method, + Iterable queryParams, + Object body, + Map headerParams, + Map formParams, + String nullableContentType, + List authNames, + ) async { + _updateParamsForAuth(authNames, queryParams, headerParams); + + headerParams.addAll(_defaultHeaderMap); + + final urlEncodedQueryParams = queryParams + .where((param) => param.value != null) + .map((param) => '$param'); + + final queryString = urlEncodedQueryParams.isNotEmpty + ? '?${urlEncodedQueryParams.join('&')}' + : ''; + + final url = '$basePath$path$queryString'; + + if (nullableContentType != null) { + headerParams['Content-Type'] = nullableContentType; + } + + try { + // Special case for uploading a single file which isn’t a 'multipart/form-data'. + if ( + body is MultipartFile && (nullableContentType == null || + !nullableContentType.toLowerCase().startsWith('multipart/form-data')) + ) { + final request = StreamedRequest(method, Uri.parse(url)); + request.headers.addAll(headerParams); + request.contentLength = body.length; + body.finalize().listen( + request.sink.add, + onDone: request.sink.close, + onError: (error, trace) => request.sink.close(), + cancelOnError: true, + ); + final response = await _client.send(request); + return Response.fromStream(response); + } + + if (body is MultipartRequest) { + final request = MultipartRequest(method, Uri.parse(url)); + request.fields.addAll(body.fields); + request.files.addAll(body.files); + request.headers.addAll(body.headers); + request.headers.addAll(headerParams); + final response = await _client.send(request); + return Response.fromStream(response); + } + + final msgBody = nullableContentType == 'application/x-www-form-urlencoded' + ? formParams + : serialize(body); + final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; + + switch(method) { + case 'POST': return await _client.post(url, headers: nullableHeaderParams, body: msgBody,); + case 'PUT': return await _client.put(url, headers: nullableHeaderParams, body: msgBody,); + case 'DELETE': return await _client.delete(url, headers: nullableHeaderParams,); + case 'PATCH': return await _client.patch(url, headers: nullableHeaderParams, body: msgBody,); + case 'HEAD': return await _client.head(url, headers: nullableHeaderParams,); + case 'GET': return await _client.get(url, headers: nullableHeaderParams,); + } + } on SocketException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'Socket operation failed: $method $path', e, trace,); + } on TlsException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'TLS/SSL communication failed: $method $path', e, trace,); + } on IOException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'I/O operation failed: $method $path', e, trace,); + } on ClientException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'HTTP connection failed: $method $path', e, trace,); + } on Exception catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'Exception occurred: $method $path', e, trace,); + } + + throw ApiException(HttpStatus.badRequest, 'Invalid HTTP operation: $method $path',); + } + + dynamic _deserialize(dynamic value, String targetType, {bool growable}) { + try { + switch (targetType) { + case 'String': + return '$value'; + case 'int': + return value is int ? value : int.parse('$value'); + case 'bool': + if (value is bool) { + return value; + } + final valueString = '$value'.toLowerCase(); + return valueString == 'true' || valueString == '1'; + break; + case 'double': + return value is double ? value : double.parse('$value'); + case 'ConfigurationDTO': + return ConfigurationDTO.fromJson(value); + case 'DeviceDTO': + return DeviceDTO.fromJson(value); + case 'DeviceDetailDTO': + return DeviceDetailDTO.fromJson(value); + case 'DeviceDetailDTOAllOf': + return DeviceDetailDTOAllOf.fromJson(value); + case 'ExportConfigurationDTO': + return ExportConfigurationDTO.fromJson(value); + case 'ExportConfigurationDTOAllOf': + return ExportConfigurationDTOAllOf.fromJson(value); + case 'GeoPointDTO': + return GeoPointDTO.fromJson(value); + case 'ImageDTO': + return ImageDTO.fromJson(value); + case 'ImageGeoPoint': + return ImageGeoPoint.fromJson(value); + case 'LevelDTO': + return LevelDTO.fromJson(value); + case 'LoginDTO': + return LoginDTO.fromJson(value); + case 'MapDTO': + return MapDTO.fromJson(value); + case 'MapTypeApp': + return MapTypeAppTypeTransformer().decode(value); + + case 'MenuDTO': + return MenuDTO.fromJson(value); + case 'PlayerMessageDTO': + return PlayerMessageDTO.fromJson(value); + case 'QuestionDTO': + return QuestionDTO.fromJson(value); + case 'QuizzDTO': + return QuizzDTO.fromJson(value); + case 'ResourceDTO': + return ResourceDTO.fromJson(value); + case 'ResourceType': + return ResourceTypeTypeTransformer().decode(value); + + case 'ResponseDTO': + return ResponseDTO.fromJson(value); + case 'SectionDTO': + return SectionDTO.fromJson(value); + case 'SectionType': + return SectionTypeTypeTransformer().decode(value); + + case 'SliderDTO': + return SliderDTO.fromJson(value); + case 'TokenDTO': + return TokenDTO.fromJson(value); + case 'TranslationDTO': + return TranslationDTO.fromJson(value); + case 'User': + return User.fromJson(value); + case 'UserDetailDTO': + return UserDetailDTO.fromJson(value); + case 'VideoDTO': + return VideoDTO.fromJson(value); + case 'WebDTO': + return WebDTO.fromJson(value); + default: + Match match; + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + final newTargetType = match[1]; + return value + .map((v) => _deserialize(v, newTargetType, growable: growable)) + .toList(growable: true == growable); + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + final newTargetType = match[1]; + return value + .map((v) => _deserialize(v, newTargetType, growable: growable)) + .toSet(); + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + final newTargetType = match[1]; + return Map.fromIterables( + value.keys, + value.values.map((v) => _deserialize(v, newTargetType, growable: growable)), + ); + } + break; + } + } on Exception catch (e, stack) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', e, stack,); + } + throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); + } + + dynamic deserialize(String json, String targetType, {bool growable}) { + // Remove all spaces. Necessary for reg expressions as well. + targetType = targetType.replaceAll(' ', ''); + + return targetType == 'String' + ? json + : _deserialize(jsonDecode(json), targetType, growable: true == growable); + } + + String serialize(Object obj) => obj == null ? '' : json.encode(obj); + + /// Update query and header parameters based on authentication settings. + /// @param authNames The authentications to apply + void _updateParamsForAuth( + List authNames, + List queryParams, + Map headerParams, + ) { + authNames.forEach((authName) { + final auth = _authentications[authName]; + if (auth == null) { + throw ArgumentError('Authentication undefined: $authName'); + } + auth.applyToParams(queryParams, headerParams); + }); + } +} diff --git a/manager_api_old/lib/api_exception.dart b/manager_api_old/lib/api_exception.dart new file mode 100644 index 0000000..1537c97 --- /dev/null +++ b/manager_api_old/lib/api_exception.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiException implements Exception { + ApiException(this.code, this.message); + + ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); + + int code = 0; + String message; + Exception innerException; + StackTrace stackTrace; + + String toString() { + if (message == null) { + return 'ApiException'; + } + if (innerException == null) { + return 'ApiException $code: $message'; + } + return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; + } +} diff --git a/manager_api_old/lib/api_helper.dart b/manager_api_old/lib/api_helper.dart new file mode 100644 index 0000000..1f73cef --- /dev/null +++ b/manager_api_old/lib/api_helper.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; +} + +// Ported from the Java version. +Iterable _convertParametersForCollectionFormat( + String collectionFormat, + String name, + dynamic value, +) { + final params = []; + + // preconditions + if (name != null && !name.isEmpty && value != null) { + if (value is List) { + // get the collection format, default: csv + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) + ? 'csv' + : collectionFormat; + + if (collectionFormat == 'multi') { + return value.map((v) => QueryParam(name, parameterToString(v))); + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam(name, value.map((v) => parameterToString(v)).join(delimiter))); + } else { + params.add(QueryParam(name, parameterToString(value))); + } + } + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + if (value is MapTypeApp) { + return MapTypeAppTypeTransformer().encode(value).toString(); + } + if (value is ResourceType) { + return ResourceTypeTypeTransformer().encode(value).toString(); + } + if (value is SectionType) { + return SectionTypeTypeTransformer().encode(value).toString(); + } + return value.toString(); +} + +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +String _decodeBodyBytes(Response response) { + final contentType = response.headers['content-type']; + return contentType != null && contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes == null ? null : utf8.decode(response.bodyBytes) + : response.body; +} diff --git a/manager_api_old/lib/auth/api_key_auth.dart b/manager_api_old/lib/auth/api_key_auth.dart new file mode 100644 index 0000000..41a4afd --- /dev/null +++ b/manager_api_old/lib/auth/api_key_auth.dart @@ -0,0 +1,35 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix; + String apiKey; + + @override + void applyToParams(List queryParams, Map headerParams) { + final value = apiKeyPrefix == null ? apiKey : '$apiKeyPrefix $apiKey'; + + if (location == 'query' && value != null) { + queryParams.add(QueryParam(paramName, value)); + } else if (location == 'header' && value != null) { + headerParams[paramName] = value; + } else if (location == 'cookie' && value != null) { + headerParams.update('Cookie', (String existingCookie) { + return '$existingCookie; $paramName=$value'; + }, ifAbsent: () => '$paramName=$value'); + } + } +} diff --git a/manager_api_old/lib/auth/authentication.dart b/manager_api_old/lib/auth/authentication.dart new file mode 100644 index 0000000..5ca198d --- /dev/null +++ b/manager_api_old/lib/auth/authentication.dart @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +abstract class Authentication { + /// Apply authentication settings to header and query params. + void applyToParams(List queryParams, Map headerParams); +} diff --git a/manager_api_old/lib/auth/http_basic_auth.dart b/manager_api_old/lib/auth/http_basic_auth.dart new file mode 100644 index 0000000..6dc36a1 --- /dev/null +++ b/manager_api_old/lib/auth/http_basic_auth.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class HttpBasicAuth implements Authentication { + String username; + String password; + + @override + void applyToParams(List queryParams, Map headerParams) { + final credentials = (username ?? '') + ':' + (password ?? ''); + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } +} diff --git a/manager_api_old/lib/auth/http_bearer_auth.dart b/manager_api_old/lib/auth/http_bearer_auth.dart new file mode 100644 index 0000000..a23b65f --- /dev/null +++ b/manager_api_old/lib/auth/http_bearer_auth.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); + } + this._accessToken = accessToken; + } + + @override + void applyToParams(List queryParams, Map headerParams) { + if (_accessToken is String) { + headerParams['Authorization'] = 'Bearer $_accessToken'; + } else if (_accessToken is HttpBearerAuthProvider) { + headerParams['Authorization'] = 'Bearer ${_accessToken()}'; + } else { + throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); + } + } +} diff --git a/manager_api_old/lib/auth/oauth.dart b/manager_api_old/lib/auth/oauth.dart new file mode 100644 index 0000000..c0463ad --- /dev/null +++ b/manager_api_old/lib/auth/oauth.dart @@ -0,0 +1,23 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class OAuth implements Authentication { + OAuth({this.accessToken}); + + String accessToken; + + @override + void applyToParams(List queryParams, Map headerParams) { + if (accessToken != null) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/manager_api_old/lib/model/configuration_dto.dart b/manager_api_old/lib/model/configuration_dto.dart new file mode 100644 index 0000000..06db575 --- /dev/null +++ b/manager_api_old/lib/model/configuration_dto.dart @@ -0,0 +1,120 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ConfigurationDTO { + /// Returns a new [ConfigurationDTO] instance. + ConfigurationDTO({ + this.id, + this.label, + this.primaryColor, + this.secondaryColor, + this.languages, + this.dateCreation, + }); + + String id; + + String label; + + String primaryColor; + + String secondaryColor; + + List languages; + + DateTime dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && + other.id == id && + other.label == label && + other.primaryColor == primaryColor && + other.secondaryColor == secondaryColor && + other.languages == languages && + other.dateCreation == dateCreation; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (label == null ? 0 : label.hashCode) + + (primaryColor == null ? 0 : primaryColor.hashCode) + + (secondaryColor == null ? 0 : secondaryColor.hashCode) + + (languages == null ? 0 : languages.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode); + + @override + String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (label != null) { + json[r'label'] = label; + } + if (primaryColor != null) { + json[r'primaryColor'] = primaryColor; + } + if (secondaryColor != null) { + json[r'secondaryColor'] = secondaryColor; + } + if (languages != null) { + json[r'languages'] = languages; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [ConfigurationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ConfigurationDTO fromJson(Map json) => json == null + ? null + : ConfigurationDTO( + id: json[r'id'], + label: json[r'label'], + primaryColor: json[r'primaryColor'], + secondaryColor: json[r'secondaryColor'], + languages: json[r'languages'] == null + ? null + : (json[r'languages'] as List).cast(), + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ConfigurationDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ConfigurationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ConfigurationDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/device_detail_dto.dart b/manager_api_old/lib/model/device_detail_dto.dart new file mode 100644 index 0000000..f8b686c --- /dev/null +++ b/manager_api_old/lib/model/device_detail_dto.dart @@ -0,0 +1,196 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceDetailDTO { + /// Returns a new [DeviceDetailDTO] instance. + DeviceDetailDTO({ + this.id, + this.identifier, + this.name, + this.ipAddressWLAN, + this.ipAddressETH, + this.configurationId, + this.configuration, + this.connected, + this.dateCreation, + this.dateUpdate, + this.connectionLevel, + this.lastConnectionLevel, + this.batteryLevel, + this.lastBatteryLevel, + }); + + String id; + + String identifier; + + String name; + + String ipAddressWLAN; + + String ipAddressETH; + + String configurationId; + + String configuration; + + bool connected; + + DateTime dateCreation; + + DateTime dateUpdate; + + String connectionLevel; + + DateTime lastConnectionLevel; + + String batteryLevel; + + DateTime lastBatteryLevel; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && + other.id == id && + other.identifier == identifier && + other.name == name && + other.ipAddressWLAN == ipAddressWLAN && + other.ipAddressETH == ipAddressETH && + other.configurationId == configurationId && + other.configuration == configuration && + other.connected == connected && + other.dateCreation == dateCreation && + other.dateUpdate == dateUpdate && + other.connectionLevel == connectionLevel && + other.lastConnectionLevel == lastConnectionLevel && + other.batteryLevel == batteryLevel && + other.lastBatteryLevel == lastBatteryLevel; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (identifier == null ? 0 : identifier.hashCode) + + (name == null ? 0 : name.hashCode) + + (ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) + + (ipAddressETH == null ? 0 : ipAddressETH.hashCode) + + (configurationId == null ? 0 : configurationId.hashCode) + + (configuration == null ? 0 : configuration.hashCode) + + (connected == null ? 0 : connected.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (dateUpdate == null ? 0 : dateUpdate.hashCode) + + (connectionLevel == null ? 0 : connectionLevel.hashCode) + + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + + (batteryLevel == null ? 0 : batteryLevel.hashCode) + + (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); + + @override + String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (identifier != null) { + json[r'identifier'] = identifier; + } + if (name != null) { + json[r'name'] = name; + } + if (ipAddressWLAN != null) { + json[r'ipAddressWLAN'] = ipAddressWLAN; + } + if (ipAddressETH != null) { + json[r'ipAddressETH'] = ipAddressETH; + } + if (configurationId != null) { + json[r'configurationId'] = configurationId; + } + if (configuration != null) { + json[r'configuration'] = configuration; + } + if (connected != null) { + json[r'connected'] = connected; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (dateUpdate != null) { + json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); + } + if (connectionLevel != null) { + json[r'connectionLevel'] = connectionLevel; + } + if (lastConnectionLevel != null) { + json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); + } + if (batteryLevel != null) { + json[r'batteryLevel'] = batteryLevel; + } + if (lastBatteryLevel != null) { + json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [DeviceDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDetailDTO fromJson(Map json) => json == null + ? null + : DeviceDetailDTO( + id: json[r'id'], + identifier: json[r'identifier'], + name: json[r'name'], + ipAddressWLAN: json[r'ipAddressWLAN'], + ipAddressETH: json[r'ipAddressETH'], + configurationId: json[r'configurationId'], + configuration: json[r'configuration'], + connected: json[r'connected'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + dateUpdate: json[r'dateUpdate'] == null + ? null + : DateTime.parse(json[r'dateUpdate']), + connectionLevel: json[r'connectionLevel'], + lastConnectionLevel: json[r'lastConnectionLevel'] == null + ? null + : DateTime.parse(json[r'lastConnectionLevel']), + batteryLevel: json[r'batteryLevel'], + lastBatteryLevel: json[r'lastBatteryLevel'] == null + ? null + : DateTime.parse(json[r'lastBatteryLevel']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/device_detail_dto_all_of.dart b/manager_api_old/lib/model/device_detail_dto_all_of.dart new file mode 100644 index 0000000..9025552 --- /dev/null +++ b/manager_api_old/lib/model/device_detail_dto_all_of.dart @@ -0,0 +1,102 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceDetailDTOAllOf { + /// Returns a new [DeviceDetailDTOAllOf] instance. + DeviceDetailDTOAllOf({ + this.connectionLevel, + this.lastConnectionLevel, + this.batteryLevel, + this.lastBatteryLevel, + }); + + String connectionLevel; + + DateTime lastConnectionLevel; + + String batteryLevel; + + DateTime lastBatteryLevel; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && + other.connectionLevel == connectionLevel && + other.lastConnectionLevel == lastConnectionLevel && + other.batteryLevel == batteryLevel && + other.lastBatteryLevel == lastBatteryLevel; + + @override + int get hashCode => + (connectionLevel == null ? 0 : connectionLevel.hashCode) + + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + + (batteryLevel == null ? 0 : batteryLevel.hashCode) + + (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); + + @override + String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + + Map toJson() { + final json = {}; + if (connectionLevel != null) { + json[r'connectionLevel'] = connectionLevel; + } + if (lastConnectionLevel != null) { + json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); + } + if (batteryLevel != null) { + json[r'batteryLevel'] = batteryLevel; + } + if (lastBatteryLevel != null) { + json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDetailDTOAllOf fromJson(Map json) => json == null + ? null + : DeviceDetailDTOAllOf( + connectionLevel: json[r'connectionLevel'], + lastConnectionLevel: json[r'lastConnectionLevel'] == null + ? null + : DateTime.parse(json[r'lastConnectionLevel']), + batteryLevel: json[r'batteryLevel'], + lastBatteryLevel: json[r'lastBatteryLevel'] == null + ? null + : DateTime.parse(json[r'lastBatteryLevel']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/device_dto.dart b/manager_api_old/lib/model/device_dto.dart new file mode 100644 index 0000000..19a5677 --- /dev/null +++ b/manager_api_old/lib/model/device_dto.dart @@ -0,0 +1,156 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceDTO { + /// Returns a new [DeviceDTO] instance. + DeviceDTO({ + this.id, + this.identifier, + this.name, + this.ipAddressWLAN, + this.ipAddressETH, + this.configurationId, + this.configuration, + this.connected, + this.dateCreation, + this.dateUpdate, + }); + + String id; + + String identifier; + + String name; + + String ipAddressWLAN; + + String ipAddressETH; + + String configurationId; + + String configuration; + + bool connected; + + DateTime dateCreation; + + DateTime dateUpdate; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDTO && + other.id == id && + other.identifier == identifier && + other.name == name && + other.ipAddressWLAN == ipAddressWLAN && + other.ipAddressETH == ipAddressETH && + other.configurationId == configurationId && + other.configuration == configuration && + other.connected == connected && + other.dateCreation == dateCreation && + other.dateUpdate == dateUpdate; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (identifier == null ? 0 : identifier.hashCode) + + (name == null ? 0 : name.hashCode) + + (ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) + + (ipAddressETH == null ? 0 : ipAddressETH.hashCode) + + (configurationId == null ? 0 : configurationId.hashCode) + + (configuration == null ? 0 : configuration.hashCode) + + (connected == null ? 0 : connected.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (dateUpdate == null ? 0 : dateUpdate.hashCode); + + @override + String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (identifier != null) { + json[r'identifier'] = identifier; + } + if (name != null) { + json[r'name'] = name; + } + if (ipAddressWLAN != null) { + json[r'ipAddressWLAN'] = ipAddressWLAN; + } + if (ipAddressETH != null) { + json[r'ipAddressETH'] = ipAddressETH; + } + if (configurationId != null) { + json[r'configurationId'] = configurationId; + } + if (configuration != null) { + json[r'configuration'] = configuration; + } + if (connected != null) { + json[r'connected'] = connected; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (dateUpdate != null) { + json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [DeviceDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDTO fromJson(Map json) => json == null + ? null + : DeviceDTO( + id: json[r'id'], + identifier: json[r'identifier'], + name: json[r'name'], + ipAddressWLAN: json[r'ipAddressWLAN'], + ipAddressETH: json[r'ipAddressETH'], + configurationId: json[r'configurationId'], + configuration: json[r'configuration'], + connected: json[r'connected'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + dateUpdate: json[r'dateUpdate'] == null + ? null + : DateTime.parse(json[r'dateUpdate']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/export_configuration_dto.dart b/manager_api_old/lib/model/export_configuration_dto.dart new file mode 100644 index 0000000..3e2a8a2 --- /dev/null +++ b/manager_api_old/lib/model/export_configuration_dto.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ExportConfigurationDTO { + /// Returns a new [ExportConfigurationDTO] instance. + ExportConfigurationDTO({ + this.id, + this.label, + this.primaryColor, + this.secondaryColor, + this.languages, + this.dateCreation, + this.sections, + this.resources, + }); + + String id; + + String label; + + String primaryColor; + + String secondaryColor; + + List languages; + + DateTime dateCreation; + + List sections; + + List resources; + + @override + bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO && + other.id == id && + other.label == label && + other.primaryColor == primaryColor && + other.secondaryColor == secondaryColor && + other.languages == languages && + other.dateCreation == dateCreation && + other.sections == sections && + other.resources == resources; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (label == null ? 0 : label.hashCode) + + (primaryColor == null ? 0 : primaryColor.hashCode) + + (secondaryColor == null ? 0 : secondaryColor.hashCode) + + (languages == null ? 0 : languages.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (sections == null ? 0 : sections.hashCode) + + (resources == null ? 0 : resources.hashCode); + + @override + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, sections=$sections, resources=$resources]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (label != null) { + json[r'label'] = label; + } + if (primaryColor != null) { + json[r'primaryColor'] = primaryColor; + } + if (secondaryColor != null) { + json[r'secondaryColor'] = secondaryColor; + } + if (languages != null) { + json[r'languages'] = languages; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (sections != null) { + json[r'sections'] = sections; + } + if (resources != null) { + json[r'resources'] = resources; + } + return json; + } + + /// Returns a new [ExportConfigurationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ExportConfigurationDTO fromJson(Map json) => json == null + ? null + : ExportConfigurationDTO( + id: json[r'id'], + label: json[r'label'], + primaryColor: json[r'primaryColor'], + secondaryColor: json[r'secondaryColor'], + languages: json[r'languages'] == null + ? null + : (json[r'languages'] as List).cast(), + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + sections: SectionDTO.listFromJson(json[r'sections']), + resources: ResourceDTO.listFromJson(json[r'resources']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ExportConfigurationDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ExportConfigurationDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ExportConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/export_configuration_dto_all_of.dart b/manager_api_old/lib/model/export_configuration_dto_all_of.dart new file mode 100644 index 0000000..4d93a48 --- /dev/null +++ b/manager_api_old/lib/model/export_configuration_dto_all_of.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ExportConfigurationDTOAllOf { + /// Returns a new [ExportConfigurationDTOAllOf] instance. + ExportConfigurationDTOAllOf({ + this.sections, + this.resources, + }); + + List sections; + + List resources; + + @override + bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTOAllOf && + other.sections == sections && + other.resources == resources; + + @override + int get hashCode => + (sections == null ? 0 : sections.hashCode) + + (resources == null ? 0 : resources.hashCode); + + @override + String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]'; + + Map toJson() { + final json = {}; + if (sections != null) { + json[r'sections'] = sections; + } + if (resources != null) { + json[r'resources'] = resources; + } + return json; + } + + /// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ExportConfigurationDTOAllOf fromJson(Map json) => json == null + ? null + : ExportConfigurationDTOAllOf( + sections: SectionDTO.listFromJson(json[r'sections']), + resources: ResourceDTO.listFromJson(json[r'resources']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ExportConfigurationDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ExportConfigurationDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ExportConfigurationDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/geo_point_dto.dart b/manager_api_old/lib/model/geo_point_dto.dart new file mode 100644 index 0000000..15363a1 --- /dev/null +++ b/manager_api_old/lib/model/geo_point_dto.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GeoPointDTO { + /// Returns a new [GeoPointDTO] instance. + GeoPointDTO({ + this.id, + this.title, + this.description, + this.images, + this.latitude, + this.longitude, + }); + + int id; + + List title; + + List description; + + List images; + + String latitude; + + String longitude; + + @override + bool operator ==(Object other) => identical(this, other) || other is GeoPointDTO && + other.id == id && + other.title == title && + other.description == description && + other.images == images && + other.latitude == latitude && + other.longitude == longitude; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (title == null ? 0 : title.hashCode) + + (description == null ? 0 : description.hashCode) + + (images == null ? 0 : images.hashCode) + + (latitude == null ? 0 : latitude.hashCode) + + (longitude == null ? 0 : longitude.hashCode); + + @override + String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (title != null) { + json[r'title'] = title; + } + if (description != null) { + json[r'description'] = description; + } + if (images != null) { + json[r'images'] = images; + } + if (latitude != null) { + json[r'latitude'] = latitude; + } + if (longitude != null) { + json[r'longitude'] = longitude; + } + return json; + } + + /// Returns a new [GeoPointDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GeoPointDTO fromJson(Map json) => json == null + ? null + : GeoPointDTO( + id: json[r'id'], + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + images: ImageGeoPoint.listFromJson(json[r'images']), + latitude: json[r'latitude'], + longitude: json[r'longitude'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GeoPointDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GeoPointDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GeoPointDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GeoPointDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/image_dto.dart b/manager_api_old/lib/model/image_dto.dart new file mode 100644 index 0000000..8ea812c --- /dev/null +++ b/manager_api_old/lib/model/image_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ImageDTO { + /// Returns a new [ImageDTO] instance. + ImageDTO({ + this.title, + this.description, + this.resourceId, + this.source_, + this.order, + }); + + List title; + + List description; + + String resourceId; + + String source_; + + int order; + + @override + bool operator ==(Object other) => identical(this, other) || other is ImageDTO && + other.title == title && + other.description == description && + other.resourceId == resourceId && + other.source_ == source_ && + other.order == order; + + @override + int get hashCode => + (title == null ? 0 : title.hashCode) + + (description == null ? 0 : description.hashCode) + + (resourceId == null ? 0 : resourceId.hashCode) + + (source_ == null ? 0 : source_.hashCode) + + (order == null ? 0 : order.hashCode); + + @override + String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]'; + + Map toJson() { + final json = {}; + if (title != null) { + json[r'title'] = title; + } + if (description != null) { + json[r'description'] = description; + } + if (resourceId != null) { + json[r'resourceId'] = resourceId; + } + if (source_ != null) { + json[r'source'] = source_; + } + if (order != null) { + json[r'order'] = order; + } + return json; + } + + /// Returns a new [ImageDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ImageDTO fromJson(Map json) => json == null + ? null + : ImageDTO( + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + resourceId: json[r'resourceId'], + source_: json[r'source'], + order: json[r'order'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ImageDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ImageDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ImageDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ImageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/image_geo_point.dart b/manager_api_old/lib/model/image_geo_point.dart new file mode 100644 index 0000000..923877f --- /dev/null +++ b/manager_api_old/lib/model/image_geo_point.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ImageGeoPoint { + /// Returns a new [ImageGeoPoint] instance. + ImageGeoPoint({ + this.imageResourceId, + this.imageSource, + }); + + String imageResourceId; + + String imageSource; + + @override + bool operator ==(Object other) => identical(this, other) || other is ImageGeoPoint && + other.imageResourceId == imageResourceId && + other.imageSource == imageSource; + + @override + int get hashCode => + (imageResourceId == null ? 0 : imageResourceId.hashCode) + + (imageSource == null ? 0 : imageSource.hashCode); + + @override + String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]'; + + Map toJson() { + final json = {}; + if (imageResourceId != null) { + json[r'imageResourceId'] = imageResourceId; + } + if (imageSource != null) { + json[r'imageSource'] = imageSource; + } + return json; + } + + /// Returns a new [ImageGeoPoint] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ImageGeoPoint fromJson(Map json) => json == null + ? null + : ImageGeoPoint( + imageResourceId: json[r'imageResourceId'], + imageSource: json[r'imageSource'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ImageGeoPoint.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ImageGeoPoint.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ImageGeoPoint-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ImageGeoPoint.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/level_dto.dart b/manager_api_old/lib/model/level_dto.dart new file mode 100644 index 0000000..c9a5f17 --- /dev/null +++ b/manager_api_old/lib/model/level_dto.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class LevelDTO { + /// Returns a new [LevelDTO] instance. + LevelDTO({ + this.label, + this.resourceId, + this.source_, + }); + + List label; + + String resourceId; + + String source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is LevelDTO && + other.label == label && + other.resourceId == resourceId && + other.source_ == source_; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (resourceId == null ? 0 : resourceId.hashCode) + + (source_ == null ? 0 : source_.hashCode); + + @override + String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (resourceId != null) { + json[r'resourceId'] = resourceId; + } + if (source_ != null) { + json[r'source'] = source_; + } + return json; + } + + /// Returns a new [LevelDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static LevelDTO fromJson(Map json) => json == null + ? null + : LevelDTO( + label: TranslationDTO.listFromJson(json[r'label']), + resourceId: json[r'resourceId'], + source_: json[r'source'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => LevelDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = LevelDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of LevelDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = LevelDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/login_dto.dart b/manager_api_old/lib/model/login_dto.dart new file mode 100644 index 0000000..ff0bed5 --- /dev/null +++ b/manager_api_old/lib/model/login_dto.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class LoginDTO { + /// Returns a new [LoginDTO] instance. + LoginDTO({ + this.email, + this.password, + }); + + String email; + + String password; + + @override + bool operator ==(Object other) => identical(this, other) || other is LoginDTO && + other.email == email && + other.password == password; + + @override + int get hashCode => + (email == null ? 0 : email.hashCode) + + (password == null ? 0 : password.hashCode); + + @override + String toString() => 'LoginDTO[email=$email, password=$password]'; + + Map toJson() { + final json = {}; + if (email != null) { + json[r'email'] = email; + } + if (password != null) { + json[r'password'] = password; + } + return json; + } + + /// Returns a new [LoginDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static LoginDTO fromJson(Map json) => json == null + ? null + : LoginDTO( + email: json[r'email'], + password: json[r'password'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => LoginDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = LoginDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of LoginDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = LoginDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/map_dto.dart b/manager_api_old/lib/model/map_dto.dart new file mode 100644 index 0000000..f8e229d --- /dev/null +++ b/manager_api_old/lib/model/map_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class MapDTO { + /// Returns a new [MapDTO] instance. + MapDTO({ + this.zoom, + this.mapType, + this.points, + this.iconResourceId, + this.iconSource, + }); + + int zoom; + + MapTypeApp mapType; + + List points; + + String iconResourceId; + + String iconSource; + + @override + bool operator ==(Object other) => identical(this, other) || other is MapDTO && + other.zoom == zoom && + other.mapType == mapType && + other.points == points && + other.iconResourceId == iconResourceId && + other.iconSource == iconSource; + + @override + int get hashCode => + (zoom == null ? 0 : zoom.hashCode) + + (mapType == null ? 0 : mapType.hashCode) + + (points == null ? 0 : points.hashCode) + + (iconResourceId == null ? 0 : iconResourceId.hashCode) + + (iconSource == null ? 0 : iconSource.hashCode); + + @override + String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]'; + + Map toJson() { + final json = {}; + if (zoom != null) { + json[r'zoom'] = zoom; + } + if (mapType != null) { + json[r'mapType'] = mapType; + } + if (points != null) { + json[r'points'] = points; + } + if (iconResourceId != null) { + json[r'iconResourceId'] = iconResourceId; + } + if (iconSource != null) { + json[r'iconSource'] = iconSource; + } + return json; + } + + /// Returns a new [MapDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static MapDTO fromJson(Map json) => json == null + ? null + : MapDTO( + zoom: json[r'zoom'], + mapType: MapTypeApp.fromJson(json[r'mapType']), + points: GeoPointDTO.listFromJson(json[r'points']), + iconResourceId: json[r'iconResourceId'], + iconSource: json[r'iconSource'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => MapDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = MapDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of MapDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = MapDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/map_type.dart b/manager_api_old/lib/model/map_type.dart similarity index 100% rename from manager_api/lib/model/map_type.dart rename to manager_api_old/lib/model/map_type.dart diff --git a/manager_api_old/lib/model/map_type_app.dart b/manager_api_old/lib/model/map_type_app.dart new file mode 100644 index 0000000..893968e --- /dev/null +++ b/manager_api_old/lib/model/map_type_app.dart @@ -0,0 +1,85 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class MapTypeApp { + /// Instantiate a new enum with the provided [value]. + const MapTypeApp._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const none = MapTypeApp._(r'none'); + static const normal = MapTypeApp._(r'normal'); + static const satellite = MapTypeApp._(r'satellite'); + static const terrain = MapTypeApp._(r'terrain'); + static const hybrid = MapTypeApp._(r'hybrid'); + + /// List of all possible values in this [enum][MapTypeApp]. + static const values = [ + none, + normal, + satellite, + terrain, + hybrid, + ]; + + static MapTypeApp fromJson(dynamic value) => + MapTypeAppTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => MapTypeApp.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [MapTypeApp] to String, +/// and [decode] dynamic data back to [MapTypeApp]. +class MapTypeAppTypeTransformer { + const MapTypeAppTypeTransformer._(); + + factory MapTypeAppTypeTransformer() => _instance ??= MapTypeAppTypeTransformer._(); + + String encode(MapTypeApp data) => data.value; + + /// Decodes a [dynamic value][data] to a MapTypeApp. + /// + /// 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. + MapTypeApp decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'none': return MapTypeApp.none; + case r'normal': return MapTypeApp.normal; + case r'satellite': return MapTypeApp.satellite; + case r'terrain': return MapTypeApp.terrain; + case r'hybrid': return MapTypeApp.hybrid; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [MapTypeAppTypeTransformer] instance. + static MapTypeAppTypeTransformer _instance; +} diff --git a/manager_api_old/lib/model/menu_dto.dart b/manager_api_old/lib/model/menu_dto.dart new file mode 100644 index 0000000..bcde011 --- /dev/null +++ b/manager_api_old/lib/model/menu_dto.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class MenuDTO { + /// Returns a new [MenuDTO] instance. + MenuDTO({ + this.sections, + }); + + List sections; + + @override + bool operator ==(Object other) => identical(this, other) || other is MenuDTO && + other.sections == sections; + + @override + int get hashCode => + (sections == null ? 0 : sections.hashCode); + + @override + String toString() => 'MenuDTO[sections=$sections]'; + + Map toJson() { + final json = {}; + if (sections != null) { + json[r'sections'] = sections; + } + return json; + } + + /// Returns a new [MenuDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static MenuDTO fromJson(Map json) => json == null + ? null + : MenuDTO( + sections: SectionDTO.listFromJson(json[r'sections']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => MenuDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = MenuDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of MenuDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = MenuDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/player_message_dto.dart b/manager_api_old/lib/model/player_message_dto.dart new file mode 100644 index 0000000..0341a99 --- /dev/null +++ b/manager_api_old/lib/model/player_message_dto.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PlayerMessageDTO { + /// Returns a new [PlayerMessageDTO] instance. + PlayerMessageDTO({ + this.configChanged, + this.isDeleted, + }); + + bool configChanged; + + bool isDeleted; + + @override + bool operator ==(Object other) => identical(this, other) || other is PlayerMessageDTO && + other.configChanged == configChanged && + other.isDeleted == isDeleted; + + @override + int get hashCode => + (configChanged == null ? 0 : configChanged.hashCode) + + (isDeleted == null ? 0 : isDeleted.hashCode); + + @override + String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]'; + + Map toJson() { + final json = {}; + if (configChanged != null) { + json[r'configChanged'] = configChanged; + } + if (isDeleted != null) { + json[r'isDeleted'] = isDeleted; + } + return json; + } + + /// Returns a new [PlayerMessageDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static PlayerMessageDTO fromJson(Map json) => json == null + ? null + : PlayerMessageDTO( + configChanged: json[r'configChanged'], + isDeleted: json[r'isDeleted'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => PlayerMessageDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = PlayerMessageDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of PlayerMessageDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = PlayerMessageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/question_dto.dart b/manager_api_old/lib/model/question_dto.dart new file mode 100644 index 0000000..0584111 --- /dev/null +++ b/manager_api_old/lib/model/question_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QuestionDTO { + /// Returns a new [QuestionDTO] instance. + QuestionDTO({ + this.label, + this.responses, + this.resourceId, + this.source_, + this.order, + }); + + List label; + + List responses; + + String resourceId; + + String source_; + + int order; + + @override + bool operator ==(Object other) => identical(this, other) || other is QuestionDTO && + other.label == label && + other.responses == responses && + other.resourceId == resourceId && + other.source_ == source_ && + other.order == order; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (responses == null ? 0 : responses.hashCode) + + (resourceId == null ? 0 : resourceId.hashCode) + + (source_ == null ? 0 : source_.hashCode) + + (order == null ? 0 : order.hashCode); + + @override + String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (responses != null) { + json[r'responses'] = responses; + } + if (resourceId != null) { + json[r'resourceId'] = resourceId; + } + if (source_ != null) { + json[r'source'] = source_; + } + if (order != null) { + json[r'order'] = order; + } + return json; + } + + /// Returns a new [QuestionDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static QuestionDTO fromJson(Map json) => json == null + ? null + : QuestionDTO( + label: TranslationDTO.listFromJson(json[r'label']), + responses: ResponseDTO.listFromJson(json[r'responses']), + resourceId: json[r'resourceId'], + source_: json[r'source'], + order: json[r'order'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => QuestionDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = QuestionDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of QuestionDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = QuestionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/quizz_dto.dart b/manager_api_old/lib/model/quizz_dto.dart new file mode 100644 index 0000000..20c22f2 --- /dev/null +++ b/manager_api_old/lib/model/quizz_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QuizzDTO { + /// Returns a new [QuizzDTO] instance. + QuizzDTO({ + this.questions, + this.badLevel, + this.mediumLevel, + this.goodLevel, + this.greatLevel, + }); + + List questions; + + LevelDTO badLevel; + + LevelDTO mediumLevel; + + LevelDTO goodLevel; + + LevelDTO greatLevel; + + @override + bool operator ==(Object other) => identical(this, other) || other is QuizzDTO && + other.questions == questions && + other.badLevel == badLevel && + other.mediumLevel == mediumLevel && + other.goodLevel == goodLevel && + other.greatLevel == greatLevel; + + @override + int get hashCode => + (questions == null ? 0 : questions.hashCode) + + (badLevel == null ? 0 : badLevel.hashCode) + + (mediumLevel == null ? 0 : mediumLevel.hashCode) + + (goodLevel == null ? 0 : goodLevel.hashCode) + + (greatLevel == null ? 0 : greatLevel.hashCode); + + @override + String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]'; + + Map toJson() { + final json = {}; + if (questions != null) { + json[r'questions'] = questions; + } + if (badLevel != null) { + json[r'bad_level'] = badLevel; + } + if (mediumLevel != null) { + json[r'medium_level'] = mediumLevel; + } + if (goodLevel != null) { + json[r'good_level'] = goodLevel; + } + if (greatLevel != null) { + json[r'great_level'] = greatLevel; + } + return json; + } + + /// Returns a new [QuizzDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static QuizzDTO fromJson(Map json) => json == null + ? null + : QuizzDTO( + questions: QuestionDTO.listFromJson(json[r'questions']), + badLevel: LevelDTO.fromJson(json[r'bad_level']), + mediumLevel: LevelDTO.fromJson(json[r'medium_level']), + goodLevel: LevelDTO.fromJson(json[r'good_level']), + greatLevel: LevelDTO.fromJson(json[r'great_level']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => QuizzDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = QuizzDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of QuizzDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = QuizzDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/resource_detail_dto.dart b/manager_api_old/lib/model/resource_detail_dto.dart similarity index 100% rename from manager_api/lib/model/resource_detail_dto.dart rename to manager_api_old/lib/model/resource_detail_dto.dart diff --git a/manager_api_old/lib/model/resource_dto.dart b/manager_api_old/lib/model/resource_dto.dart new file mode 100644 index 0000000..81f6382 --- /dev/null +++ b/manager_api_old/lib/model/resource_dto.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ResourceDTO { + /// Returns a new [ResourceDTO] instance. + ResourceDTO({ + this.id, + this.type, + this.label, + this.dateCreation, + this.data, + }); + + String id; + + ResourceType type; + + String label; + + DateTime dateCreation; + + String data; + + @override + bool operator ==(Object other) => identical(this, other) || other is ResourceDTO && + other.id == id && + other.type == type && + other.label == label && + other.dateCreation == dateCreation && + other.data == data; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (type == null ? 0 : type.hashCode) + + (label == null ? 0 : label.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (data == null ? 0 : data.hashCode); + + @override + String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (type != null) { + json[r'type'] = type; + } + if (label != null) { + json[r'label'] = label; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (data != null) { + json[r'data'] = data; + } + return json; + } + + /// Returns a new [ResourceDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ResourceDTO fromJson(Map json) => json == null + ? null + : ResourceDTO( + id: json[r'id'], + type: ResourceType.fromJson(json[r'type']), + label: json[r'label'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + data: json[r'data'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ResourceDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ResourceDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ResourceDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ResourceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/resource_type.dart b/manager_api_old/lib/model/resource_type.dart new file mode 100644 index 0000000..cb501a3 --- /dev/null +++ b/manager_api_old/lib/model/resource_type.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ResourceType { + /// Instantiate a new enum with the provided [value]. + const ResourceType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const image = ResourceType._(r'Image'); + static const video = ResourceType._(r'Video'); + static const imageUrl = ResourceType._(r'ImageUrl'); + static const videoUrl = ResourceType._(r'VideoUrl'); + + /// List of all possible values in this [enum][ResourceType]. + static const values = [ + image, + video, + imageUrl, + videoUrl, + ]; + + static ResourceType fromJson(dynamic value) => + ResourceTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ResourceType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ResourceType] to String, +/// and [decode] dynamic data back to [ResourceType]. +class ResourceTypeTypeTransformer { + const ResourceTypeTypeTransformer._(); + + factory ResourceTypeTypeTransformer() => _instance ??= ResourceTypeTypeTransformer._(); + + String encode(ResourceType data) => data.value; + + /// Decodes a [dynamic value][data] to a ResourceType. + /// + /// 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. + ResourceType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Image': return ResourceType.image; + case r'Video': return ResourceType.video; + case r'ImageUrl': return ResourceType.imageUrl; + case r'VideoUrl': return ResourceType.videoUrl; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ResourceTypeTypeTransformer] instance. + static ResourceTypeTypeTransformer _instance; +} diff --git a/manager_api_old/lib/model/response_dto.dart b/manager_api_old/lib/model/response_dto.dart new file mode 100644 index 0000000..1415493 --- /dev/null +++ b/manager_api_old/lib/model/response_dto.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ResponseDTO { + /// Returns a new [ResponseDTO] instance. + ResponseDTO({ + this.label, + this.isGood, + this.order, + }); + + List label; + + bool isGood; + + int order; + + @override + bool operator ==(Object other) => identical(this, other) || other is ResponseDTO && + other.label == label && + other.isGood == isGood && + other.order == order; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (isGood == null ? 0 : isGood.hashCode) + + (order == null ? 0 : order.hashCode); + + @override + String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (isGood != null) { + json[r'isGood'] = isGood; + } + if (order != null) { + json[r'order'] = order; + } + return json; + } + + /// Returns a new [ResponseDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ResponseDTO fromJson(Map json) => json == null + ? null + : ResponseDTO( + label: TranslationDTO.listFromJson(json[r'label']), + isGood: json[r'isGood'], + order: json[r'order'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ResponseDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ResponseDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ResponseDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ResponseDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/section_dto.dart b/manager_api_old/lib/model/section_dto.dart new file mode 100644 index 0000000..7d29c5e --- /dev/null +++ b/manager_api_old/lib/model/section_dto.dart @@ -0,0 +1,181 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SectionDTO { + /// Returns a new [SectionDTO] instance. + SectionDTO({ + this.id, + this.label, + this.title, + this.description, + this.imageId, + this.imageSource, + this.configurationId, + this.isSubSection, + this.parentId, + this.type, + this.data, + this.dateCreation, + this.order, + }); + + String id; + + String label; + + List title; + + List description; + + String imageId; + + String imageSource; + + String configurationId; + + bool isSubSection; + + String parentId; + + SectionType type; + + String data; + + DateTime dateCreation; + + int order; + + @override + bool operator ==(Object other) => identical(this, other) || other is SectionDTO && + other.id == id && + other.label == label && + other.title == title && + other.description == description && + other.imageId == imageId && + other.imageSource == imageSource && + other.configurationId == configurationId && + other.isSubSection == isSubSection && + other.parentId == parentId && + other.type == type && + other.data == data && + other.dateCreation == dateCreation && + other.order == order; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (label == null ? 0 : label.hashCode) + + (title == null ? 0 : title.hashCode) + + (description == null ? 0 : description.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) + + (data == null ? 0 : data.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (order == null ? 0 : order.hashCode); + + @override + String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (label != null) { + json[r'label'] = label; + } + if (title != null) { + json[r'title'] = title; + } + if (description != null) { + json[r'description'] = description; + } + if (imageId != null) { + json[r'imageId'] = imageId; + } + if (imageSource != null) { + json[r'imageSource'] = imageSource; + } + if (configurationId != null) { + json[r'configurationId'] = configurationId; + } + if (isSubSection != null) { + json[r'isSubSection'] = isSubSection; + } + if (parentId != null) { + json[r'parentId'] = parentId; + } + if (type != null) { + json[r'type'] = type; + } + if (data != null) { + json[r'data'] = data; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (order != null) { + json[r'order'] = order; + } + return json; + } + + /// Returns a new [SectionDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static SectionDTO fromJson(Map json) => json == null + ? null + : SectionDTO( + id: json[r'id'], + label: json[r'label'], + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + imageId: json[r'imageId'], + imageSource: json[r'imageSource'], + configurationId: json[r'configurationId'], + isSubSection: json[r'isSubSection'], + parentId: json[r'parentId'], + type: SectionType.fromJson(json[r'type']), + data: json[r'data'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + order: json[r'order'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => SectionDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = SectionDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of SectionDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = SectionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/section_type.dart b/manager_api_old/lib/model/section_type.dart new file mode 100644 index 0000000..4d6cbc2 --- /dev/null +++ b/manager_api_old/lib/model/section_type.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class SectionType { + /// Instantiate a new enum with the provided [value]. + const SectionType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const map = SectionType._(r'Map'); + static const slider = SectionType._(r'Slider'); + static const video = SectionType._(r'Video'); + static const web = SectionType._(r'Web'); + static const menu = SectionType._(r'Menu'); + static const quizz = SectionType._(r'Quizz'); + + /// List of all possible values in this [enum][SectionType]. + static const values = [ + map, + slider, + video, + web, + menu, + quizz, + ]; + + static SectionType fromJson(dynamic value) => + SectionTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => SectionType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [SectionType] to String, +/// and [decode] dynamic data back to [SectionType]. +class SectionTypeTypeTransformer { + const SectionTypeTypeTransformer._(); + + factory SectionTypeTypeTransformer() => _instance ??= SectionTypeTypeTransformer._(); + + String encode(SectionType data) => data.value; + + /// Decodes a [dynamic value][data] to a SectionType. + /// + /// 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. + SectionType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Map': return SectionType.map; + case r'Slider': return SectionType.slider; + case r'Video': return SectionType.video; + case r'Web': return SectionType.web; + case r'Menu': return SectionType.menu; + case r'Quizz': return SectionType.quizz; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [SectionTypeTypeTransformer] instance. + static SectionTypeTypeTransformer _instance; +} diff --git a/manager_api_old/lib/model/slider_dto.dart b/manager_api_old/lib/model/slider_dto.dart new file mode 100644 index 0000000..fd714c7 --- /dev/null +++ b/manager_api_old/lib/model/slider_dto.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SliderDTO { + /// Returns a new [SliderDTO] instance. + SliderDTO({ + this.images, + }); + + List images; + + @override + bool operator ==(Object other) => identical(this, other) || other is SliderDTO && + other.images == images; + + @override + int get hashCode => + (images == null ? 0 : images.hashCode); + + @override + String toString() => 'SliderDTO[images=$images]'; + + Map toJson() { + final json = {}; + if (images != null) { + json[r'images'] = images; + } + return json; + } + + /// Returns a new [SliderDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static SliderDTO fromJson(Map json) => json == null + ? null + : SliderDTO( + images: ImageDTO.listFromJson(json[r'images']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => SliderDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = SliderDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of SliderDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = SliderDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/token_dto.dart b/manager_api_old/lib/model/token_dto.dart new file mode 100644 index 0000000..5ef4e57 --- /dev/null +++ b/manager_api_old/lib/model/token_dto.dart @@ -0,0 +1,118 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class TokenDTO { + /// Returns a new [TokenDTO] instance. + TokenDTO({ + this.accessToken, + this.refreshToken, + this.scope, + this.tokenType, + this.expiresIn, + this.expiration, + }); + + String accessToken; + + String refreshToken; + + String scope; + + String tokenType; + + int expiresIn; + + DateTime expiration; + + @override + bool operator ==(Object other) => identical(this, other) || other is TokenDTO && + other.accessToken == accessToken && + other.refreshToken == refreshToken && + other.scope == scope && + other.tokenType == tokenType && + other.expiresIn == expiresIn && + other.expiration == expiration; + + @override + int get hashCode => + (accessToken == null ? 0 : accessToken.hashCode) + + (refreshToken == null ? 0 : refreshToken.hashCode) + + (scope == null ? 0 : scope.hashCode) + + (tokenType == null ? 0 : tokenType.hashCode) + + (expiresIn == null ? 0 : expiresIn.hashCode) + + (expiration == null ? 0 : expiration.hashCode); + + @override + String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration]'; + + Map toJson() { + final json = {}; + if (accessToken != null) { + json[r'access_token'] = accessToken; + } + if (refreshToken != null) { + json[r'refresh_token'] = refreshToken; + } + if (scope != null) { + json[r'scope'] = scope; + } + if (tokenType != null) { + json[r'token_type'] = tokenType; + } + if (expiresIn != null) { + json[r'expires_in'] = expiresIn; + } + if (expiration != null) { + json[r'expiration'] = expiration.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [TokenDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static TokenDTO fromJson(Map json) => json == null + ? null + : TokenDTO( + accessToken: json[r'access_token'], + refreshToken: json[r'refresh_token'], + scope: json[r'scope'], + tokenType: json[r'token_type'], + expiresIn: json[r'expires_in'], + expiration: json[r'expiration'] == null + ? null + : DateTime.parse(json[r'expiration']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => TokenDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = TokenDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of TokenDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = TokenDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/translation_dto.dart b/manager_api_old/lib/model/translation_dto.dart new file mode 100644 index 0000000..186d9c1 --- /dev/null +++ b/manager_api_old/lib/model/translation_dto.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class TranslationDTO { + /// Returns a new [TranslationDTO] instance. + TranslationDTO({ + this.language, + this.value, + }); + + String language; + + String value; + + @override + bool operator ==(Object other) => identical(this, other) || other is TranslationDTO && + other.language == language && + other.value == value; + + @override + int get hashCode => + (language == null ? 0 : language.hashCode) + + (value == null ? 0 : value.hashCode); + + @override + String toString() => 'TranslationDTO[language=$language, value=$value]'; + + Map toJson() { + final json = {}; + if (language != null) { + json[r'language'] = language; + } + if (value != null) { + json[r'value'] = value; + } + return json; + } + + /// Returns a new [TranslationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static TranslationDTO fromJson(Map json) => json == null + ? null + : TranslationDTO( + language: json[r'language'], + value: json[r'value'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => TranslationDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = TranslationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of TranslationDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = TranslationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/user.dart b/manager_api_old/lib/model/user.dart new file mode 100644 index 0000000..58d6440 --- /dev/null +++ b/manager_api_old/lib/model/user.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class User { + /// Returns a new [User] instance. + User({ + this.id, + this.email, + this.password, + this.firstName, + this.lastName, + this.token, + this.dateCreation, + }); + + String id; + + String email; + + String password; + + String firstName; + + String lastName; + + String token; + + DateTime dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.email == email && + other.password == password && + other.firstName == firstName && + other.lastName == lastName && + other.token == token && + other.dateCreation == dateCreation; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (email == null ? 0 : email.hashCode) + + (password == null ? 0 : password.hashCode) + + (firstName == null ? 0 : firstName.hashCode) + + (lastName == null ? 0 : lastName.hashCode) + + (token == null ? 0 : token.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode); + + @override + String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (email != null) { + json[r'email'] = email; + } + if (password != null) { + json[r'password'] = password; + } + if (firstName != null) { + json[r'firstName'] = firstName; + } + if (lastName != null) { + json[r'lastName'] = lastName; + } + if (token != null) { + json[r'token'] = token; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [User] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static User fromJson(Map json) => json == null + ? null + : User( + id: json[r'id'], + email: json[r'email'], + password: json[r'password'], + firstName: json[r'firstName'], + lastName: json[r'lastName'], + token: json[r'token'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => User.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = User.fromJson(v)); + } + return map; + } + + // maps a json object with a list of User-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = User.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/user_detail_dto.dart b/manager_api_old/lib/model/user_detail_dto.dart new file mode 100644 index 0000000..0b67418 --- /dev/null +++ b/manager_api_old/lib/model/user_detail_dto.dart @@ -0,0 +1,98 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class UserDetailDTO { + /// Returns a new [UserDetailDTO] instance. + UserDetailDTO({ + this.id, + this.email, + this.firstName, + this.lastName, + }); + + String id; + + String email; + + String firstName; + + String lastName; + + @override + bool operator ==(Object other) => identical(this, other) || other is UserDetailDTO && + other.id == id && + other.email == email && + other.firstName == firstName && + other.lastName == lastName; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (email == null ? 0 : email.hashCode) + + (firstName == null ? 0 : firstName.hashCode) + + (lastName == null ? 0 : lastName.hashCode); + + @override + String toString() => 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (email != null) { + json[r'email'] = email; + } + if (firstName != null) { + json[r'firstName'] = firstName; + } + if (lastName != null) { + json[r'lastName'] = lastName; + } + return json; + } + + /// Returns a new [UserDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static UserDetailDTO fromJson(Map json) => json == null + ? null + : UserDetailDTO( + id: json[r'id'], + email: json[r'email'], + firstName: json[r'firstName'], + lastName: json[r'lastName'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => UserDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = UserDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of UserDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = UserDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/video_dto.dart b/manager_api_old/lib/model/video_dto.dart new file mode 100644 index 0000000..339d04b --- /dev/null +++ b/manager_api_old/lib/model/video_dto.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class VideoDTO { + /// Returns a new [VideoDTO] instance. + VideoDTO({ + this.source_, + }); + + String source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is VideoDTO && + other.source_ == source_; + + @override + int get hashCode => + (source_ == null ? 0 : source_.hashCode); + + @override + String toString() => 'VideoDTO[source_=$source_]'; + + Map toJson() { + final json = {}; + if (source_ != null) { + json[r'source'] = source_; + } + return json; + } + + /// Returns a new [VideoDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static VideoDTO fromJson(Map json) => json == null + ? null + : VideoDTO( + source_: json[r'source'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => VideoDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = VideoDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of VideoDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = VideoDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api_old/lib/model/web_dto.dart b/manager_api_old/lib/model/web_dto.dart new file mode 100644 index 0000000..5dc905b --- /dev/null +++ b/manager_api_old/lib/model/web_dto.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class WebDTO { + /// Returns a new [WebDTO] instance. + WebDTO({ + this.source_, + }); + + String source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is WebDTO && + other.source_ == source_; + + @override + int get hashCode => + (source_ == null ? 0 : source_.hashCode); + + @override + String toString() => 'WebDTO[source_=$source_]'; + + Map toJson() { + final json = {}; + if (source_ != null) { + json[r'source'] = source_; + } + return json; + } + + /// Returns a new [WebDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static WebDTO fromJson(Map json) => json == null + ? null + : WebDTO( + source_: json[r'source'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => WebDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = WebDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of WebDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = WebDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/openapi-generator-cli-5.1.0.jar b/manager_api_old/openapi-generator-cli-5.1.0.jar similarity index 100% rename from manager_api/openapi-generator-cli-5.1.0.jar rename to manager_api_old/openapi-generator-cli-5.1.0.jar diff --git a/manager_api_old/pubspec.yaml b/manager_api_old/pubspec.yaml new file mode 100644 index 0000000..8a6a2bc --- /dev/null +++ b/manager_api_old/pubspec.yaml @@ -0,0 +1,20 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# + +name: 'managerapi' +version: '1.0.0' +description: 'OpenAPI API client' +authors: + - 'Author ' +homepage: 'homepage' +environment: + sdk: '>=2.0.0 <3.0.0' +dependencies: + http: '>=0.12.0 <0.13.0' + intl: '^0.16.1' + meta: '^1.1.8' + +dev_dependencies: + test: '>=1.3.0 <1.16.0' + diff --git a/manager_api/swagger.yaml b/manager_api_old/swagger.yaml similarity index 100% rename from manager_api/swagger.yaml rename to manager_api_old/swagger.yaml diff --git a/manager_api/swagger.yaml.bak b/manager_api_old/swagger.yaml.bak similarity index 100% rename from manager_api/swagger.yaml.bak rename to manager_api_old/swagger.yaml.bak diff --git a/manager_api_old/test/authentication_api_test.dart b/manager_api_old/test/authentication_api_test.dart new file mode 100644 index 0000000..36facc7 --- /dev/null +++ b/manager_api_old/test/authentication_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AuthenticationApi +void main() { + final instance = AuthenticationApi(); + + group('tests for AuthenticationApi', () { + //Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async + test('test authenticationAuthenticateWithForm', () async { + // TODO + }); + + //Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async + test('test authenticationAuthenticateWithJson', () async { + // TODO + }); + + }); +} diff --git a/manager_api_old/test/configuration_api_test.dart b/manager_api_old/test/configuration_api_test.dart new file mode 100644 index 0000000..66671d7 --- /dev/null +++ b/manager_api_old/test/configuration_api_test.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ConfigurationApi +void main() { + final instance = ConfigurationApi(); + + group('tests for ConfigurationApi', () { + //Future configurationCreate(ConfigurationDTO configurationDTO) async + test('test configurationCreate', () async { + // TODO + }); + + //Future configurationDelete(String id) async + test('test configurationDelete', () async { + // TODO + }); + + //Future> configurationGet() async + test('test configurationGet', () async { + // TODO + }); + + //Future configurationGetDetail(String id) async + test('test configurationGetDetail', () async { + // TODO + }); + + //Future configurationUpdate(ConfigurationDTO configurationDTO) async + test('test configurationUpdate', () async { + // TODO + }); + + }); +} diff --git a/manager_api_old/test/configuration_dto_test.dart b/manager_api_old/test/configuration_dto_test.dart new file mode 100644 index 0000000..083682b --- /dev/null +++ b/manager_api_old/test/configuration_dto_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConfigurationDTO +void main() { + final instance = ConfigurationDTO(); + + group('test ConfigurationDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String primaryColor + test('to test the property `primaryColor`', () async { + // TODO + }); + + // String secondaryColor + test('to test the property `secondaryColor`', () async { + // TODO + }); + + // List languages (default value: const []) + test('to test the property `languages`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/device_api_test.dart b/manager_api_old/test/device_api_test.dart new file mode 100644 index 0000000..d9267a1 --- /dev/null +++ b/manager_api_old/test/device_api_test.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for DeviceApi +void main() { + final instance = DeviceApi(); + + group('tests for DeviceApi', () { + //Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async + test('test deviceCreate', () async { + // TODO + }); + + //Future deviceDelete(String id) async + test('test deviceDelete', () async { + // TODO + }); + + //Future> deviceGet() async + test('test deviceGet', () async { + // TODO + }); + + //Future deviceGetDetail(String id) async + test('test deviceGetDetail', () async { + // TODO + }); + + //Future deviceUpdate(DeviceDetailDTO deviceDetailDTO) async + test('test deviceUpdate', () async { + // TODO + }); + + //Future deviceUpdateMainInfos(DeviceDTO deviceDTO) async + test('test deviceUpdateMainInfos', () async { + // TODO + }); + + }); +} diff --git a/manager_api_old/test/device_detail_dto_all_of_test.dart b/manager_api_old/test/device_detail_dto_all_of_test.dart new file mode 100644 index 0000000..52e846c --- /dev/null +++ b/manager_api_old/test/device_detail_dto_all_of_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTOAllOf +void main() { + final instance = DeviceDetailDTOAllOf(); + + group('test DeviceDetailDTOAllOf', () { + // String connectionLevel + test('to test the property `connectionLevel`', () async { + // TODO + }); + + // DateTime lastConnectionLevel + test('to test the property `lastConnectionLevel`', () async { + // TODO + }); + + // String batteryLevel + test('to test the property `batteryLevel`', () async { + // TODO + }); + + // DateTime lastBatteryLevel + test('to test the property `lastBatteryLevel`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/device_detail_dto_test.dart b/manager_api_old/test/device_detail_dto_test.dart new file mode 100644 index 0000000..6ad6492 --- /dev/null +++ b/manager_api_old/test/device_detail_dto_test.dart @@ -0,0 +1,76 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTO +void main() { + final instance = DeviceDetailDTO(); + + group('test DeviceDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // String configuration + test('to test the property `configuration`', () async { + // TODO + }); + + // bool connected + test('to test the property `connected`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // String connectionLevel + test('to test the property `connectionLevel`', () async { + // TODO + }); + + // DateTime lastConnectionLevel + test('to test the property `lastConnectionLevel`', () async { + // TODO + }); + + // String batteryLevel + test('to test the property `batteryLevel`', () async { + // TODO + }); + + // DateTime lastBatteryLevel + test('to test the property `lastBatteryLevel`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/device_dto_test.dart b/manager_api_old/test/device_dto_test.dart new file mode 100644 index 0000000..6557c52 --- /dev/null +++ b/manager_api_old/test/device_dto_test.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDTO +void main() { + final instance = DeviceDTO(); + + group('test DeviceDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // String configuration + test('to test the property `configuration`', () async { + // TODO + }); + + // bool connected + test('to test the property `connected`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/export_configuration_dto_all_of_test.dart b/manager_api_old/test/export_configuration_dto_all_of_test.dart new file mode 100644 index 0000000..b497052 --- /dev/null +++ b/manager_api_old/test/export_configuration_dto_all_of_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ExportConfigurationDTOAllOf +void main() { + final instance = ExportConfigurationDTOAllOf(); + + group('test ExportConfigurationDTOAllOf', () { + // List sections (default value: const []) + test('to test the property `sections`', () async { + // TODO + }); + + // List resources (default value: const []) + test('to test the property `resources`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/export_configuration_dto_test.dart b/manager_api_old/test/export_configuration_dto_test.dart new file mode 100644 index 0000000..adc2fb5 --- /dev/null +++ b/manager_api_old/test/export_configuration_dto_test.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ExportConfigurationDTO +void main() { + final instance = ExportConfigurationDTO(); + + group('test ExportConfigurationDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String primaryColor + test('to test the property `primaryColor`', () async { + // TODO + }); + + // String secondaryColor + test('to test the property `secondaryColor`', () async { + // TODO + }); + + // List languages (default value: const []) + test('to test the property `languages`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // List sections (default value: const []) + test('to test the property `sections`', () async { + // TODO + }); + + // List resources (default value: const []) + test('to test the property `resources`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/geo_point_dto_test.dart b/manager_api_old/test/geo_point_dto_test.dart new file mode 100644 index 0000000..e274af9 --- /dev/null +++ b/manager_api_old/test/geo_point_dto_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GeoPointDTO +void main() { + final instance = GeoPointDTO(); + + group('test GeoPointDTO', () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // List images (default value: const []) + test('to test the property `images`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/image_dto_test.dart b/manager_api_old/test/image_dto_test.dart new file mode 100644 index 0000000..3d051c5 --- /dev/null +++ b/manager_api_old/test/image_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ImageDTO +void main() { + final instance = ImageDTO(); + + group('test ImageDTO', () { + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/image_geo_point_test.dart b/manager_api_old/test/image_geo_point_test.dart new file mode 100644 index 0000000..527fe9c --- /dev/null +++ b/manager_api_old/test/image_geo_point_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ImageGeoPoint +void main() { + final instance = ImageGeoPoint(); + + group('test ImageGeoPoint', () { + // String imageResourceId + test('to test the property `imageResourceId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/level_dto_test.dart b/manager_api_old/test/level_dto_test.dart new file mode 100644 index 0000000..9120f3b --- /dev/null +++ b/manager_api_old/test/level_dto_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for LevelDTO +void main() { + final instance = LevelDTO(); + + group('test LevelDTO', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/login_dto_test.dart b/manager_api_old/test/login_dto_test.dart new file mode 100644 index 0000000..b313772 --- /dev/null +++ b/manager_api_old/test/login_dto_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for LoginDTO +void main() { + final instance = LoginDTO(); + + group('test LoginDTO', () { + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/map_dto_test.dart b/manager_api_old/test/map_dto_test.dart new file mode 100644 index 0000000..5775d96 --- /dev/null +++ b/manager_api_old/test/map_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MapDTO +void main() { + final instance = MapDTO(); + + group('test MapDTO', () { + // int zoom + test('to test the property `zoom`', () async { + // TODO + }); + + // MapType mapType + test('to test the property `mapType`', () async { + // TODO + }); + + // List points (default value: const []) + test('to test the property `points`', () async { + // TODO + }); + + // String iconResourceId + test('to test the property `iconResourceId`', () async { + // TODO + }); + + // String iconSource + test('to test the property `iconSource`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/map_type_app_test.dart b/manager_api_old/test/map_type_app_test.dart new file mode 100644 index 0000000..4145313 --- /dev/null +++ b/manager_api_old/test/map_type_app_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MapTypeApp +void main() { + + group('test MapTypeApp', () { + + }); + +} diff --git a/manager_api/test/map_type_test.dart b/manager_api_old/test/map_type_test.dart similarity index 100% rename from manager_api/test/map_type_test.dart rename to manager_api_old/test/map_type_test.dart diff --git a/manager_api_old/test/menu_dto_test.dart b/manager_api_old/test/menu_dto_test.dart new file mode 100644 index 0000000..9414c07 --- /dev/null +++ b/manager_api_old/test/menu_dto_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MenuDTO +void main() { + final instance = MenuDTO(); + + group('test MenuDTO', () { + // List sections (default value: const []) + test('to test the property `sections`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/player_message_dto_test.dart b/manager_api_old/test/player_message_dto_test.dart new file mode 100644 index 0000000..44cd9f8 --- /dev/null +++ b/manager_api_old/test/player_message_dto_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PlayerMessageDTO +void main() { + final instance = PlayerMessageDTO(); + + group('test PlayerMessageDTO', () { + // bool configChanged + test('to test the property `configChanged`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/question_dto_test.dart b/manager_api_old/test/question_dto_test.dart new file mode 100644 index 0000000..e4e2f99 --- /dev/null +++ b/manager_api_old/test/question_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for QuestionDTO +void main() { + final instance = QuestionDTO(); + + group('test QuestionDTO', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // List responses (default value: const []) + test('to test the property `responses`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/quizz_dto_test.dart b/manager_api_old/test/quizz_dto_test.dart new file mode 100644 index 0000000..e30067d --- /dev/null +++ b/manager_api_old/test/quizz_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for QuizzDTO +void main() { + final instance = QuizzDTO(); + + group('test QuizzDTO', () { + // List questions (default value: const []) + test('to test the property `questions`', () async { + // TODO + }); + + // OneOfLevelDTO badLevel + test('to test the property `badLevel`', () async { + // TODO + }); + + // OneOfLevelDTO mediumLevel + test('to test the property `mediumLevel`', () async { + // TODO + }); + + // OneOfLevelDTO goodLevel + test('to test the property `goodLevel`', () async { + // TODO + }); + + // OneOfLevelDTO greatLevel + test('to test the property `greatLevel`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/resource_api_test.dart b/manager_api_old/test/resource_api_test.dart new file mode 100644 index 0000000..eade329 --- /dev/null +++ b/manager_api_old/test/resource_api_test.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ResourceApi +void main() { + final instance = ResourceApi(); + + group('tests for ResourceApi', () { + //Future resourceCreate(ResourceDetailDTO resourceDetailDTO) async + test('test resourceCreate', () async { + // TODO + }); + + //Future resourceDelete(String id) async + test('test resourceDelete', () async { + // TODO + }); + + //Future> resourceGet() async + test('test resourceGet', () async { + // TODO + }); + + //Future resourceGetDetail(String id) async + test('test resourceGetDetail', () async { + // TODO + }); + + //Future resourceShow(String id) async + test('test resourceShow', () async { + // TODO + }); + + //Future resourceUpdate(ResourceDetailDTO resourceDetailDTO) async + test('test resourceUpdate', () async { + // TODO + }); + + //Future resourceUpload({ String label, String type }) async + test('test resourceUpload', () async { + // TODO + }); + + }); +} diff --git a/manager_api/test/resource_detail_dto_test.dart b/manager_api_old/test/resource_detail_dto_test.dart similarity index 100% rename from manager_api/test/resource_detail_dto_test.dart rename to manager_api_old/test/resource_detail_dto_test.dart diff --git a/manager_api_old/test/resource_dto_test.dart b/manager_api_old/test/resource_dto_test.dart new file mode 100644 index 0000000..7001e72 --- /dev/null +++ b/manager_api_old/test/resource_dto_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ResourceDTO +void main() { + final instance = ResourceDTO(); + + group('test ResourceDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // ResourceType type + test('to test the property `type`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/resource_type_test.dart b/manager_api_old/test/resource_type_test.dart new file mode 100644 index 0000000..d96076b --- /dev/null +++ b/manager_api_old/test/resource_type_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ResourceType +void main() { + + group('test ResourceType', () { + + }); + +} diff --git a/manager_api_old/test/response_dto_test.dart b/manager_api_old/test/response_dto_test.dart new file mode 100644 index 0000000..e96de00 --- /dev/null +++ b/manager_api_old/test/response_dto_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ResponseDTO +void main() { + final instance = ResponseDTO(); + + group('test ResponseDTO', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // bool isGood + test('to test the property `isGood`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/section_api_test.dart b/manager_api_old/test/section_api_test.dart new file mode 100644 index 0000000..e830b11 --- /dev/null +++ b/manager_api_old/test/section_api_test.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for SectionApi +void main() { + final instance = SectionApi(); + + group('tests for SectionApi', () { + //Future sectionCreate(SectionDTO sectionDTO) async + test('test sectionCreate', () async { + // TODO + }); + + //Future sectionDelete(String id) async + test('test sectionDelete', () async { + // TODO + }); + + //Future sectionDeleteAllForConfiguration(String id) async + test('test sectionDeleteAllForConfiguration', () async { + // TODO + }); + + //Future> sectionGet() async + test('test sectionGet', () async { + // TODO + }); + + //Future> sectionGetAllSectionSubSections(String id) async + test('test sectionGetAllSectionSubSections', () async { + // TODO + }); + + //Future sectionGetDetail(String id) async + test('test sectionGetDetail', () async { + // TODO + }); + + //Future> sectionGetFromConfiguration(String id) async + test('test sectionGetFromConfiguration', () async { + // TODO + }); + + //Future sectionGetMapDTO() async + test('test sectionGetMapDTO', () async { + // TODO + }); + + //Future sectionGetMenuDTO() async + test('test sectionGetMenuDTO', () async { + // TODO + }); + + //Future sectionGetSliderDTO() async + test('test sectionGetSliderDTO', () async { + // TODO + }); + + //Future sectionGetVideoDTO() async + test('test sectionGetVideoDTO', () async { + // TODO + }); + + //Future sectionGetWebDTO() async + test('test sectionGetWebDTO', () async { + // TODO + }); + + //Future sectionUpdate(SectionDTO sectionDTO) async + test('test sectionUpdate', () async { + // TODO + }); + + //Future sectionUpdateOrder(List sectionDTO) async + test('test sectionUpdateOrder', () async { + // TODO + }); + + }); +} diff --git a/manager_api_old/test/section_dto_test.dart b/manager_api_old/test/section_dto_test.dart new file mode 100644 index 0000000..1bb51a7 --- /dev/null +++ b/manager_api_old/test/section_dto_test.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionDTO +void main() { + final instance = SectionDTO(); + + group('test SectionDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // bool isSubSection + test('to test the property `isSubSection`', () async { + // TODO + }); + + // String parentId + test('to test the property `parentId`', () async { + // TODO + }); + + // SectionType type + test('to test the property `type`', () async { + // TODO + }); + + // String data + test('to test the property `data`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/section_type_test.dart b/manager_api_old/test/section_type_test.dart new file mode 100644 index 0000000..f0b8fb6 --- /dev/null +++ b/manager_api_old/test/section_type_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionType +void main() { + + group('test SectionType', () { + + }); + +} diff --git a/manager_api_old/test/slider_dto_test.dart b/manager_api_old/test/slider_dto_test.dart new file mode 100644 index 0000000..19da350 --- /dev/null +++ b/manager_api_old/test/slider_dto_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SliderDTO +void main() { + final instance = SliderDTO(); + + group('test SliderDTO', () { + // List images (default value: const []) + test('to test the property `images`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/token_dto_test.dart b/manager_api_old/test/token_dto_test.dart new file mode 100644 index 0000000..df90e8c --- /dev/null +++ b/manager_api_old/test/token_dto_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TokenDTO +void main() { + final instance = TokenDTO(); + + group('test TokenDTO', () { + // String accessToken + test('to test the property `accessToken`', () async { + // TODO + }); + + // String refreshToken + test('to test the property `refreshToken`', () async { + // TODO + }); + + // String scope + test('to test the property `scope`', () async { + // TODO + }); + + // String tokenType + test('to test the property `tokenType`', () async { + // TODO + }); + + // int expiresIn + test('to test the property `expiresIn`', () async { + // TODO + }); + + // DateTime expiration + test('to test the property `expiration`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/translation_dto_test.dart b/manager_api_old/test/translation_dto_test.dart new file mode 100644 index 0000000..46f0c5e --- /dev/null +++ b/manager_api_old/test/translation_dto_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TranslationDTO +void main() { + final instance = TranslationDTO(); + + group('test TranslationDTO', () { + // String language + test('to test the property `language`', () async { + // TODO + }); + + // String value + test('to test the property `value`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/user_api_test.dart b/manager_api_old/test/user_api_test.dart new file mode 100644 index 0000000..9edeebe --- /dev/null +++ b/manager_api_old/test/user_api_test.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + final instance = UserApi(); + + group('tests for UserApi', () { + //Future userCreateUser(User user) async + test('test userCreateUser', () async { + // TODO + }); + + //Future userDeleteUser(String id) async + test('test userDeleteUser', () async { + // TODO + }); + + //Future> userGet() async + test('test userGet', () async { + // TODO + }); + + //Future userGetDetail(String id) async + test('test userGetDetail', () async { + // TODO + }); + + //Future userUpdateUser(User user) async + test('test userUpdateUser', () async { + // TODO + }); + + }); +} diff --git a/manager_api_old/test/user_detail_dto_test.dart b/manager_api_old/test/user_detail_dto_test.dart new file mode 100644 index 0000000..c52b019 --- /dev/null +++ b/manager_api_old/test/user_detail_dto_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for UserDetailDTO +void main() { + final instance = UserDetailDTO(); + + group('test UserDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/user_test.dart b/manager_api_old/test/user_test.dart new file mode 100644 index 0000000..6b22208 --- /dev/null +++ b/manager_api_old/test/user_test.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + final instance = User(); + + group('test User', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String token + test('to test the property `token`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/video_dto_test.dart b/manager_api_old/test/video_dto_test.dart new file mode 100644 index 0000000..ac0e810 --- /dev/null +++ b/manager_api_old/test/video_dto_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for VideoDTO +void main() { + final instance = VideoDTO(); + + group('test VideoDTO', () { + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_old/test/web_dto_test.dart b/manager_api_old/test/web_dto_test.dart new file mode 100644 index 0000000..cdbc614 --- /dev/null +++ b/manager_api_old/test/web_dto_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for WebDTO +void main() { + final instance = WebDTO(); + + group('test WebDTO', () { + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/pubspec.lock b/pubspec.lock index 2d922a9..9183599 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,151 +1,292 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "37bb1e815e15fbeefe916e4c941ef070f2f64d15a7eacc3cc0f6e8847b62319c" + url: "https://pub.dev" + source: hosted + version: "48.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: c50aea66893c20d44c365d4269983a74a5c1a4055b7b78f38fbf0e24f519b6a2 + url: "https://pub.dev" + source: hosted + version: "5.0.0" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: ed7cc591a948744994714375caf9a2ce89e1d82e8243997c8a2994d57181c212 + url: "https://pub.dev" source: hosted - version: "3.3.2" + version: "3.3.5" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: "139d809800a412ebb26a3892da228b2d0ba36f0ef5d9a82166e5e52ec8d61611" + url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" auto_size_text: dependency: "direct main" description: name: auto_size_text - url: "https://pub.dartlang.org" + sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" + url: "https://pub.dev" source: hosted version: "3.0.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "687cf90a3951affac1bd5f9ecb5e3e90b60487f3d9cdc359bb310f8876bb02a6" + url: "https://pub.dev" + source: hosted + version: "2.0.10" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: a3335cae313ea41f193e5637f98185e5cb37b3fde2c5c4654ac546b8164e59ac + url: "https://pub.dev" + source: hosted + version: "2.4.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + url: "https://pub.dev" + source: hosted + version: "7.2.7" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725" + url: "https://pub.dev" + source: hosted + version: "8.4.3" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.dartlang.org" + sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42" + url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.2.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + url: "https://pub.dev" source: hosted version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" + url: "https://pub.dev" + source: hosted + version: "4.4.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" confetti: dependency: "direct main" description: name: confetti - url: "https://pub.dartlang.org" + sha256: "979aafde2428c53947892c95eb244466c109c129b7eee9011f0a66caaca52267" + url: "https://pub.dev" source: hosted version: "0.7.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" + csslib: + dependency: transitive + description: + name: csslib + sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + url: "https://pub.dev" + source: hosted + version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" + url: "https://pub.dev" + source: hosted + version: "2.2.4" device_info: dependency: "direct main" description: name: device_info - url: "https://pub.dartlang.org" + sha256: f4a8156cb7b7480d969cb734907d18b333c8f0bc0b1ad0b342cdcecf30d62c48 + url: "https://pub.dev" source: hosted version: "2.0.3" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface - url: "https://pub.dartlang.org" + sha256: b148e0bf9640145d09a4f8dea96614076f889e7f7f8b5ecab1c7e5c2dbc73c1b + url: "https://pub.dev" source: hosted version: "2.0.1" enum_to_string: dependency: "direct main" description: name: enum_to_string - url: "https://pub.dartlang.org" + sha256: bd9e83a33b754cb43a75b36a9af2a0b92a757bfd9847d2621ca0b1bed45f8e7a + url: "https://pub.dev" source: hosted version: "2.0.1" event_bus: dependency: transitive description: name: event_bus - url: "https://pub.dartlang.org" + sha256: "44baa799834f4c803921873e7446a2add0f3efa45e101a054b1f0ab9b95f8edc" + url: "https://pub.dev" source: hosted version: "2.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + url: "https://pub.dev" + source: hosted + version: "1.0.1" flare_flutter: dependency: "direct main" description: name: flare_flutter - url: "https://pub.dartlang.org" + sha256: "99d63c60f00fac81249ce6410ee015d7b125c63d8278a30da81edf3317a1f6a0" + url: "https://pub.dev" source: hosted version: "3.0.2" flutter: @@ -157,21 +298,24 @@ packages: dependency: transitive description: name: flutter_inappwebview - url: "https://pub.dartlang.org" + sha256: f73505c792cf083d5566e1a94002311be497d984b5607f25be36d685cf6361cf + url: "https://pub.dev" source: hosted - version: "5.7.1" + version: "5.7.2+3" flutter_launcher_icons: dependency: "direct main" description: name: flutter_launcher_icons - url: "https://pub.dartlang.org" + sha256: a9de6706cd844668beac27c0aed5910fa0534832b3c2cad61a5fd977fce82a5d + url: "https://pub.dev" source: hosted version: "0.10.0" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" + url: "https://pub.dev" source: hosted version: "2.0.7" flutter_test: @@ -188,80 +332,171 @@ packages: dependency: "direct main" description: name: fluttertoast - url: "https://pub.dartlang.org" + sha256: "7cc92eabe01e3f1babe1571c5560b135dfc762a34e41e9056881e2196b178ec1" + url: "https://pub.dev" source: hosted - version: "8.1.1" + version: "8.1.2" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + glob: + dependency: transitive + description: + name: glob + sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + google_maps: + dependency: transitive + description: + name: google_maps + sha256: eb20a162d642599a05179e2d155b9e803899cb377764fdec9044fa7fa474bfb8 + url: "https://pub.dev" + source: hosted + version: "6.2.0" google_maps_flutter: dependency: "direct main" description: name: google_maps_flutter - url: "https://pub.dartlang.org" + sha256: "0c6b72b4b1e0f6204973e2b40868a75fe6380725d498f215cd7e35ed920d1c57" + url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.3" google_maps_flutter_android: dependency: transitive description: name: google_maps_flutter_android - url: "https://pub.dartlang.org" + sha256: "701761b234579b4cfc0f6ae0791e2bb7184b31207b0d716e536b6d1a190dc143" + url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.3" google_maps_flutter_ios: dependency: transitive description: name: google_maps_flutter_ios - url: "https://pub.dartlang.org" + sha256: "33bbca8d4148ed373251ea2ec2344fdc63009926b6d6be71a0854fd42409b1ba" + url: "https://pub.dev" source: hosted - version: "2.1.12" + version: "2.1.13" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface - url: "https://pub.dartlang.org" + sha256: "0967430c25240836b794d42336bd4c61f0e78e9fd33d1365fa9316bb36b6b410" + url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.2.5" + google_maps_flutter_web: + dependency: "direct main" + description: + name: google_maps_flutter_web + sha256: a3c05ec5921885c38196f1bd264a445a698db34f1b5dcbc515add49803bf455d + url: "https://pub.dev" + source: hosted + version: "0.4.0+5" + graphs: + dependency: transitive + description: + name: graphs + sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + html: + dependency: transitive + description: + name: html + sha256: d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 + url: "https://pub.dev" + source: hosted + version: "0.15.1" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" source: hosted - version: "0.12.2" + version: "0.13.5" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "4.0.2" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6" + url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "3.3.0" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" source: hosted - version: "0.16.1" + version: "0.17.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "323b7c70073cccf6b9b8d8b334be418a3293cfb612a560dc2737160a37bf61bd" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.6" + js_wrapping: + dependency: transitive + description: + name: js_wrapping + sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c + url: "https://pub.dev" + source: hosted + version: "0.7.4" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + url: "https://pub.dev" source: hosted - version: "4.7.0" - managerapi: + version: "4.8.0" + logging: + dependency: transitive + description: + name: logging + sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946 + url: "https://pub.dev" + source: hosted + version: "1.1.0" + manager_api: dependency: "direct main" description: path: manager_api @@ -272,217 +507,455 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8 + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.14" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" mqtt_client: dependency: "direct main" description: name: mqtt_client - url: "https://pub.dartlang.org" + sha256: f9c8f9179031f34e6ec2b07485e9f4db5921d6b32d83462618fa1e93ad1c6743 + url: "https://pub.dev" source: hosted - version: "9.6.8" + version: "9.7.4" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" + openapi_generator: + dependency: "direct main" + description: + name: openapi_generator + sha256: "2c9cf35d91a26330f09ec4a2370f07c5e3040921bd3f33751ba36ac4d2346dc0" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + openapi_generator_annotations: + dependency: "direct main" + description: + name: openapi_generator_annotations + sha256: "1745b86b57943c5a09647c37dd909da61060ad65a0d3d3e48bef58f9c1eebb32" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + openapi_generator_cli: + dependency: "direct main" + description: + name: openapi_generator_cli + sha256: "5d558ea599202dc487f829193b0ba0f28a0e7ad559e819a611b2146ef20c77f5" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" + version: "1.8.3" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.0" photo_view: dependency: "direct main" description: name: photo_view - url: "https://pub.dartlang.org" + sha256: "8036802a00bae2a78fc197af8a158e3e2f7b500561ed23b4c458107685e645bb" + url: "https://pub.dev" source: hosted version: "0.14.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + url: "https://pub.dev" source: hosted version: "2.1.3" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" source: hosted - version: "6.0.4" + version: "6.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + sanitize_html: + dependency: transitive + description: + name: sanitize_html + sha256: "0a445f19bbaa196f5a4f93461aa066b94e6e025622eb1e9bc77872a5e25233a5" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + shelf: + dependency: transitive + description: + name: shelf + sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + url: "https://pub.dev" + source: hosted + version: "1.4.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + url: "https://pub.dev" + source: hosted + version: "1.0.3" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "2d79738b6bbf38a43920e2b8d189e9a3ce6cc201f4b8fc76be5e4fe377b1c38d" + url: "https://pub.dev" + source: hosted + version: "1.2.6" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.1" sqflite: dependency: "direct main" description: name: sqflite - url: "https://pub.dartlang.org" + sha256: "067ab48dbc66bae05e18073a604443baa35957101bd3905b94f65e764c6d0688" + url: "https://pub.dev" source: hosted - version: "2.0.3+1" + version: "2.2.3" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: b2ed22d1d62c944ec0dac5cc687ae99cb3331c3ebe146d726ed24704634b5ccd + url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b" + url: "https://pub.dev" source: hosted - version: "3.0.0+3" + version: "3.0.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d" + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.4.18" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted version: "1.3.1" + url_launcher: + dependency: transitive + description: + name: url_launcher + sha256: "698fa0b4392effdc73e9e184403b627362eb5fbf904483ac9defbb1c2191d809" + url: "https://pub.dev" + source: hosted + version: "6.1.8" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" + url: "https://pub.dev" + source: hosted + version: "6.0.23" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: bb328b24d3bccc20bdf1024a0990ac4f869d57663660de9c936fb8c043edefe3 + url: "https://pub.dev" + source: hosted + version: "6.0.18" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" + url: "https://pub.dev" + source: hosted + version: "2.0.14" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "387e227c4b979034cc52afb11d66b04ed9b288ca1f45beeef39b2ea69e714fa5" + url: "https://pub.dev" + source: hosted + version: "3.0.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b + url: "https://pub.dev" + source: hosted + version: "2.3.0" webview_flutter: dependency: "direct main" description: name: webview_flutter - url: "https://pub.dartlang.org" + sha256: f7ec234830f86d0ef2bd664e8460b0038b8c1a83ff076035cad74ac70273753c + url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "4.0.2" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - url: "https://pub.dartlang.org" + sha256: "9d97fa2bae0f1900553c48a2ef0aaa3864367fd7bb625d683c460754b691312c" + url: "https://pub.dev" source: hosted - version: "2.10.4" + version: "3.2.1" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface - url: "https://pub.dartlang.org" + sha256: "8b2262dda5d26eabc600a7282a8c16a9473a0c765526afb0ffc33eef912f7968" + url: "https://pub.dev" source: hosted - version: "1.9.5" + version: "2.0.1" + webview_flutter_web: + dependency: "direct main" + description: + name: webview_flutter_web + sha256: d9d751a95add61aa87616aa88d7fceb7b8dbd15f1d17145ca3edae95572e9a92 + url: "https://pub.dev" + source: hosted + version: "0.2.1" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview - url: "https://pub.dartlang.org" + sha256: "523aff9168af9bb2170e4809e0499d7dee065c3919799fd3341d3e616c137960" + url: "https://pub.dev" source: hosted - version: "2.9.5" + version: "3.0.2" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.2.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted version: "3.1.1" youtube_player_flutter: dependency: "direct main" description: name: youtube_player_flutter - url: "https://pub.dartlang.org" + sha256: "72d487e1a1b9155a2dc9d448c137380791101a0ff623723195275ac275ac6942" + url: "https://pub.dev" source: hosted - version: "8.1.1" + version: "8.1.2" + youtube_player_iframe: + dependency: "direct main" + description: + name: youtube_player_iframe + sha256: "704bc2925c33d40f7a37341a11d2b1caa8128b398b5fa59b0d4619688ca19f1e" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + youtube_player_iframe_web: + dependency: transitive + description: + name: youtube_player_iframe_web + sha256: "343d9c0e2f03e2755b8b8211a9974456e0ded0a6994a09ca533c191277713962" + url: "https://pub.dev" + source: hosted + version: "2.0.0" sdks: - dart: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" + dart: ">=3.0.0-134.0.dev <4.0.0" + flutter: ">=3.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index 23bfd9c..a48467f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,38 +18,52 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.4.0+4 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.17.0 <3.0.0" dependencies: flutter: sdk: flutter - sqflite: - webview_flutter: ^3.0.4 - google_maps_flutter: ^2.0.1 + + # Specific Mobile + sqflite: # Specific mobile and macOS + webview_flutter: ^4.0.1 # Specific mobile # old : ^3.0.4 + google_maps_flutter: ^2.0.1 # Specific mobile + youtube_player_flutter: ^8.1.1 # Specific mobile + + # Specific Web + webview_flutter_web: ^0.2.1 # Specific WEB + google_maps_flutter_web: ^0.4.0+5 # Specific WEB + youtube_player_iframe: ^4.0.1 # Handle mobile and web here => TO TEST + flare_flutter: ^3.0.1 provider: ^6.0.4 - http: ^0.12.2 + http: ^0.13.5 auto_size_text: ^3.0.0 fluttertoast: - device_info: ^2.0.2 + device_info: ^2.0.2 # DISCONTINUED enum_to_string: ^2.0.1 carousel_slider: ^4.0.0 - youtube_player_flutter: ^8.1.1 mqtt_client: ^9.6.8 photo_view: ^0.14.0 confetti: ^0.7.0 - flutter_launcher_icons: ^0.10.0 + flutter_launcher_icons: ^0.10.0 # All but web + openapi_generator_cli: ^4.0.0 + openapi_generator: ^4.0.0 + openapi_generator_annotations: ^4.0.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 - managerapi: + manager_api: path: manager_api dev_dependencies: flutter_test: sdk: flutter + build_runner: + openapi_generator: ^4.0.0 + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -70,7 +84,7 @@ flutter: - assets/icons/ - assets/images/ - assets/animations/ - - assets/files/ + # - assets/files/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..4f78848 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..88b22e5 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST