From 7c1f562870f98482e18a52b71a3648e772ba1c97 Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Fri, 17 Mar 2023 18:09:59 +0100 Subject: [PATCH] Update flutter version + upgrade packages + use openapi gen + update to null safety --- README.md | 20 + android/app/build.gradle | 50 +- android/app/version.properties | 5 + lib/Components/Buttons/rounded_button.dart | 35 +- .../custom_nav_item.dart | 2 +- lib/Components/loading.dart | 2 +- lib/Components/rounded_input_field.dart | 12 +- lib/Components/rounded_password_field.dart | 4 +- lib/Components/text_field_container.dart | 4 +- lib/Helpers/DatabaseHelper.dart | 27 +- lib/Helpers/MQTTHelper.dart | 20 +- lib/Models/homieContext.dart | 17 +- lib/Screens/Debug/DebugPage.dart | 2 +- lib/Screens/Login/components/background.dart | 4 +- lib/Screens/Login/components/body.dart | 56 +- lib/Screens/Main/Automations/automations.dart | 2 +- lib/Screens/Main/Energy/energy.dart | 2 +- lib/Screens/Main/Home/home.dart | 34 +- lib/Screens/Main/MainPage.dart | 2 +- lib/Screens/Main/Profile/profile.dart | 2 +- lib/Screens/Main/Security/security.dart | 2 +- lib/api/openApiTest.dart | 15 + lib/api/swagger.yaml | 4888 +++++++++++++++++ lib/app_context.dart | 2 +- lib/client.dart | 51 +- lib/main.dart | 12 +- linux/flutter/generated_plugins.cmake | 8 + mycore_api/.gitignore | 32 +- mycore_api/.openapi-generator/FILES | 127 + mycore_api/.openapi-generator/VERSION | 2 +- mycore_api/.travis.yml | 2 +- mycore_api/README.md | 24 +- mycore_api/analysis_options.yaml | 0 mycore_api/doc/Action.md | 4 +- mycore_api/doc/ActionType.md | 4 +- mycore_api/doc/AlarmApi.md | 54 +- mycore_api/doc/AlarmMode.md | 8 +- .../doc/AlarmModeCreateOrUpdateDetailDTO.md | 4 +- .../AlarmModeCreateOrUpdateDetailDTOAllOf.md | 4 +- mycore_api/doc/AlarmModeDTO.md | 4 +- mycore_api/doc/AlarmModeDetailDTO.md | 4 +- mycore_api/doc/AlarmModeDetailDTOAllOf.md | 4 +- mycore_api/doc/AlarmModeGeolocalizedMode.md | 18 + mycore_api/doc/AlarmModeProgrammedMode.md | 21 + mycore_api/doc/AlarmTriggered.md | 4 +- mycore_api/doc/AlarmType.md | 4 +- mycore_api/doc/AuthenticationApi.md | 18 +- mycore_api/doc/AutomationApi.md | 42 +- mycore_api/doc/AutomationDTO.md | 4 +- mycore_api/doc/AutomationDetailDTO.md | 4 +- mycore_api/doc/AutomationDetailDTOAllOf.md | 4 +- mycore_api/doc/AutomationState.md | 4 +- mycore_api/doc/AutomationTriggered.md | 4 +- mycore_api/doc/AzureADAuthModel.md | 4 +- mycore_api/doc/AzureApi.md | 12 +- mycore_api/doc/Book.md | 4 +- mycore_api/doc/BooksApi.md | 36 +- mycore_api/doc/Condition.md | 6 +- mycore_api/doc/ConditionState.md | 16 + mycore_api/doc/ConditionType.md | 4 +- mycore_api/doc/ConditionValue.md | 4 +- mycore_api/doc/ConnectionStatus.md | 4 +- mycore_api/doc/CreateOrUpdateHomeDTO.md | 6 +- mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md | 4 +- mycore_api/doc/DeviceApi.md | 78 +- mycore_api/doc/DeviceDetailDTO.md | 4 +- mycore_api/doc/DeviceDetailDTOAllOf.md | 4 +- mycore_api/doc/DeviceState.md | 4 +- mycore_api/doc/DeviceSummaryDTO.md | 4 +- mycore_api/doc/DeviceType.md | 4 +- mycore_api/doc/ElectricityProduction.md | 4 +- mycore_api/doc/EnergyApi.md | 12 +- mycore_api/doc/EventApi.md | 38 +- mycore_api/doc/EventDTO.md | 4 +- mycore_api/doc/EventDetailDTO.md | 4 +- mycore_api/doc/EventDetailDTOAllOf.md | 4 +- mycore_api/doc/EventFilter.md | 8 +- mycore_api/doc/EventGetDeviceTypeParameter.md | 14 + mycore_api/doc/EventGetEventTypeParameter.md | 14 + mycore_api/doc/EventHomeFilter.md | 8 +- mycore_api/doc/EventHomeFilterAllOf.md | 4 +- mycore_api/doc/EventType.md | 4 +- mycore_api/doc/FacebookApi.md | 12 +- mycore_api/doc/FacebookAuthModel.md | 4 +- mycore_api/doc/GeolocalizedMode.md | 8 +- mycore_api/doc/GoogleApi.md | 12 +- mycore_api/doc/GoogleAuthModel.md | 4 +- mycore_api/doc/GroupApi.md | 66 +- .../doc/GroupCreateOrUpdateDetailDTO.md | 4 +- .../doc/GroupCreateOrUpdateDetailDTOAllOf.md | 4 +- mycore_api/doc/GroupDetailDTO.md | 4 +- mycore_api/doc/GroupDetailDTOAllOf.md | 4 +- mycore_api/doc/GroupSummaryDTO.md | 4 +- mycore_api/doc/HomeApi.md | 36 +- mycore_api/doc/HomeDTO.md | 6 +- mycore_api/doc/HomeDTOCurrentAlarmMode.md | 23 + mycore_api/doc/HomeDetailDTO.md | 6 +- mycore_api/doc/HomeDetailDTOAllOf.md | 4 +- mycore_api/doc/IOTApi.md | 24 +- mycore_api/doc/LayoutApi.md | 12 +- ...ponseOfEventDetailDTOAndEventHomeFilter.md | 6 +- ...lDTOAndEventHomeFilterRequestParameters.md | 22 + mycore_api/doc/LoginDTO.md | 4 +- mycore_api/doc/MQTTApi.md | 12 +- mycore_api/doc/MeansOfCommunication.md | 4 +- mycore_api/doc/MqttMessageDTO.md | 4 +- mycore_api/doc/OddApi.md | 18 +- mycore_api/doc/OddNice.md | 6 +- mycore_api/doc/OddNiceOdds.md | 17 + mycore_api/doc/OddObject.md | 4 +- mycore_api/doc/PanelMenuItem.md | 4 +- mycore_api/doc/PanelSection.md | 4 +- mycore_api/doc/ProgrammedMode.md | 4 +- mycore_api/doc/ProviderApi.md | 30 +- mycore_api/doc/ProviderDTO.md | 4 +- mycore_api/doc/ProviderType.md | 4 +- mycore_api/doc/RoomApi.md | 60 +- mycore_api/doc/RoomCreateOrUpdateDetailDTO.md | 4 +- mycore_api/doc/RoomDetailDTO.md | 4 +- mycore_api/doc/RoomMainDetailDTO.md | 4 +- mycore_api/doc/RoomMainDetailDTOAllOf.md | 4 +- mycore_api/doc/RoomSummaryDTO.md | 4 +- mycore_api/doc/ScreenDevice.md | 4 +- mycore_api/doc/ScreenDeviceApi.md | 36 +- mycore_api/doc/SmartGardenMessage.md | 4 +- mycore_api/doc/SmartPrinterMessage.md | 4 +- mycore_api/doc/TimePeriodAlarm.md | 6 +- mycore_api/doc/TimePeriodAlarmAlarmMode.md | 28 + mycore_api/doc/TokenApi.md | 18 +- mycore_api/doc/TokenDTO.md | 4 +- mycore_api/doc/Trigger.md | 4 +- mycore_api/doc/TriggerType.md | 4 +- mycore_api/doc/TwitterApi.md | 12 +- mycore_api/doc/TwitterAuthModel.md | 4 +- mycore_api/doc/User.md | 4 +- mycore_api/doc/UserApi.md | 42 +- mycore_api/doc/UserInfo.md | 4 +- mycore_api/doc/UserInfoDetailDTO.md | 4 +- mycore_api/doc/ValuesApi.md | 36 +- mycore_api/doc/ViewBy.md | 4 +- mycore_api/git_push.sh | 7 +- mycore_api/lib/api.dart | 8 +- mycore_api/lib/api/alarm_api.dart | 386 +- mycore_api/lib/api/authentication_api.dart | 152 +- mycore_api/lib/api/automation_api.dart | 290 +- mycore_api/lib/api/azure_api.dart | 51 +- mycore_api/lib/api/books_api.dart | 236 +- mycore_api/lib/api/device_api.dart | 605 +- mycore_api/lib/api/energy_api.dart | 53 +- mycore_api/lib/api/event_api.dart | 221 +- mycore_api/lib/api/facebook_api.dart | 51 +- mycore_api/lib/api/google_api.dart | 51 +- mycore_api/lib/api/group_api.dart | 495 +- mycore_api/lib/api/home_api.dart | 242 +- mycore_api/lib/api/iot_api.dart | 158 +- mycore_api/lib/api/layout_api.dart | 43 +- mycore_api/lib/api/mqtt_api.dart | 51 +- mycore_api/lib/api/odd_api.dart | 108 +- mycore_api/lib/api/provider_api.dart | 194 +- mycore_api/lib/api/room_api.dart | 443 +- mycore_api/lib/api/screen_device_api.dart | 231 +- mycore_api/lib/api/token_api.dart | 97 +- mycore_api/lib/api/twitter_api.dart | 51 +- mycore_api/lib/api/user_api.dart | 279 +- mycore_api/lib/api/values_api.dart | 209 +- mycore_api/lib/api_client.dart | 284 +- mycore_api/lib/api_exception.dart | 10 +- mycore_api/lib/api_helper.dart | 80 +- mycore_api/lib/auth/api_key_auth.dart | 29 +- mycore_api/lib/auth/authentication.dart | 4 +- mycore_api/lib/auth/http_basic_auth.dart | 11 +- mycore_api/lib/auth/http_bearer_auth.dart | 23 +- mycore_api/lib/auth/oauth.dart | 7 +- mycore_api/lib/model/action.dart | 149 +- mycore_api/lib/model/action_type.dart | 59 +- mycore_api/lib/model/alarm_mode.dart | 241 +- ...larm_mode_create_or_update_detail_dto.dart | 223 +- ...de_create_or_update_detail_dto_all_of.dart | 113 +- .../lib/model/alarm_mode_detail_dto.dart | 223 +- .../model/alarm_mode_detail_dto_all_of.dart | 113 +- mycore_api/lib/model/alarm_mode_dto.dart | 191 +- .../model/alarm_mode_geolocalized_mode.dart | 139 + .../lib/model/alarm_mode_programmed_mode.dart | 166 + mycore_api/lib/model/alarm_triggered.dart | 109 +- mycore_api/lib/model/alarm_type.dart | 59 +- .../lib/model/automation_detail_dto.dart | 195 +- .../model/automation_detail_dto_all_of.dart | 125 +- mycore_api/lib/model/automation_dto.dart | 151 +- mycore_api/lib/model/automation_state.dart | 97 +- .../lib/model/automation_triggered.dart | 97 +- mycore_api/lib/model/azure_ad_auth_model.dart | 89 +- mycore_api/lib/model/book.dart | 131 +- mycore_api/lib/model/condition.dart | 137 +- mycore_api/lib/model/condition_state.dart | 121 + mycore_api/lib/model/condition_type.dart | 51 +- mycore_api/lib/model/condition_value.dart | 59 +- mycore_api/lib/model/connection_status.dart | 53 +- .../lib/model/create_or_update_home_dto.dart | 179 +- .../create_or_update_home_dto_all_of.dart | 95 +- mycore_api/lib/model/device_detail_dto.dart | 367 +- .../lib/model/device_detail_dto_all_of.dart | 221 +- mycore_api/lib/model/device_state.dart | 117 +- mycore_api/lib/model/device_summary_dto.dart | 227 +- mycore_api/lib/model/device_type.dart | 77 +- .../lib/model/electricity_production.dart | 149 +- mycore_api/lib/model/event_detail_dto.dart | 151 +- .../lib/model/event_detail_dto_all_of.dart | 99 +- mycore_api/lib/model/event_dto.dart | 133 +- mycore_api/lib/model/event_filter.dart | 143 +- mycore_api/lib/model/event_home_filter.dart | 157 +- .../lib/model/event_home_filter_all_of.dart | 97 +- mycore_api/lib/model/event_type.dart | 53 +- mycore_api/lib/model/facebook_auth_model.dart | 89 +- mycore_api/lib/model/geolocalized_mode.dart | 109 +- mycore_api/lib/model/google_auth_model.dart | 97 +- .../group_create_or_update_detail_dto.dart | 141 +- ...up_create_or_update_detail_dto_all_of.dart | 95 +- mycore_api/lib/model/group_detail_dto.dart | 169 +- .../lib/model/group_detail_dto_all_of.dart | 123 +- mycore_api/lib/model/group_summary_dto.dart | 127 +- mycore_api/lib/model/home_detail_dto.dart | 229 +- .../lib/model/home_detail_dto_all_of.dart | 131 +- mycore_api/lib/model/home_dto.dart | 179 +- ...vent_detail_dto_and_event_home_filter.dart | 127 +- mycore_api/lib/model/login_dto.dart | 97 +- .../lib/model/means_of_communication.dart | 55 +- mycore_api/lib/model/mqtt_message_dto.dart | 111 +- mycore_api/lib/model/odd_nice.dart | 125 +- mycore_api/lib/model/odd_nice_odds.dart | 148 + mycore_api/lib/model/odd_object.dart | 123 +- mycore_api/lib/model/panel_menu_item.dart | 145 +- mycore_api/lib/model/panel_section.dart | 123 +- mycore_api/lib/model/programmed_mode.dart | 151 +- mycore_api/lib/model/provider_dto.dart | 163 +- mycore_api/lib/model/provider_type.dart | 55 +- .../room_create_or_update_detail_dto.dart | 119 +- mycore_api/lib/model/room_detail_dto.dart | 147 +- .../lib/model/room_main_detail_dto.dart | 245 +- .../model/room_main_detail_dto_all_of.dart | 221 +- mycore_api/lib/model/room_summary_dto.dart | 105 +- mycore_api/lib/model/screen_device.dart | 149 +- .../lib/model/smart_garden_message.dart | 175 +- .../lib/model/smart_printer_message.dart | 147 +- mycore_api/lib/model/time_period_alarm.dart | 103 +- mycore_api/lib/model/token_dto.dart | 143 +- mycore_api/lib/model/trigger.dart | 125 +- mycore_api/lib/model/trigger_type.dart | 53 +- mycore_api/lib/model/twitter_auth_model.dart | 89 +- mycore_api/lib/model/user.dart | 97 +- mycore_api/lib/model/user_info.dart | 245 +- .../lib/model/user_info_detail_dto.dart | 135 +- mycore_api/lib/model/view_by.dart | 53 +- mycore_api/pubspec.lock | 405 ++ mycore_api/pubspec.yaml | 14 +- mycore_api/test/action_test.dart | 14 +- mycore_api/test/action_type_test.dart | 5 +- mycore_api/test/alarm_api_test.dart | 11 +- ...eate_or_update_detail_dto_all_of_test.dart | 7 +- ...mode_create_or_update_detail_dto_test.dart | 7 +- .../alarm_mode_detail_dto_all_of_test.dart | 7 +- .../test/alarm_mode_detail_dto_test.dart | 7 +- mycore_api/test/alarm_mode_dto_test.dart | 7 +- .../alarm_mode_geolocalized_mode_test.dart | 42 + .../test/alarm_mode_programmed_mode_test.dart | 57 + mycore_api/test/alarm_mode_test.dart | 11 +- mycore_api/test/alarm_triggered_test.dart | 7 +- mycore_api/test/alarm_type_test.dart | 5 +- mycore_api/test/authentication_api_test.dart | 11 +- mycore_api/test/automation_api_test.dart | 25 +- .../automation_detail_dto_all_of_test.dart | 7 +- .../test/automation_detail_dto_test.dart | 16 +- mycore_api/test/automation_dto_test.dart | 16 +- mycore_api/test/automation_state_test.dart | 7 +- .../test/automation_triggered_test.dart | 7 +- mycore_api/test/azure_ad_auth_model_test.dart | 7 +- mycore_api/test/azure_api_test.dart | 7 +- mycore_api/test/book_test.dart | 7 +- mycore_api/test/books_api_test.dart | 7 +- mycore_api/test/condition_state_test.dart | 32 + mycore_api/test/condition_test.dart | 9 +- mycore_api/test/condition_type_test.dart | 5 +- mycore_api/test/condition_value_test.dart | 5 +- mycore_api/test/connection_status_test.dart | 5 +- ...create_or_update_home_dto_all_of_test.dart | 7 +- .../test/create_or_update_home_dto_test.dart | 9 +- mycore_api/test/device_api_test.dart | 34 +- .../test/device_detail_dto_all_of_test.dart | 9 +- mycore_api/test/device_detail_dto_test.dart | 22 +- mycore_api/test/device_state_test.dart | 7 +- mycore_api/test/device_summary_dto_test.dart | 20 +- mycore_api/test/device_type_test.dart | 5 +- .../test/electricity_production_test.dart | 11 +- mycore_api/test/energy_api_test.dart | 9 +- mycore_api/test/event_api_test.dart | 9 +- .../test/event_detail_dto_all_of_test.dart | 7 +- mycore_api/test/event_detail_dto_test.dart | 7 +- mycore_api/test/event_dto_test.dart | 7 +- mycore_api/test/event_filter_test.dart | 11 +- .../event_get_device_type_parameter_test.dart | 22 + .../event_get_event_type_parameter_test.dart | 22 + .../test/event_home_filter_all_of_test.dart | 7 +- mycore_api/test/event_home_filter_test.dart | 11 +- mycore_api/test/event_type_test.dart | 5 +- mycore_api/test/facebook_api_test.dart | 7 +- mycore_api/test/facebook_auth_model_test.dart | 7 +- mycore_api/test/geolocalized_mode_test.dart | 11 +- mycore_api/test/google_api_test.dart | 7 +- mycore_api/test/google_auth_model_test.dart | 7 +- mycore_api/test/group_api_test.dart | 29 +- ...eate_or_update_detail_dto_all_of_test.dart | 7 +- ...roup_create_or_update_detail_dto_test.dart | 11 +- .../test/group_detail_dto_all_of_test.dart | 7 +- mycore_api/test/group_detail_dto_test.dart | 11 +- mycore_api/test/group_summary_dto_test.dart | 11 +- mycore_api/test/home_api_test.dart | 7 +- .../test/home_detail_dto_all_of_test.dart | 7 +- mycore_api/test/home_detail_dto_test.dart | 9 +- .../home_dto_current_alarm_mode_test.dart | 67 + mycore_api/test/home_dto_test.dart | 9 +- mycore_api/test/iot_api_test.dart | 7 +- mycore_api/test/layout_api_test.dart | 7 +- ...t_home_filter_request_parameters_test.dart | 62 + ...detail_dto_and_event_home_filter_test.dart | 9 +- mycore_api/test/login_dto_test.dart | 7 +- .../test/means_of_communication_test.dart | 5 +- mycore_api/test/mqtt_api_test.dart | 7 +- mycore_api/test/mqtt_message_dto_test.dart | 7 +- mycore_api/test/odd_api_test.dart | 7 +- mycore_api/test/odd_nice_odds_test.dart | 37 + mycore_api/test/odd_nice_test.dart | 9 +- mycore_api/test/odd_object_test.dart | 7 +- mycore_api/test/panel_menu_item_test.dart | 7 +- mycore_api/test/panel_section_test.dart | 7 +- mycore_api/test/programmed_mode_test.dart | 7 +- mycore_api/test/provider_api_test.dart | 13 +- mycore_api/test/provider_dto_test.dart | 13 +- mycore_api/test/provider_type_test.dart | 5 +- mycore_api/test/room_api_test.dart | 41 +- ...room_create_or_update_detail_dto_test.dart | 11 +- mycore_api/test/room_detail_dto_test.dart | 11 +- .../room_main_detail_dto_all_of_test.dart | 47 +- .../test/room_main_detail_dto_test.dart | 47 +- mycore_api/test/room_summary_dto_test.dart | 11 +- mycore_api/test/screen_device_api_test.dart | 23 +- mycore_api/test/screen_device_test.dart | 7 +- .../test/smart_garden_message_test.dart | 7 +- .../test/smart_printer_message_test.dart | 7 +- .../time_period_alarm_alarm_mode_test.dart | 92 + mycore_api/test/time_period_alarm_test.dart | 9 +- mycore_api/test/token_api_test.dart | 9 +- mycore_api/test/token_dto_test.dart | 7 +- mycore_api/test/trigger_test.dart | 7 +- mycore_api/test/trigger_type_test.dart | 5 +- mycore_api/test/twitter_api_test.dart | 7 +- mycore_api/test/twitter_auth_model_test.dart | 7 +- mycore_api/test/user_api_test.dart | 40 +- .../test/user_info_detail_dto_test.dart | 17 +- mycore_api/test/user_info_test.dart | 42 +- mycore_api/test/user_test.dart | 7 +- mycore_api/test/values_api_test.dart | 7 +- mycore_api/test/view_by_test.dart | 5 +- mycore_api_old/.gitignore | 27 + mycore_api_old/.openapi-generator-ignore | 23 + mycore_api_old/.openapi-generator/FILES | 210 + mycore_api_old/.openapi-generator/VERSION | 1 + mycore_api_old/.travis.yml | 14 + mycore_api_old/README.md | 255 + mycore_api_old/doc/Action.md | 21 + mycore_api_old/doc/ActionType.md | 14 + mycore_api_old/doc/AlarmApi.md | 365 ++ mycore_api_old/doc/AlarmMode.md | 28 + .../doc/AlarmModeCreateOrUpdateDetailDTO.md | 27 + .../AlarmModeCreateOrUpdateDetailDTOAllOf.md | 18 + mycore_api_old/doc/AlarmModeDTO.md | 23 + mycore_api_old/doc/AlarmModeDetailDTO.md | 27 + mycore_api_old/doc/AlarmModeDetailDTOAllOf.md | 18 + mycore_api_old/doc/AlarmTriggered.md | 17 + mycore_api_old/doc/AlarmType.md | 14 + mycore_api_old/doc/AuthenticationApi.md | 109 + .../doc/Automation.md | 0 mycore_api_old/doc/AutomationApi.md | 277 + .../doc/AutomationCreateOrUpdateDetailDTO.md | 0 .../AutomationCreateOrUpdateDetailDTOAllOf.md | 0 mycore_api_old/doc/AutomationDTO.md | 20 + mycore_api_old/doc/AutomationDetailDTO.md | 24 + .../doc/AutomationDetailDTOAllOf.md | 18 + mycore_api_old/doc/AutomationState.md | 16 + mycore_api_old/doc/AutomationTriggered.md | 16 + mycore_api_old/doc/AzureADAuthModel.md | 15 + mycore_api_old/doc/AzureApi.md | 57 + mycore_api_old/doc/Book.md | 19 + mycore_api_old/doc/BooksApi.md | 231 + mycore_api_old/doc/Condition.md | 20 + mycore_api_old/doc/ConditionType.md | 14 + mycore_api_old/doc/ConditionValue.md | 14 + mycore_api_old/doc/ConnectionStatus.md | 14 + mycore_api_old/doc/CreateOrUpdateHomeDTO.md | 22 + .../doc/CreateOrUpdateHomeDTOAllOf.md | 15 + {mycore_api => mycore_api_old}/doc/Device.md | 0 mycore_api_old/doc/DeviceApi.md | 551 ++ mycore_api_old/doc/DeviceDetailDTO.md | 41 + mycore_api_old/doc/DeviceDetailDTOAllOf.md | 27 + mycore_api_old/doc/DeviceState.md | 18 + mycore_api_old/doc/DeviceSummaryDTO.md | 28 + mycore_api_old/doc/DeviceType.md | 14 + mycore_api_old/doc/ElectricityProduction.md | 20 + mycore_api_old/doc/EnergyApi.md | 59 + mycore_api_old/doc/EventApi.md | 205 + mycore_api_old/doc/EventDTO.md | 19 + mycore_api_old/doc/EventDetailDTO.md | 22 + mycore_api_old/doc/EventDetailDTOAllOf.md | 17 + mycore_api_old/doc/EventFilter.md | 20 + mycore_api_old/doc/EventHomeFilter.md | 22 + mycore_api_old/doc/EventHomeFilterAllOf.md | 16 + mycore_api_old/doc/EventType.md | 14 + mycore_api_old/doc/FacebookApi.md | 57 + mycore_api_old/doc/FacebookAuthModel.md | 15 + mycore_api_old/doc/GeolocalizedMode.md | 18 + mycore_api_old/doc/GoogleApi.md | 57 + mycore_api_old/doc/GoogleAuthModel.md | 16 + {mycore_api => mycore_api_old}/doc/Group.md | 0 mycore_api_old/doc/GroupApi.md | 457 ++ .../doc/GroupCreateOrUpdateDetailDTO.md | 20 + .../doc/GroupCreateOrUpdateDetailDTOAllOf.md | 15 + mycore_api_old/doc/GroupDetailDTO.md | 22 + mycore_api_old/doc/GroupDetailDTOAllOf.md | 17 + mycore_api_old/doc/GroupSummaryDTO.md | 19 + mycore_api_old/doc/HomeApi.md | 233 + mycore_api_old/doc/HomeDTO.md | 22 + mycore_api_old/doc/HomeDetailDTO.md | 27 + mycore_api_old/doc/HomeDetailDTOAllOf.md | 19 + mycore_api_old/doc/IOTApi.md | 151 + mycore_api_old/doc/LayoutApi.md | 53 + ...ponseOfEventDetailDTOAndEventHomeFilter.md | 18 + .../doc/LocationDTO.md | 0 mycore_api_old/doc/LoginDTO.md | 16 + mycore_api_old/doc/MQTTApi.md | 57 + mycore_api_old/doc/MeansOfCommunication.md | 14 + mycore_api_old/doc/MqttMessageDTO.md | 17 + mycore_api_old/doc/OddApi.md | 103 + {mycore_api => mycore_api_old}/doc/OddH2H.md | 0 mycore_api_old/doc/OddNice.md | 18 + mycore_api_old/doc/OddObject.md | 17 + mycore_api_old/doc/PanelMenuItem.md | 21 + mycore_api_old/doc/PanelSection.md | 19 + .../doc/PlaceDTO.md | 0 mycore_api_old/doc/ProgrammedMode.md | 21 + .../doc/Provider.md | 0 mycore_api_old/doc/ProviderApi.md | 189 + mycore_api_old/doc/ProviderDTO.md | 23 + mycore_api_old/doc/ProviderType.md | 14 + mycore_api_old/doc/RoomApi.md | 413 ++ .../doc/RoomCreateOrUpdateDetailDTO.md | 18 + mycore_api_old/doc/RoomDetailDTO.md | 20 + mycore_api_old/doc/RoomMainDetailDTO.md | 29 + mycore_api_old/doc/RoomMainDetailDTOAllOf.md | 26 + mycore_api_old/doc/RoomSummaryDTO.md | 17 + .../doc/ScreenConfiguration.md | 0 mycore_api_old/doc/ScreenDevice.md | 21 + mycore_api_old/doc/ScreenDeviceApi.md | 229 + .../doc/ScreenWidget.md | 0 mycore_api_old/doc/SmartGardenMessage.md | 22 + mycore_api_old/doc/SmartPrinterMessage.md | 20 + {mycore_api => mycore_api_old}/doc/State.md | 0 mycore_api_old/doc/TimePeriodAlarm.md | 17 + mycore_api_old/doc/TokenApi.md | 101 + mycore_api_old/doc/TokenDTO.md | 20 + mycore_api_old/doc/Trigger.md | 19 + mycore_api_old/doc/TriggerType.md | 14 + mycore_api_old/doc/TwitterApi.md | 57 + mycore_api_old/doc/TwitterAuthModel.md | 15 + mycore_api_old/doc/User.md | 16 + mycore_api_old/doc/UserApi.md | 273 + mycore_api_old/doc/UserInfo.md | 31 + mycore_api_old/doc/UserInfoDetailDTO.md | 20 + mycore_api_old/doc/ValuesApi.md | 228 + mycore_api_old/doc/ViewBy.md | 14 + {mycore_api => mycore_api_old}/doc/Widget.md | 0 mycore_api_old/git_push.sh | 58 + mycore_api_old/lib/api.dart | 138 + mycore_api_old/lib/api/alarm_api.dart | 585 ++ .../lib/api/authentication_api.dart | 203 + mycore_api_old/lib/api/automation_api.dart | 443 ++ mycore_api_old/lib/api/azure_api.dart | 80 + mycore_api_old/lib/api/books_api.dart | 333 ++ mycore_api_old/lib/api/device_api.dart | 924 ++++ mycore_api_old/lib/api/energy_api.dart | 95 + mycore_api_old/lib/api/event_api.dart | 358 ++ mycore_api_old/lib/api/facebook_api.dart | 80 + mycore_api_old/lib/api/google_api.dart | 80 + mycore_api_old/lib/api/group_api.dart | 753 +++ mycore_api_old/lib/api/home_api.dart | 372 ++ mycore_api_old/lib/api/iot_api.dart | 254 + mycore_api_old/lib/api/layout_api.dart | 74 + mycore_api_old/lib/api/mqtt_api.dart | 87 + mycore_api_old/lib/api/odd_api.dart | 173 + mycore_api_old/lib/api/provider_api.dart | 301 + mycore_api_old/lib/api/room_api.dart | 677 +++ mycore_api_old/lib/api/screen_device_api.dart | 356 ++ mycore_api_old/lib/api/token_api.dart | 150 + mycore_api_old/lib/api/twitter_api.dart | 80 + mycore_api_old/lib/api/user_api.dart | 427 ++ mycore_api_old/lib/api/values_api.dart | 315 ++ mycore_api_old/lib/api_client.dart | 375 ++ mycore_api_old/lib/api_exception.dart | 31 + mycore_api_old/lib/api_helper.dart | 104 + mycore_api_old/lib/auth/api_key_auth.dart | 35 + mycore_api_old/lib/auth/authentication.dart | 15 + mycore_api_old/lib/auth/http_basic_auth.dart | 21 + mycore_api_old/lib/auth/http_bearer_auth.dart | 38 + mycore_api_old/lib/auth/oauth.dart | 23 + mycore_api_old/lib/model/action.dart | 125 + mycore_api_old/lib/model/action_type.dart | 88 + mycore_api_old/lib/model/alarm_mode.dart | 194 + ...larm_mode_create_or_update_detail_dto.dart | 183 + ...de_create_or_update_detail_dto_all_of.dart | 98 + .../lib/model/alarm_mode_detail_dto.dart | 183 + .../model/alarm_mode_detail_dto_all_of.dart | 98 + mycore_api_old/lib/model/alarm_mode_dto.dart | 147 + mycore_api_old/lib/model/alarm_triggered.dart | 89 + mycore_api_old/lib/model/alarm_type.dart | 88 + .../lib/model/automation.dart | 0 ...utomation_create_or_update_detail_dto.dart | 0 ...on_create_or_update_detail_dto_all_of.dart | 0 .../lib/model/automation_detail_dto.dart | 158 + .../model/automation_detail_dto_all_of.dart | 100 + mycore_api_old/lib/model/automation_dto.dart | 120 + .../lib/model/automation_state.dart | 80 + .../lib/model/automation_triggered.dart | 80 + .../lib/model/azure_ad_auth_model.dart | 71 + mycore_api_old/lib/model/book.dart | 109 + mycore_api_old/lib/model/condition.dart | 116 + mycore_api_old/lib/model/condition_type.dart | 76 + mycore_api_old/lib/model/condition_value.dart | 88 + .../lib/model/connection_status.dart | 79 + .../lib/model/create_or_update_home_dto.dart | 140 + .../create_or_update_home_dto_all_of.dart | 73 + .../lib/model/device.dart | 0 .../lib/model/device_detail_dto.dart | 315 ++ .../lib/model/device_detail_dto_all_of.dart | 187 + mycore_api_old/lib/model/device_state.dart | 98 + .../lib/model/device_summary_dto.dart | 190 + mycore_api_old/lib/model/device_type.dart | 115 + .../lib/model/electricity_production.dart | 118 + .../lib/model/event_detail_dto.dart | 136 + .../lib/model/event_detail_dto_all_of.dart | 89 + mycore_api_old/lib/model/event_dto.dart | 109 + mycore_api_old/lib/model/event_filter.dart | 120 + .../lib/model/event_home_filter.dart | 138 + .../lib/model/event_home_filter_all_of.dart | 80 + mycore_api_old/lib/model/event_type.dart | 79 + .../lib/model/facebook_auth_model.dart | 71 + .../lib/model/geolocalized_mode.dart | 98 + .../lib/model/google_auth_model.dart | 80 + .../lib/model/group.dart | 0 .../group_create_or_update_detail_dto.dart | 118 + ...up_create_or_update_detail_dto_all_of.dart | 73 + .../lib/model/group_detail_dto.dart | 138 + .../lib/model/group_detail_dto_all_of.dart | 93 + .../lib/model/group_summary_dto.dart | 107 + mycore_api_old/lib/model/home_detail_dto.dart | 185 + .../lib/model/home_detail_dto_all_of.dart | 107 + mycore_api_old/lib/model/home_dto.dart | 140 + ...vent_detail_dto_and_event_home_filter.dart | 98 + .../lib/model/location_dto.dart | 0 mycore_api_old/lib/model/login_dto.dart | 80 + .../lib/model/means_of_communication.dart | 82 + .../lib/model/mqtt_message_dto.dart | 89 + mycore_api_old/lib/model/odd_nice.dart | 100 + mycore_api_old/lib/model/odd_object.dart | 89 + mycore_api_old/lib/model/panel_menu_item.dart | 125 + mycore_api_old/lib/model/panel_section.dart | 107 + .../lib/model/place_dto.dart | 0 mycore_api_old/lib/model/programmed_mode.dart | 125 + .../lib/model/provider.dart | 0 mycore_api_old/lib/model/provider_dto.dart | 143 + mycore_api_old/lib/model/provider_type.dart | 82 + .../room_create_or_update_detail_dto.dart | 100 + mycore_api_old/lib/model/room_detail_dto.dart | 120 + .../lib/model/room_main_detail_dto.dart | 201 + .../model/room_main_detail_dto_all_of.dart | 174 + .../lib/model/room_summary_dto.dart | 89 + .../lib/model/screen_configuration.dart | 0 mycore_api_old/lib/model/screen_device.dart | 125 + .../lib/model/screen_widget.dart | 0 .../lib/model/smart_garden_message.dart | 134 + .../lib/model/smart_printer_message.dart | 116 + .../lib/model/time_period_alarm.dart | 89 + mycore_api_old/lib/model/token_dto.dart | 118 + mycore_api_old/lib/model/trigger.dart | 107 + mycore_api_old/lib/model/trigger_type.dart | 79 + .../lib/model/twitter_auth_model.dart | 71 + mycore_api_old/lib/model/user.dart | 80 + mycore_api_old/lib/model/user_info.dart | 221 + .../lib/model/user_info_detail_dto.dart | 118 + mycore_api_old/lib/model/view_by.dart | 79 + .../openapi-dart-generator-4.2.jar | Bin .../openapi-generator-cli-5.1.0.jar | Bin mycore_api_old/pubspec.yaml | 20 + {mycore_api => mycore_api_old}/swagger.yaml | 0 .../swagger.yaml.bak | 0 mycore_api_old/test/action_test.dart | 51 + mycore_api_old/test/action_type_test.dart | 20 + mycore_api_old/test/alarm_api_test.dart | 76 + ...eate_or_update_detail_dto_all_of_test.dart | 41 + ...mode_create_or_update_detail_dto_test.dart | 86 + .../alarm_mode_detail_dto_all_of_test.dart | 41 + .../test/alarm_mode_detail_dto_test.dart | 86 + mycore_api_old/test/alarm_mode_dto_test.dart | 66 + mycore_api_old/test/alarm_mode_test.dart | 91 + mycore_api_old/test/alarm_triggered_test.dart | 36 + mycore_api_old/test/alarm_type_test.dart | 20 + .../test/authentication_api_test.dart | 34 + mycore_api_old/test/automation_api_test.dart | 60 + ...eate_or_update_detail_dto_all_of_test.dart | 0 ...tion_create_or_update_detail_dto_test.dart | 0 .../automation_detail_dto_all_of_test.dart | 41 + .../test/automation_detail_dto_test.dart | 66 + mycore_api_old/test/automation_dto_test.dart | 46 + .../test/automation_state_test.dart | 31 + .../test/automation_test.dart | 0 .../test/automation_triggered_test.dart | 31 + .../test/azure_ad_auth_model_test.dart | 26 + mycore_api_old/test/azure_api_test.dart | 25 + mycore_api_old/test/book_test.dart | 46 + mycore_api_old/test/books_api_test.dart | 45 + mycore_api_old/test/condition_test.dart | 51 + mycore_api_old/test/condition_type_test.dart | 20 + mycore_api_old/test/condition_value_test.dart | 20 + .../test/connection_status_test.dart | 20 + ...create_or_update_home_dto_all_of_test.dart | 26 + .../test/create_or_update_home_dto_test.dart | 61 + mycore_api_old/test/device_api_test.dart | 97 + .../test/device_detail_dto_all_of_test.dart | 86 + .../test/device_detail_dto_test.dart | 161 + mycore_api_old/test/device_state_test.dart | 41 + .../test/device_summary_dto_test.dart | 96 + .../test/device_test.dart | 0 mycore_api_old/test/device_type_test.dart | 20 + .../test/electricity_production_test.dart | 51 + mycore_api_old/test/energy_api_test.dart | 27 + mycore_api_old/test/event_api_test.dart | 48 + .../test/event_detail_dto_all_of_test.dart | 36 + .../test/event_detail_dto_test.dart | 61 + mycore_api_old/test/event_dto_test.dart | 46 + mycore_api_old/test/event_filter_test.dart | 51 + .../test/event_home_filter_all_of_test.dart | 31 + .../test/event_home_filter_test.dart | 61 + mycore_api_old/test/event_type_test.dart | 20 + mycore_api_old/test/facebook_api_test.dart | 25 + .../test/facebook_auth_model_test.dart | 26 + .../test/geolocalized_mode_test.dart | 41 + mycore_api_old/test/google_api_test.dart | 25 + .../test/google_auth_model_test.dart | 31 + mycore_api_old/test/group_api_test.dart | 90 + ...eate_or_update_detail_dto_all_of_test.dart | 26 + ...roup_create_or_update_detail_dto_test.dart | 51 + .../test/group_detail_dto_all_of_test.dart | 36 + .../test/group_detail_dto_test.dart | 61 + .../test/group_summary_dto_test.dart | 46 + .../test/group_test.dart | 0 mycore_api_old/test/home_api_test.dart | 55 + .../test/home_detail_dto_all_of_test.dart | 46 + mycore_api_old/test/home_detail_dto_test.dart | 86 + mycore_api_old/test/home_dto_test.dart | 61 + mycore_api_old/test/iot_api_test.dart | 41 + mycore_api_old/test/layout_api_test.dart | 27 + ...detail_dto_and_event_home_filter_test.dart | 41 + .../test/location_dto_test.dart | 0 mycore_api_old/test/login_dto_test.dart | 31 + .../test/means_of_communication_test.dart | 20 + mycore_api_old/test/mqtt_api_test.dart | 27 + .../test/mqtt_message_dto_test.dart | 36 + mycore_api_old/test/odd_api_test.dart | 34 + .../test/odd_h2_h_test.dart | 0 mycore_api_old/test/odd_nice_test.dart | 41 + mycore_api_old/test/odd_object_test.dart | 36 + mycore_api_old/test/panel_menu_item_test.dart | 56 + mycore_api_old/test/panel_section_test.dart | 46 + .../test/place_dto_test.dart | 0 mycore_api_old/test/programmed_mode_test.dart | 56 + mycore_api_old/test/provider_api_test.dart | 48 + mycore_api_old/test/provider_dto_test.dart | 66 + .../test/provider_test.dart | 0 mycore_api_old/test/provider_type_test.dart | 20 + mycore_api_old/test/room_api_test.dart | 69 + ...room_create_or_update_detail_dto_test.dart | 41 + mycore_api_old/test/room_detail_dto_test.dart | 51 + .../room_main_detail_dto_all_of_test.dart | 41 + .../test/room_main_detail_dto_test.dart | 56 + .../test/room_summary_dto_test.dart | 36 + .../test/screen_configuration_test.dart | 0 .../test/screen_device_api_test.dart | 45 + mycore_api_old/test/screen_device_test.dart | 56 + .../test/screen_widget_test.dart | 0 .../test/smart_garden_message_test.dart | 61 + .../test/smart_printer_message_test.dart | 51 + .../test/state_test.dart | 0 .../test/time_period_alarm_test.dart | 36 + mycore_api_old/test/token_api_test.dart | 30 + mycore_api_old/test/token_dto_test.dart | 51 + mycore_api_old/test/trigger_test.dart | 46 + mycore_api_old/test/trigger_type_test.dart | 20 + mycore_api_old/test/twitter_api_test.dart | 25 + .../test/twitter_auth_model_test.dart | 26 + mycore_api_old/test/user_api_test.dart | 49 + .../test/user_info_detail_dto_test.dart | 41 + mycore_api_old/test/user_info_test.dart | 131 + mycore_api_old/test/user_test.dart | 31 + mycore_api_old/test/values_api_test.dart | 47 + mycore_api_old/test/view_by_test.dart | 20 + .../test/widget_test.dart | 0 pubspec.lock | 554 +- pubspec.yaml | 24 +- windows/flutter/generated_plugins.cmake | 8 + 715 files changed, 44983 insertions(+), 7853 deletions(-) create mode 100644 android/app/version.properties create mode 100644 lib/api/openApiTest.dart create mode 100644 lib/api/swagger.yaml create mode 100644 mycore_api/analysis_options.yaml create mode 100644 mycore_api/doc/AlarmModeGeolocalizedMode.md create mode 100644 mycore_api/doc/AlarmModeProgrammedMode.md create mode 100644 mycore_api/doc/ConditionState.md create mode 100644 mycore_api/doc/EventGetDeviceTypeParameter.md create mode 100644 mycore_api/doc/EventGetEventTypeParameter.md create mode 100644 mycore_api/doc/HomeDTOCurrentAlarmMode.md create mode 100644 mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md create mode 100644 mycore_api/doc/OddNiceOdds.md create mode 100644 mycore_api/doc/TimePeriodAlarmAlarmMode.md create mode 100644 mycore_api/lib/model/alarm_mode_geolocalized_mode.dart create mode 100644 mycore_api/lib/model/alarm_mode_programmed_mode.dart create mode 100644 mycore_api/lib/model/condition_state.dart create mode 100644 mycore_api/lib/model/odd_nice_odds.dart create mode 100644 mycore_api/pubspec.lock create mode 100644 mycore_api/test/alarm_mode_geolocalized_mode_test.dart create mode 100644 mycore_api/test/alarm_mode_programmed_mode_test.dart create mode 100644 mycore_api/test/condition_state_test.dart create mode 100644 mycore_api/test/event_get_device_type_parameter_test.dart create mode 100644 mycore_api/test/event_get_event_type_parameter_test.dart create mode 100644 mycore_api/test/home_dto_current_alarm_mode_test.dart create mode 100644 mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_request_parameters_test.dart create mode 100644 mycore_api/test/odd_nice_odds_test.dart create mode 100644 mycore_api/test/time_period_alarm_alarm_mode_test.dart create mode 100644 mycore_api_old/.gitignore create mode 100644 mycore_api_old/.openapi-generator-ignore create mode 100644 mycore_api_old/.openapi-generator/FILES create mode 100644 mycore_api_old/.openapi-generator/VERSION create mode 100644 mycore_api_old/.travis.yml create mode 100644 mycore_api_old/README.md create mode 100644 mycore_api_old/doc/Action.md create mode 100644 mycore_api_old/doc/ActionType.md create mode 100644 mycore_api_old/doc/AlarmApi.md create mode 100644 mycore_api_old/doc/AlarmMode.md create mode 100644 mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTO.md create mode 100644 mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/AlarmModeDTO.md create mode 100644 mycore_api_old/doc/AlarmModeDetailDTO.md create mode 100644 mycore_api_old/doc/AlarmModeDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/AlarmTriggered.md create mode 100644 mycore_api_old/doc/AlarmType.md create mode 100644 mycore_api_old/doc/AuthenticationApi.md rename {mycore_api => mycore_api_old}/doc/Automation.md (100%) create mode 100644 mycore_api_old/doc/AutomationApi.md rename {mycore_api => mycore_api_old}/doc/AutomationCreateOrUpdateDetailDTO.md (100%) rename {mycore_api => mycore_api_old}/doc/AutomationCreateOrUpdateDetailDTOAllOf.md (100%) create mode 100644 mycore_api_old/doc/AutomationDTO.md create mode 100644 mycore_api_old/doc/AutomationDetailDTO.md create mode 100644 mycore_api_old/doc/AutomationDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/AutomationState.md create mode 100644 mycore_api_old/doc/AutomationTriggered.md create mode 100644 mycore_api_old/doc/AzureADAuthModel.md create mode 100644 mycore_api_old/doc/AzureApi.md create mode 100644 mycore_api_old/doc/Book.md create mode 100644 mycore_api_old/doc/BooksApi.md create mode 100644 mycore_api_old/doc/Condition.md create mode 100644 mycore_api_old/doc/ConditionType.md create mode 100644 mycore_api_old/doc/ConditionValue.md create mode 100644 mycore_api_old/doc/ConnectionStatus.md create mode 100644 mycore_api_old/doc/CreateOrUpdateHomeDTO.md create mode 100644 mycore_api_old/doc/CreateOrUpdateHomeDTOAllOf.md rename {mycore_api => mycore_api_old}/doc/Device.md (100%) create mode 100644 mycore_api_old/doc/DeviceApi.md create mode 100644 mycore_api_old/doc/DeviceDetailDTO.md create mode 100644 mycore_api_old/doc/DeviceDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/DeviceState.md create mode 100644 mycore_api_old/doc/DeviceSummaryDTO.md create mode 100644 mycore_api_old/doc/DeviceType.md create mode 100644 mycore_api_old/doc/ElectricityProduction.md create mode 100644 mycore_api_old/doc/EnergyApi.md create mode 100644 mycore_api_old/doc/EventApi.md create mode 100644 mycore_api_old/doc/EventDTO.md create mode 100644 mycore_api_old/doc/EventDetailDTO.md create mode 100644 mycore_api_old/doc/EventDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/EventFilter.md create mode 100644 mycore_api_old/doc/EventHomeFilter.md create mode 100644 mycore_api_old/doc/EventHomeFilterAllOf.md create mode 100644 mycore_api_old/doc/EventType.md create mode 100644 mycore_api_old/doc/FacebookApi.md create mode 100644 mycore_api_old/doc/FacebookAuthModel.md create mode 100644 mycore_api_old/doc/GeolocalizedMode.md create mode 100644 mycore_api_old/doc/GoogleApi.md create mode 100644 mycore_api_old/doc/GoogleAuthModel.md rename {mycore_api => mycore_api_old}/doc/Group.md (100%) create mode 100644 mycore_api_old/doc/GroupApi.md create mode 100644 mycore_api_old/doc/GroupCreateOrUpdateDetailDTO.md create mode 100644 mycore_api_old/doc/GroupCreateOrUpdateDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/GroupDetailDTO.md create mode 100644 mycore_api_old/doc/GroupDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/GroupSummaryDTO.md create mode 100644 mycore_api_old/doc/HomeApi.md create mode 100644 mycore_api_old/doc/HomeDTO.md create mode 100644 mycore_api_old/doc/HomeDetailDTO.md create mode 100644 mycore_api_old/doc/HomeDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/IOTApi.md create mode 100644 mycore_api_old/doc/LayoutApi.md create mode 100644 mycore_api_old/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md rename {mycore_api => mycore_api_old}/doc/LocationDTO.md (100%) create mode 100644 mycore_api_old/doc/LoginDTO.md create mode 100644 mycore_api_old/doc/MQTTApi.md create mode 100644 mycore_api_old/doc/MeansOfCommunication.md create mode 100644 mycore_api_old/doc/MqttMessageDTO.md create mode 100644 mycore_api_old/doc/OddApi.md rename {mycore_api => mycore_api_old}/doc/OddH2H.md (100%) create mode 100644 mycore_api_old/doc/OddNice.md create mode 100644 mycore_api_old/doc/OddObject.md create mode 100644 mycore_api_old/doc/PanelMenuItem.md create mode 100644 mycore_api_old/doc/PanelSection.md rename {mycore_api => mycore_api_old}/doc/PlaceDTO.md (100%) create mode 100644 mycore_api_old/doc/ProgrammedMode.md rename {mycore_api => mycore_api_old}/doc/Provider.md (100%) create mode 100644 mycore_api_old/doc/ProviderApi.md create mode 100644 mycore_api_old/doc/ProviderDTO.md create mode 100644 mycore_api_old/doc/ProviderType.md create mode 100644 mycore_api_old/doc/RoomApi.md create mode 100644 mycore_api_old/doc/RoomCreateOrUpdateDetailDTO.md create mode 100644 mycore_api_old/doc/RoomDetailDTO.md create mode 100644 mycore_api_old/doc/RoomMainDetailDTO.md create mode 100644 mycore_api_old/doc/RoomMainDetailDTOAllOf.md create mode 100644 mycore_api_old/doc/RoomSummaryDTO.md rename {mycore_api => mycore_api_old}/doc/ScreenConfiguration.md (100%) create mode 100644 mycore_api_old/doc/ScreenDevice.md create mode 100644 mycore_api_old/doc/ScreenDeviceApi.md rename {mycore_api => mycore_api_old}/doc/ScreenWidget.md (100%) create mode 100644 mycore_api_old/doc/SmartGardenMessage.md create mode 100644 mycore_api_old/doc/SmartPrinterMessage.md rename {mycore_api => mycore_api_old}/doc/State.md (100%) create mode 100644 mycore_api_old/doc/TimePeriodAlarm.md create mode 100644 mycore_api_old/doc/TokenApi.md create mode 100644 mycore_api_old/doc/TokenDTO.md create mode 100644 mycore_api_old/doc/Trigger.md create mode 100644 mycore_api_old/doc/TriggerType.md create mode 100644 mycore_api_old/doc/TwitterApi.md create mode 100644 mycore_api_old/doc/TwitterAuthModel.md create mode 100644 mycore_api_old/doc/User.md create mode 100644 mycore_api_old/doc/UserApi.md create mode 100644 mycore_api_old/doc/UserInfo.md create mode 100644 mycore_api_old/doc/UserInfoDetailDTO.md create mode 100644 mycore_api_old/doc/ValuesApi.md create mode 100644 mycore_api_old/doc/ViewBy.md rename {mycore_api => mycore_api_old}/doc/Widget.md (100%) create mode 100644 mycore_api_old/git_push.sh create mode 100644 mycore_api_old/lib/api.dart create mode 100644 mycore_api_old/lib/api/alarm_api.dart create mode 100644 mycore_api_old/lib/api/authentication_api.dart create mode 100644 mycore_api_old/lib/api/automation_api.dart create mode 100644 mycore_api_old/lib/api/azure_api.dart create mode 100644 mycore_api_old/lib/api/books_api.dart create mode 100644 mycore_api_old/lib/api/device_api.dart create mode 100644 mycore_api_old/lib/api/energy_api.dart create mode 100644 mycore_api_old/lib/api/event_api.dart create mode 100644 mycore_api_old/lib/api/facebook_api.dart create mode 100644 mycore_api_old/lib/api/google_api.dart create mode 100644 mycore_api_old/lib/api/group_api.dart create mode 100644 mycore_api_old/lib/api/home_api.dart create mode 100644 mycore_api_old/lib/api/iot_api.dart create mode 100644 mycore_api_old/lib/api/layout_api.dart create mode 100644 mycore_api_old/lib/api/mqtt_api.dart create mode 100644 mycore_api_old/lib/api/odd_api.dart create mode 100644 mycore_api_old/lib/api/provider_api.dart create mode 100644 mycore_api_old/lib/api/room_api.dart create mode 100644 mycore_api_old/lib/api/screen_device_api.dart create mode 100644 mycore_api_old/lib/api/token_api.dart create mode 100644 mycore_api_old/lib/api/twitter_api.dart create mode 100644 mycore_api_old/lib/api/user_api.dart create mode 100644 mycore_api_old/lib/api/values_api.dart create mode 100644 mycore_api_old/lib/api_client.dart create mode 100644 mycore_api_old/lib/api_exception.dart create mode 100644 mycore_api_old/lib/api_helper.dart create mode 100644 mycore_api_old/lib/auth/api_key_auth.dart create mode 100644 mycore_api_old/lib/auth/authentication.dart create mode 100644 mycore_api_old/lib/auth/http_basic_auth.dart create mode 100644 mycore_api_old/lib/auth/http_bearer_auth.dart create mode 100644 mycore_api_old/lib/auth/oauth.dart create mode 100644 mycore_api_old/lib/model/action.dart create mode 100644 mycore_api_old/lib/model/action_type.dart create mode 100644 mycore_api_old/lib/model/alarm_mode.dart create mode 100644 mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto.dart create mode 100644 mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/alarm_mode_detail_dto.dart create mode 100644 mycore_api_old/lib/model/alarm_mode_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/alarm_mode_dto.dart create mode 100644 mycore_api_old/lib/model/alarm_triggered.dart create mode 100644 mycore_api_old/lib/model/alarm_type.dart rename {mycore_api => mycore_api_old}/lib/model/automation.dart (100%) rename {mycore_api => mycore_api_old}/lib/model/automation_create_or_update_detail_dto.dart (100%) rename {mycore_api => mycore_api_old}/lib/model/automation_create_or_update_detail_dto_all_of.dart (100%) create mode 100644 mycore_api_old/lib/model/automation_detail_dto.dart create mode 100644 mycore_api_old/lib/model/automation_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/automation_dto.dart create mode 100644 mycore_api_old/lib/model/automation_state.dart create mode 100644 mycore_api_old/lib/model/automation_triggered.dart create mode 100644 mycore_api_old/lib/model/azure_ad_auth_model.dart create mode 100644 mycore_api_old/lib/model/book.dart create mode 100644 mycore_api_old/lib/model/condition.dart create mode 100644 mycore_api_old/lib/model/condition_type.dart create mode 100644 mycore_api_old/lib/model/condition_value.dart create mode 100644 mycore_api_old/lib/model/connection_status.dart create mode 100644 mycore_api_old/lib/model/create_or_update_home_dto.dart create mode 100644 mycore_api_old/lib/model/create_or_update_home_dto_all_of.dart rename {mycore_api => mycore_api_old}/lib/model/device.dart (100%) create mode 100644 mycore_api_old/lib/model/device_detail_dto.dart create mode 100644 mycore_api_old/lib/model/device_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/device_state.dart create mode 100644 mycore_api_old/lib/model/device_summary_dto.dart create mode 100644 mycore_api_old/lib/model/device_type.dart create mode 100644 mycore_api_old/lib/model/electricity_production.dart create mode 100644 mycore_api_old/lib/model/event_detail_dto.dart create mode 100644 mycore_api_old/lib/model/event_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/event_dto.dart create mode 100644 mycore_api_old/lib/model/event_filter.dart create mode 100644 mycore_api_old/lib/model/event_home_filter.dart create mode 100644 mycore_api_old/lib/model/event_home_filter_all_of.dart create mode 100644 mycore_api_old/lib/model/event_type.dart create mode 100644 mycore_api_old/lib/model/facebook_auth_model.dart create mode 100644 mycore_api_old/lib/model/geolocalized_mode.dart create mode 100644 mycore_api_old/lib/model/google_auth_model.dart rename {mycore_api => mycore_api_old}/lib/model/group.dart (100%) create mode 100644 mycore_api_old/lib/model/group_create_or_update_detail_dto.dart create mode 100644 mycore_api_old/lib/model/group_create_or_update_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/group_detail_dto.dart create mode 100644 mycore_api_old/lib/model/group_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/group_summary_dto.dart create mode 100644 mycore_api_old/lib/model/home_detail_dto.dart create mode 100644 mycore_api_old/lib/model/home_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/home_dto.dart create mode 100644 mycore_api_old/lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart rename {mycore_api => mycore_api_old}/lib/model/location_dto.dart (100%) create mode 100644 mycore_api_old/lib/model/login_dto.dart create mode 100644 mycore_api_old/lib/model/means_of_communication.dart create mode 100644 mycore_api_old/lib/model/mqtt_message_dto.dart create mode 100644 mycore_api_old/lib/model/odd_nice.dart create mode 100644 mycore_api_old/lib/model/odd_object.dart create mode 100644 mycore_api_old/lib/model/panel_menu_item.dart create mode 100644 mycore_api_old/lib/model/panel_section.dart rename {mycore_api => mycore_api_old}/lib/model/place_dto.dart (100%) create mode 100644 mycore_api_old/lib/model/programmed_mode.dart rename {mycore_api => mycore_api_old}/lib/model/provider.dart (100%) create mode 100644 mycore_api_old/lib/model/provider_dto.dart create mode 100644 mycore_api_old/lib/model/provider_type.dart create mode 100644 mycore_api_old/lib/model/room_create_or_update_detail_dto.dart create mode 100644 mycore_api_old/lib/model/room_detail_dto.dart create mode 100644 mycore_api_old/lib/model/room_main_detail_dto.dart create mode 100644 mycore_api_old/lib/model/room_main_detail_dto_all_of.dart create mode 100644 mycore_api_old/lib/model/room_summary_dto.dart rename {mycore_api => mycore_api_old}/lib/model/screen_configuration.dart (100%) create mode 100644 mycore_api_old/lib/model/screen_device.dart rename {mycore_api => mycore_api_old}/lib/model/screen_widget.dart (100%) create mode 100644 mycore_api_old/lib/model/smart_garden_message.dart create mode 100644 mycore_api_old/lib/model/smart_printer_message.dart create mode 100644 mycore_api_old/lib/model/time_period_alarm.dart create mode 100644 mycore_api_old/lib/model/token_dto.dart create mode 100644 mycore_api_old/lib/model/trigger.dart create mode 100644 mycore_api_old/lib/model/trigger_type.dart create mode 100644 mycore_api_old/lib/model/twitter_auth_model.dart create mode 100644 mycore_api_old/lib/model/user.dart create mode 100644 mycore_api_old/lib/model/user_info.dart create mode 100644 mycore_api_old/lib/model/user_info_detail_dto.dart create mode 100644 mycore_api_old/lib/model/view_by.dart rename {mycore_api => mycore_api_old}/openapi-dart-generator-4.2.jar (100%) rename {mycore_api => mycore_api_old}/openapi-generator-cli-5.1.0.jar (100%) create mode 100644 mycore_api_old/pubspec.yaml rename {mycore_api => mycore_api_old}/swagger.yaml (100%) rename {mycore_api => mycore_api_old}/swagger.yaml.bak (100%) create mode 100644 mycore_api_old/test/action_test.dart create mode 100644 mycore_api_old/test/action_type_test.dart create mode 100644 mycore_api_old/test/alarm_api_test.dart create mode 100644 mycore_api_old/test/alarm_mode_create_or_update_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/alarm_mode_create_or_update_detail_dto_test.dart create mode 100644 mycore_api_old/test/alarm_mode_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/alarm_mode_detail_dto_test.dart create mode 100644 mycore_api_old/test/alarm_mode_dto_test.dart create mode 100644 mycore_api_old/test/alarm_mode_test.dart create mode 100644 mycore_api_old/test/alarm_triggered_test.dart create mode 100644 mycore_api_old/test/alarm_type_test.dart create mode 100644 mycore_api_old/test/authentication_api_test.dart create mode 100644 mycore_api_old/test/automation_api_test.dart rename {mycore_api => mycore_api_old}/test/automation_create_or_update_detail_dto_all_of_test.dart (100%) rename {mycore_api => mycore_api_old}/test/automation_create_or_update_detail_dto_test.dart (100%) create mode 100644 mycore_api_old/test/automation_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/automation_detail_dto_test.dart create mode 100644 mycore_api_old/test/automation_dto_test.dart create mode 100644 mycore_api_old/test/automation_state_test.dart rename {mycore_api => mycore_api_old}/test/automation_test.dart (100%) create mode 100644 mycore_api_old/test/automation_triggered_test.dart create mode 100644 mycore_api_old/test/azure_ad_auth_model_test.dart create mode 100644 mycore_api_old/test/azure_api_test.dart create mode 100644 mycore_api_old/test/book_test.dart create mode 100644 mycore_api_old/test/books_api_test.dart create mode 100644 mycore_api_old/test/condition_test.dart create mode 100644 mycore_api_old/test/condition_type_test.dart create mode 100644 mycore_api_old/test/condition_value_test.dart create mode 100644 mycore_api_old/test/connection_status_test.dart create mode 100644 mycore_api_old/test/create_or_update_home_dto_all_of_test.dart create mode 100644 mycore_api_old/test/create_or_update_home_dto_test.dart create mode 100644 mycore_api_old/test/device_api_test.dart create mode 100644 mycore_api_old/test/device_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/device_detail_dto_test.dart create mode 100644 mycore_api_old/test/device_state_test.dart create mode 100644 mycore_api_old/test/device_summary_dto_test.dart rename {mycore_api => mycore_api_old}/test/device_test.dart (100%) create mode 100644 mycore_api_old/test/device_type_test.dart create mode 100644 mycore_api_old/test/electricity_production_test.dart create mode 100644 mycore_api_old/test/energy_api_test.dart create mode 100644 mycore_api_old/test/event_api_test.dart create mode 100644 mycore_api_old/test/event_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/event_detail_dto_test.dart create mode 100644 mycore_api_old/test/event_dto_test.dart create mode 100644 mycore_api_old/test/event_filter_test.dart create mode 100644 mycore_api_old/test/event_home_filter_all_of_test.dart create mode 100644 mycore_api_old/test/event_home_filter_test.dart create mode 100644 mycore_api_old/test/event_type_test.dart create mode 100644 mycore_api_old/test/facebook_api_test.dart create mode 100644 mycore_api_old/test/facebook_auth_model_test.dart create mode 100644 mycore_api_old/test/geolocalized_mode_test.dart create mode 100644 mycore_api_old/test/google_api_test.dart create mode 100644 mycore_api_old/test/google_auth_model_test.dart create mode 100644 mycore_api_old/test/group_api_test.dart create mode 100644 mycore_api_old/test/group_create_or_update_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/group_create_or_update_detail_dto_test.dart create mode 100644 mycore_api_old/test/group_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/group_detail_dto_test.dart create mode 100644 mycore_api_old/test/group_summary_dto_test.dart rename {mycore_api => mycore_api_old}/test/group_test.dart (100%) create mode 100644 mycore_api_old/test/home_api_test.dart create mode 100644 mycore_api_old/test/home_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/home_detail_dto_test.dart create mode 100644 mycore_api_old/test/home_dto_test.dart create mode 100644 mycore_api_old/test/iot_api_test.dart create mode 100644 mycore_api_old/test/layout_api_test.dart create mode 100644 mycore_api_old/test/list_response_of_event_detail_dto_and_event_home_filter_test.dart rename {mycore_api => mycore_api_old}/test/location_dto_test.dart (100%) create mode 100644 mycore_api_old/test/login_dto_test.dart create mode 100644 mycore_api_old/test/means_of_communication_test.dart create mode 100644 mycore_api_old/test/mqtt_api_test.dart create mode 100644 mycore_api_old/test/mqtt_message_dto_test.dart create mode 100644 mycore_api_old/test/odd_api_test.dart rename {mycore_api => mycore_api_old}/test/odd_h2_h_test.dart (100%) create mode 100644 mycore_api_old/test/odd_nice_test.dart create mode 100644 mycore_api_old/test/odd_object_test.dart create mode 100644 mycore_api_old/test/panel_menu_item_test.dart create mode 100644 mycore_api_old/test/panel_section_test.dart rename {mycore_api => mycore_api_old}/test/place_dto_test.dart (100%) create mode 100644 mycore_api_old/test/programmed_mode_test.dart create mode 100644 mycore_api_old/test/provider_api_test.dart create mode 100644 mycore_api_old/test/provider_dto_test.dart rename {mycore_api => mycore_api_old}/test/provider_test.dart (100%) create mode 100644 mycore_api_old/test/provider_type_test.dart create mode 100644 mycore_api_old/test/room_api_test.dart create mode 100644 mycore_api_old/test/room_create_or_update_detail_dto_test.dart create mode 100644 mycore_api_old/test/room_detail_dto_test.dart create mode 100644 mycore_api_old/test/room_main_detail_dto_all_of_test.dart create mode 100644 mycore_api_old/test/room_main_detail_dto_test.dart create mode 100644 mycore_api_old/test/room_summary_dto_test.dart rename {mycore_api => mycore_api_old}/test/screen_configuration_test.dart (100%) create mode 100644 mycore_api_old/test/screen_device_api_test.dart create mode 100644 mycore_api_old/test/screen_device_test.dart rename {mycore_api => mycore_api_old}/test/screen_widget_test.dart (100%) create mode 100644 mycore_api_old/test/smart_garden_message_test.dart create mode 100644 mycore_api_old/test/smart_printer_message_test.dart rename {mycore_api => mycore_api_old}/test/state_test.dart (100%) create mode 100644 mycore_api_old/test/time_period_alarm_test.dart create mode 100644 mycore_api_old/test/token_api_test.dart create mode 100644 mycore_api_old/test/token_dto_test.dart create mode 100644 mycore_api_old/test/trigger_test.dart create mode 100644 mycore_api_old/test/trigger_type_test.dart create mode 100644 mycore_api_old/test/twitter_api_test.dart create mode 100644 mycore_api_old/test/twitter_auth_model_test.dart create mode 100644 mycore_api_old/test/user_api_test.dart create mode 100644 mycore_api_old/test/user_info_detail_dto_test.dart create mode 100644 mycore_api_old/test/user_info_test.dart create mode 100644 mycore_api_old/test/user_test.dart create mode 100644 mycore_api_old/test/values_api_test.dart create mode 100644 mycore_api_old/test/view_by_test.dart rename {mycore_api => mycore_api_old}/test/widget_test.dart (100%) diff --git a/README.md b/README.md index 947d1e0..de05da5 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,23 @@ A few resources to get you started if this is your first Flutter project: For help getting started with Flutter, view our [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. + +# OPENAPI Generation cmd + +flutter clean + +flutter pub get + +flutter pub run build_runner build --delete-conflicting-outputs + +Le fichier est dans le projet. + +# Publication sur le Google PlayStore + +// Les paramètres de signing sont les mêmes que pour l'application tablet (donc la même android key). + +Puis : + +flutter build appbundle + +Faut pas oublier d'aller changer la version avant chaque upload de version (Puis mettre l'app bundle dans le dossier du PC, peut-être mettre sur le repos aussi ?) diff --git a/android/app/build.gradle b/android/app/build.gradle index c54655d..59b6864 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdkVersion 32 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -36,16 +36,62 @@ android { disable 'InvalidPackage' } + def versionPropsFile = file('version.properties') + def value = 0 + + Properties versionProps = new Properties() + + if (!versionPropsFile.exists()) { + versionProps['VERSION_MAJOR'] = "1" + versionProps['VERSION_MINOR'] = "0" + versionProps['VERSION_PATCH'] = "0" + versionProps['VERSION_BUILD'] = "0" + versionProps.store(versionPropsFile.newWriter(), null) + } + + def runTasks = gradle.startParameter.taskNames + if ('assembleRelease' in runTasks) { + value = 1 + } + + if (versionPropsFile.canRead()) { + + versionProps.load(new FileInputStream(versionPropsFile)) + + versionProps['VERSION_PATCH'] = (versionProps['VERSION_PATCH'].toInteger() + value).toString() + versionProps['VERSION_BUILD'] = (versionProps['VERSION_BUILD'].toInteger() + 1).toString() + + versionProps.store(versionPropsFile.newWriter(), null) + + // change major and minor version here + def mVersionName = "${versionProps['VERSION_MAJOR']}.${versionProps['VERSION_MINOR']}.${versionProps['VERSION_PATCH']}" + + defaultConfig { + applicationId "be.unov.myhomie" // leave it at the value you have in your file + minSdkVersion 23 // this as well + targetSdkVersion 28 // and this + versionCode versionProps['VERSION_BUILD'].toInteger() + versionName "${mVersionName} Build: ${versionProps['VERSION_BUILD']}" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + } + else { + throw new GradleException("Could not read version.properties!") + } + +/* defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "be.unov.myhomie" minSdkVersion 20 - targetSdkVersion 31 + targetSdkVersion 32 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } + */ + buildTypes { release { // TODO: Add your own signing config for the release build. diff --git a/android/app/version.properties b/android/app/version.properties new file mode 100644 index 0000000..13048d8 --- /dev/null +++ b/android/app/version.properties @@ -0,0 +1,5 @@ +#Fri Mar 17 18:03:23 CET 2023 +VERSION_BUILD=17 +VERSION_MAJOR=1 +VERSION_MINOR=0 +VERSION_PATCH=0 diff --git a/lib/Components/Buttons/rounded_button.dart b/lib/Components/Buttons/rounded_button.dart index 4005aa6..e578074 100644 --- a/lib/Components/Buttons/rounded_button.dart +++ b/lib/Components/Buttons/rounded_button.dart @@ -2,35 +2,44 @@ import 'package:flutter/material.dart'; import 'package:myhomie_app/constants.dart'; class RoundedButton extends StatelessWidget { - final String text; - final Function press; + final String? text; + final Function? press; + final IconData? icon; final Color color, textColor; - final double fontSize; + final double? fontSize; + final double? vertical; + final double? horizontal; const RoundedButton({ - Key key, + Key? key, this.text, this.press, + this.icon, this.color = kBodyTextColor, // TODO this.textColor = Colors.white, - this.fontSize + this.fontSize, + this.vertical, + this.horizontal }) : super(key: key); @override Widget build(BuildContext context) { Size size = MediaQuery.of(context).size; - return FlatButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(35.0), - //side: BorderSide(color: kSubTitleColor) + 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), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ) + ) ), - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 25), - color: color, onPressed: () => { - press() + press!() }, child: Text( - text, + text!, style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), ), ); diff --git a/lib/Components/Custom_Navigation_Bar/custom_nav_item.dart b/lib/Components/Custom_Navigation_Bar/custom_nav_item.dart index cb66ce5..c9dad62 100644 --- a/lib/Components/Custom_Navigation_Bar/custom_nav_item.dart +++ b/lib/Components/Custom_Navigation_Bar/custom_nav_item.dart @@ -10,7 +10,7 @@ class CustomNavItem extends StatelessWidget { final int id; final Function setPage; - const CustomNavItem({this.setPage, this.icon, this.id}); + const CustomNavItem({required this.setPage, required this.icon, required this.id}); @override Widget build(BuildContext context) { 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 be53d64..592e1c0 100644 --- a/lib/Components/rounded_input_field.dart +++ b/lib/Components/rounded_input_field.dart @@ -3,14 +3,14 @@ import 'package:myhomie_app/Components/text_field_container.dart'; import 'package:myhomie_app/constants.dart'; class RoundedInputField extends StatelessWidget { - final String hintText; - final IconData icon; - final ValueChanged onChanged; - final String initialValue; + final String? hintText; + final IconData? icon; + final ValueChanged? onChanged; + final String? initialValue; final Color color, textColor, iconColor; - final int maxLength; + final int? maxLength; const RoundedInputField({ - Key key, + Key? key, this.hintText, this.initialValue, this.icon, diff --git a/lib/Components/rounded_password_field.dart b/lib/Components/rounded_password_field.dart index 7bbac63..d482aae 100644 --- a/lib/Components/rounded_password_field.dart +++ b/lib/Components/rounded_password_field.dart @@ -3,9 +3,9 @@ import 'package:myhomie_app/Components/text_field_container.dart'; import 'package:myhomie_app/constants.dart'; class RoundedPasswordField extends StatelessWidget { - final ValueChanged onChanged; + final ValueChanged? onChanged; const RoundedPasswordField({ - Key key, + Key? key, this.onChanged, }) : super(key: key); diff --git a/lib/Components/text_field_container.dart b/lib/Components/text_field_container.dart index e97bffc..be99782 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:myhomie_app/constants.dart'; class TextFieldContainer extends StatelessWidget { - final Widget child; + final Widget? child; final Color color; const TextFieldContainer({ - Key key, + Key? key, this.child, this.color = kBackgroundColor, // TODO }) : super(key: key); diff --git a/lib/Helpers/DatabaseHelper.dart b/lib/Helpers/DatabaseHelper.dart index 488d3bd..631d75c 100644 --- a/lib/Helpers/DatabaseHelper.dart +++ b/lib/Helpers/DatabaseHelper.dart @@ -19,12 +19,9 @@ class DatabaseHelper { DatabaseHelper._privateConstructor(); static final DatabaseHelper instance = DatabaseHelper._privateConstructor(); - static Database _database; - Future get database async { - if (_database != null) return _database; - _database = await _initDatabase(); - return _database; - } + static Database? _database; + Future get database async => + _database ??= await _initDatabase(); _initDatabase() async { String path = join(await getDatabasesPath(), _databaseName); @@ -48,8 +45,14 @@ class DatabaseHelper { Future insert(HomieAppContext homieAppContext) async { Database db = await instance.database; - var res = await db.insert(table, homieAppContext.toMap()); - return res; + var test = await instance.getData(); + if(test != null) { + var res = await db.update(table, homieAppContext.toMap()); + return res; + } else { + var res = await db.insert(table, homieAppContext.toMap()); + return res; + } } Future update(HomieAppContext homieAppContext) async { @@ -75,15 +78,17 @@ class DatabaseHelper { return await db.delete(table, where: '$columnUserId = ?', whereArgs: [userId]); } - Future clearTable() async { + Future>> clearTable() async { Database db = await instance.database; return await db.rawQuery("DELETE FROM $table"); } - Future getData() async { - HomieAppContext homieAppContext; + Future getData() async { + HomieAppContext? homieAppContext; await DatabaseHelper.instance.queryAllRows().then((value) { + print("value"); + print(value); value.forEach((element) { print("DB - CONTEXT --- "); diff --git a/lib/Helpers/MQTTHelper.dart b/lib/Helpers/MQTTHelper.dart index 9c42773..2fc6f18 100644 --- a/lib/Helpers/MQTTHelper.dart +++ b/lib/Helpers/MQTTHelper.dart @@ -21,22 +21,22 @@ class MQTTHelper { print(homieAppContext.clientMQTT); - homieAppContext.clientMQTT.updates.listen((List> c) async { + homieAppContext.clientMQTT.updates!.listen((List> c) async { print("IN Received message"); - final MqttPublishMessage message = c[0].payload; - final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message); - print('Received message:$payload from topic: ${c[0].topic}'); + final MqttMessage? message = c[0].payload; + /*final payload = MqttPublishPayload.bytesToStringAsString(message!); + print('Received message:$payload from topic: ${c[0].topic}');*/ - appContext.setLastMessage('Received message:$payload from topic: ${c[0].topic}'); + appContext.setLastMessage('Received message:$message from topic: ${c[0].topic}'); var topic = c[0].topic.split('/')[0]; switch(topic) { case "config": - print('Get message in topic config = $payload'); + print('Get message in topic config = $message'); break; case "player": - print('Get message in topic player = $payload'); + print('Get message in topic player = $message'); // refresh device info try { } @@ -68,7 +68,7 @@ class MQTTHelper { print('Unsubscribed topic: $topic'); } - Future connect(dynamic appContext) async { + Future connect(dynamic appContext) async { HomieAppContext homieAppContext = appContext.getContext(); if (homieAppContext == null) { @@ -78,7 +78,7 @@ class MQTTHelper { print(homieAppContext.host); if(homieAppContext.host != null) { - homieAppContext.clientMQTT = MqttServerClient.withPort(homieAppContext.host.replaceAll('http://', ''), 'homie_app_'+ Uuid().v1(), 1883); + homieAppContext.clientMQTT = MqttServerClient.withPort(homieAppContext.host!.replaceAll('http://', ''), 'homie_app_'+ Uuid().v1(), 1883); isInstantiated = true; homieAppContext.clientMQTT.logging(on: false); @@ -98,7 +98,7 @@ class MQTTHelper { .keepAliveFor(60) .withWillTopic('player/status') .withWillMessage(jsonEncode(message)) - .withClientIdentifier('tablet_app_'+homieAppContext.userId) + .withClientIdentifier('tablet_app_'+homieAppContext.userId!) .startClean() .withWillQos(MqttQos.atLeastOnce); diff --git a/lib/Models/homieContext.dart b/lib/Models/homieContext.dart index e4255a1..8c18b66 100644 --- a/lib/Models/homieContext.dart +++ b/lib/Models/homieContext.dart @@ -1,19 +1,18 @@ import 'package:flutter/material.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; -import 'package:mycoreapi/api.dart'; import 'dart:convert'; import 'package:myhomie_app/client.dart'; class HomieAppContext with ChangeNotifier{ - Client clientAPI; - MqttServerClient clientMQTT; - String userId; - String homeId; - String token; - String host; - String language; + Client clientAPI = Client("http://192.168.31.140"); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089 + MqttServerClient clientMQTT = MqttServerClient.withPort("192.168.31.140", "TODO", 1883); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089 + String? userId; + String? homeId; + String? token; + String? host; + String? language; HomieAppContext({this.userId, this.homeId, this.host, this.language, this.token}); @@ -41,6 +40,6 @@ class HomieAppContext with ChangeNotifier{ // Implement toString to make it easier to see information about @override String toString() { - return 'TabletAppContext{userId: $userId, homeId: $homeId, language: $language, host: $host}'; + return 'HomieAppContext{userId: $userId, homeId: $homeId, language: $language, host: $host}'; } } \ No newline at end of file diff --git a/lib/Screens/Debug/DebugPage.dart b/lib/Screens/Debug/DebugPage.dart index bb25a43..e3ecb0c 100644 --- a/lib/Screens/Debug/DebugPage.dart +++ b/lib/Screens/Debug/DebugPage.dart @@ -5,7 +5,7 @@ import 'package:myhomie_app/app_context.dart'; import 'package:provider/provider.dart'; class DebugPage extends StatefulWidget { - DebugPage({Key key}) : super(key: key); + DebugPage({Key? key}) : super(key: key); @override _DebugPageState createState() => _DebugPageState(); diff --git a/lib/Screens/Login/components/background.dart b/lib/Screens/Login/components/background.dart index cb5512b..a307c03 100644 --- a/lib/Screens/Login/components/background.dart +++ b/lib/Screens/Login/components/background.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; class Background extends StatelessWidget { final Widget child; const Background({ - Key key, - @required this.child, + Key? key, + required this.child, }) : super(key: key); @override diff --git a/lib/Screens/Login/components/body.dart b/lib/Screens/Login/components/body.dart index 94e81f9..8512893 100644 --- a/lib/Screens/Login/components/body.dart +++ b/lib/Screens/Login/components/body.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:myhomie_app/Components/Buttons/rounded_button.dart'; import 'package:myhomie_app/Components/rounded_input_field.dart'; import 'package:myhomie_app/Components/rounded_password_field.dart'; @@ -18,7 +18,7 @@ import '../../../Helpers/DatabaseHelper.dart'; class Body extends StatefulWidget { const Body({ - Key key, + Key? key, }) : super(key: key); @override @@ -27,7 +27,8 @@ class Body extends StatefulWidget { class _BodyState extends State { final clientAPI = Client('http://192.168.31.140'); // TODO field - TokenDTO token; + TokenDTO? token; + @override Widget build(BuildContext context) { final appContext = Provider.of(context); @@ -62,33 +63,37 @@ class _BodyState extends State { if (connected) { HomieAppContext homieAppContext = new HomieAppContext(); - UserInfoDetailDTO user = await clientAPI.userApi.userGet("6182c472e20a6dbcfe8fe82c"); // TO replace user get by email + UserInfoDetailDTO? user = await clientAPI.userApi!.userGet("6182c472e20a6dbcfe8fe82c"); // TO replace user get by email print(user); - homieAppContext.host = "http://192.168.31.140";// TODO - homieAppContext.clientMQTT = new MqttServerClient(homieAppContext.host.replaceAll('http://', ''),'my_homie_app_'+ Uuid().v1()); - homieAppContext.clientAPI = clientAPI; - homieAppContext.userId = user.id; - homieAppContext.language = user.language == null ? 'FR': user.language; // - homieAppContext.token = token.accessToken; + if(user != null) { + homieAppContext.host = "http://192.168.31.140";// TODO + homieAppContext.clientMQTT = new MqttServerClient(homieAppContext.host!.replaceAll('http://', ''),'my_homie_app_'+ Uuid().v1()); + homieAppContext.clientAPI = clientAPI; + homieAppContext.userId = user.id; + homieAppContext.language = user.language == null ? 'FR': user.language; // + homieAppContext.token = token!.accessToken; - // TODO check if we select by default or ask user to select - if(user.homeIds.length > 0) { - homieAppContext.homeId = user.homeIds.first; - } else { - // TODO invite home creation + // TODO check if we select by default or ask user to select + if(user.homeIds!.length > 0) { + homieAppContext.homeId = user.homeIds!.first; + } else { + // TODO invite home creation + } + + setState(() { + appContext.setContext(homieAppContext); + }); } - setState(() { - appContext.setContext(homieAppContext); - }); - // STORE IT LOCALLY (SQLite) - HomieAppContext localContext = await DatabaseHelper.instance.getData(); + HomieAppContext? localContext = await DatabaseHelper.instance.getData(); if (localContext != null) { // Check if sql DB exist + print("STORE IT LOCALLY - update"); await DatabaseHelper.instance.update(homieAppContext); } else { + print("STORE IT LOCALLY - insert"); await DatabaseHelper.instance.insert(homieAppContext); } @@ -143,11 +148,11 @@ class _BodyState extends State { try { //LoginDTO loginDTO = new LoginDTO(email: "test@email.be", password: "kljqsdkljqsd"); LoginDTO loginDTO = new LoginDTO(email: "", password: ""); - token = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO); + token = await clientAPI.authenticationApi!.authenticationAuthenticateWithJson(loginDTO); print("Token ??"); print(token); - print(token.accessToken); - setAccessToken(token.accessToken); + print(token!.accessToken); + setAccessToken(token!.accessToken!); isConnected = true; // TODO update context + db } catch (e) { @@ -215,10 +220,11 @@ class _BodyState extends State { } void setAccessToken(String accessToken) { - clientAPI.apiApi.authentications.forEach((key, auth) { + clientAPI.apiApi!.addDefaultHeader('authorization', 'Bearer '+accessToken); + /*clientAPI.apiApi!.authentications!.forEach((key, auth) { if (auth is OAuth) { auth.accessToken = accessToken; } - }); + });*/ } } \ No newline at end of file diff --git a/lib/Screens/Main/Automations/automations.dart b/lib/Screens/Main/Automations/automations.dart index 1049c2c..ec5c31f 100644 --- a/lib/Screens/Main/Automations/automations.dart +++ b/lib/Screens/Main/Automations/automations.dart @@ -3,7 +3,7 @@ import 'package:myhomie_app/app_context.dart'; import 'package:provider/provider.dart'; class AutomationsScreen extends StatefulWidget { - AutomationsScreen({Key key}) : super(key: key); + AutomationsScreen({Key? key}) : super(key: key); @override _AutomationsScreenState createState() => _AutomationsScreenState(); diff --git a/lib/Screens/Main/Energy/energy.dart b/lib/Screens/Main/Energy/energy.dart index 32eeafe..b471146 100644 --- a/lib/Screens/Main/Energy/energy.dart +++ b/lib/Screens/Main/Energy/energy.dart @@ -3,7 +3,7 @@ import 'package:myhomie_app/app_context.dart'; import 'package:provider/provider.dart'; class EnergyScreen extends StatefulWidget { - EnergyScreen({Key key}) : super(key: key); + EnergyScreen({Key? key}) : super(key: key); @override _EnergyScreenState createState() => _EnergyScreenState(); diff --git a/lib/Screens/Main/Home/home.dart b/lib/Screens/Main/Home/home.dart index 1743836..7dbbe3a 100644 --- a/lib/Screens/Main/Home/home.dart +++ b/lib/Screens/Main/Home/home.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:myhomie_app/Components/loading.dart'; import 'package:myhomie_app/Models/homieContext.dart'; import 'package:myhomie_app/app_context.dart'; @@ -7,7 +7,7 @@ import 'package:myhomie_app/constants.dart'; import 'package:provider/provider.dart'; class HomeScreen extends StatefulWidget { - HomeScreen({Key key}) : super(key: key); + HomeScreen({Key? key}) : super(key: key); @override _HomeScreenState createState() => _HomeScreenState(); @@ -35,13 +35,13 @@ class _HomeScreenState extends State { return interfaceElements(); } else {*/ return FutureBuilder( - future: homieAppContext.clientAPI.roomApi.roomGetAllWithMainDetails(homieAppContext.homeId), - builder: (context, AsyncSnapshot> snapshot) { + future: homieAppContext.clientAPI.roomApi!.roomGetAllWithMainDetails(homieAppContext.homeId!), + builder: (context, AsyncSnapshot?> snapshot) { if (snapshot.connectionState == ConnectionState.done) { print("connectionState done"); print(snapshot); if(snapshot.data != null) { - return interfaceElements(snapshot.data); + return interfaceElements(snapshot.data!); } else { return Text("No data - or error"); } @@ -70,7 +70,7 @@ class _HomeScreenState extends State { displacement: 20, onRefresh: () async { print("onRefresh"); - await homieAppContext.clientAPI.roomApi.roomGetAllWithMainDetails(homieAppContext.homeId); + await homieAppContext.clientAPI.roomApi!.roomGetAllWithMainDetails(homieAppContext.homeId!); }, child: Container( height: size.height * 0.8, @@ -101,14 +101,14 @@ class _HomeScreenState extends State { Align( alignment: Alignment.bottomLeft, child: Text( - roomsMaindetails[index].name, + roomsMaindetails[index].name!, style: new TextStyle(fontSize: kDetailSize, color: kBackgroundSecondGrey), ), ), ], ), - if(roomsMaindetails[index].isTemperature) + if(roomsMaindetails[index].isTemperature!) Positioned( bottom: 10, left: 0, @@ -120,7 +120,7 @@ class _HomeScreenState extends State { color: kMainColor, ), Text( - roomsMaindetails[index].temperature, + roomsMaindetails[index].temperature!, style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey), maxLines: 1, ), @@ -128,10 +128,10 @@ class _HomeScreenState extends State { ) ), - if(roomsMaindetails[index].isHumidity) + if(roomsMaindetails[index].isHumidity!) Positioned( bottom: 10, - left: roomsMaindetails[index].isTemperature ? 55 : 0, + left: roomsMaindetails[index].isTemperature! ? 60 : 0, child: Row( children: [ Icon( @@ -140,7 +140,7 @@ class _HomeScreenState extends State { color: kMainColor, ), Text( - roomsMaindetails[index].humidity, + roomsMaindetails[index].humidity!, style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey), maxLines: 1, ), @@ -148,7 +148,7 @@ class _HomeScreenState extends State { ) ), - if(roomsMaindetails[index].isDoor) + if(roomsMaindetails[index].isDoor!) Positioned( bottom: 10, right: 5, @@ -157,22 +157,22 @@ class _HomeScreenState extends State { Icon( Icons.motion_photos_on_rounded, size: 20, - color: !roomsMaindetails[index].door ? kMainColor : kBackgroundSecondGrey, + color: !roomsMaindetails[index].door! ? kMainColor : kBackgroundSecondGrey, ), ], ) ), - if(roomsMaindetails[index].isMotion) + if(roomsMaindetails[index].isMotion!) Positioned( bottom: 10, - right: roomsMaindetails[index].isDoor ? 20 : 5, + right: roomsMaindetails[index].isDoor! ? 20 : 5, child: Row( children: [ Icon( Icons.directions_walk, size: 20, - color: roomsMaindetails[index].motion ? kMainColor : kBackgroundSecondGrey, + color: roomsMaindetails[index].motion! ? kMainColor : kBackgroundSecondGrey, ), ], ) diff --git a/lib/Screens/Main/MainPage.dart b/lib/Screens/Main/MainPage.dart index 427238f..b85046c 100644 --- a/lib/Screens/Main/MainPage.dart +++ b/lib/Screens/Main/MainPage.dart @@ -22,7 +22,7 @@ PageController pageController = PageController(initialPage: 0); int currentIndex = 0; class MainPage extends StatefulWidget { - MainPage({Key key}) : super(key: key); + MainPage({Key? key}) : super(key: key); @override _MainPageState createState() => _MainPageState(); diff --git a/lib/Screens/Main/Profile/profile.dart b/lib/Screens/Main/Profile/profile.dart index b75b33d..8ad52e8 100644 --- a/lib/Screens/Main/Profile/profile.dart +++ b/lib/Screens/Main/Profile/profile.dart @@ -3,7 +3,7 @@ import 'package:myhomie_app/app_context.dart'; import 'package:provider/provider.dart'; class ProfileScreen extends StatefulWidget { - ProfileScreen({Key key}) : super(key: key); + ProfileScreen({Key? key}) : super(key: key); @override _ProfileScreenState createState() => _ProfileScreenState(); diff --git a/lib/Screens/Main/Security/security.dart b/lib/Screens/Main/Security/security.dart index 3513cdf..2bd2185 100644 --- a/lib/Screens/Main/Security/security.dart +++ b/lib/Screens/Main/Security/security.dart @@ -3,7 +3,7 @@ import 'package:myhomie_app/app_context.dart'; import 'package:provider/provider.dart'; class SecurityScreen extends StatefulWidget { - SecurityScreen({Key key}) : super(key: key); + SecurityScreen({Key? key}) : super(key: key); @override _SecurityScreenState createState() => _SecurityScreenState(); diff --git a/lib/api/openApiTest.dart b/lib/api/openApiTest.dart new file mode 100644 index 0000000..e9b1b15 --- /dev/null +++ b/lib/api/openApiTest.dart @@ -0,0 +1,15 @@ +import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; + +@Openapi( + additionalProperties: + AdditionalProperties(pubName: 'mycore_api', pubAuthor: 'Fransolet Thomas', useEnumExtension: true), + inputSpecFile: 'lib/api/swagger.yaml', + generatorName: Generator.dart, + alwaysRun: true, + outputDirectory: 'mycore_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..eb3b7f6 --- /dev/null +++ b/lib/api/swagger.yaml @@ -0,0 +1,4888 @@ +x-generator: NSwag v13.9.2.0 (NJsonSchema v10.3.1.0 (Newtonsoft.Json v12.0.0.0)) +openapi: 3.0.0 +info: + title: MyCore Service + description: API description + version: Version Pre-Alpha +servers: + - url: http://192.168.31.140 +paths: + /api/books: + get: + tags: + - Books + operationId: Books_GetAll + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Book' + security: + - bearer: [] + post: + tags: + - Books + operationId: Books_Create + requestBody: + x-name: book + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + security: + - bearer: [] + /api/books/{id}: + get: + tags: + - Books + operationId: Books_Get + 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/Book' + security: + - bearer: [] + put: + tags: + - Books + operationId: Books_Update + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + requestBody: + x-name: bookIn + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + delete: + tags: + - Books + operationId: Books_Delete + 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 + security: + - bearer: [] + /api/device/{homeId}: + get: + tags: + - Device + summary: Get all devices summary + operationId: Device_GetAll + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceSummaryDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/device/detail/{deviceId}: + get: + tags: + - Device + summary: Get a specific device info + operationId: Device_GetDetail + parameters: + - name: deviceId + in: path + required: true + description: id of device + schema: + type: string + nullable: 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/{homeId}/type/{type}: + get: + tags: + - Device + summary: Get list of devices from a type + operationId: Device_GetDevicesByType + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + - name: type + in: path + required: true + description: device type + schema: + $ref: '#/components/schemas/DeviceType' + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/device: + post: + tags: + - Device + summary: Create a device + operationId: Device_Create + requestBody: + x-name: deviceDetailDTO + description: Device to create + 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 + security: + - bearer: [] + /api/device/action: + post: + tags: + - Device + summary: Send action to device + operationId: Device_SendAction + requestBody: + x-name: action + description: Action to sent + content: + application/json: + schema: + $ref: '#/components/schemas/Action' + 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 + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/device/{homeId}/fromProvider/{providerId}: + post: + tags: + - Device + summary: Create devices from provider + operationId: Device_CreateDevicesFromProvider + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + - name: providerId + in: path + required: true + description: Id of Provider + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '401': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '421': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + get: + tags: + - Device + summary: Get devices from provider + operationId: Device_GetDevicesFromProvider + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + - name: providerId + in: path + required: true + description: Id of Provider + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $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: [] + delete: + tags: + - Device + summary: Delete devices from provider + operationId: Device_DeleteDevicesFromProvider + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + - name: providerId + in: path + required: true + description: Id of Provider + schema: + type: string + nullable: true + x-position: 2 + 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/device/zigbee2Mqtt/{homeId}: + get: + tags: + - Device + summary: Get all zigbee2Mqtt devices + operationId: Device_GetDevicesFromZigbee2Mqtt + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $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/{deviceId}: + put: + tags: + - Device + summary: Update a device + operationId: Device_Update + parameters: + - name: deviceId + in: path + required: true + schema: + type: string + x-position: 2 + requestBody: + x-name: deviceDetailDTO + description: Device to update + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: 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 + security: + - bearer: [] + delete: + tags: + - Device + summary: Delete a device + operationId: Device_Delete + parameters: + - name: deviceId + in: path + required: true + description: Id of device to delete + 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/device/home/{homeId}: + delete: + tags: + - Device + summary: Delete all device for a specified home + operationId: Device_DeleteAllForHome + parameters: + - name: homeId + in: path + required: true + description: Id of home + 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/energy/electricity: + get: + tags: + - Energy + summary: Get summary production of Kwh/Year + operationId: Energy_GetElectricityProduction + parameters: + - name: homeId + in: query + schema: + type: string + nullable: true + x-position: 1 + - name: viewBy + in: query + schema: + $ref: '#/components/schemas/ViewBy' + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ElectricityProduction' + security: + - bearer: [] + /api/iot/smartprinter/{idDevice}: + get: + tags: + - IOT + summary: Retrieve all SmartPrinterMessage + operationId: IOT_GetSmartPrinterMessages + parameters: + - name: id + in: query + description: Id of the smart printer message + schema: + type: integer + format: int32 + x-position: 1 + - name: idDevice + in: path + required: true + schema: + type: string + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SmartPrinterMessage' + security: + - bearer: [] + post: + tags: + - IOT + summary: It's the method to post data from mqtt broker to Database (Thanks Rpi!) + operationId: IOT_PostToDBPrinter + parameters: + - name: idDevice + in: path + required: true + description: Id of the device to upload to DB + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: content + description: Content that will be uploaded + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SmartPrinterMessage' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + /api/iot/smartgarden/{idDevice}: + post: + tags: + - IOT + summary: It's the method to post data from mqtt broker to Database (Thanks Rpi!) + operationId: IOT_PostToDBSmartGarden + parameters: + - name: idDevice + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: content + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SmartGardenMessage' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + /api/odd/country/{id}/{oddRequest}: + get: + tags: + - Odd + summary: Get odds for one country and one odd value maximum + operationId: Odd_GetForCountry + parameters: + - name: id + in: path + required: true + description: id of country, e.g = BE for Belgium + schema: + type: string + nullable: true + x-position: 1 + - name: oddRequest + in: path + required: true + description: Odd Maximum value + schema: + type: number + format: double + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/OddNice' + '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/odd/{oddRequest}: + get: + tags: + - Odd + summary: Get odds for one country and one odd value maximum + operationId: Odd_GetAll + parameters: + - name: oddRequest + in: path + required: true + description: Odd Maximum value + schema: + type: number + format: double + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/OddNice' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/provider/{homeId}: + get: + tags: + - Provider + summary: 'Get all home providers ' + operationId: Provider_GetAll + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProviderDTO' + '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/provider: + post: + tags: + - Provider + summary: Create a provider + operationId: Provider_Create + requestBody: + x-name: providerDTO + description: Provider to create + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderDTO' + '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: [] + put: + tags: + - Provider + summary: Update a provider + operationId: Provider_Update + requestBody: + x-name: providerDTO + description: Provider to update + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderDTO' + 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/provider/{providerId}: + delete: + tags: + - Provider + summary: Delete a provider + operationId: Provider_Delete + parameters: + - name: providerId + in: path + required: true + description: Id of provider to delete + 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/device/screen: + get: + tags: + - ScreenDevice + summary: Get all screen devices + operationId: ScreenDevice_GetAllScreenDevices + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ScreenDevice' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - ScreenDevice + summary: Create screen device + operationId: ScreenDevice_CreateDevice + requestBody: + x-name: screenDevice + description: Screen device to create + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + '400': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - ScreenDevice + summary: Update screen device + operationId: ScreenDevice_UpdateDevice + requestBody: + x-name: screenDevice + description: Screen device to update + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + '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/screen/{screenDeviceId}: + get: + tags: + - ScreenDevice + summary: Get screen device info + operationId: ScreenDevice_GetDeviceInfo + parameters: + - name: screenDeviceId + in: path + required: true + description: Id of the screen device you want to get information + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + '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/screen/{deviceId}: + delete: + tags: + - ScreenDevice + summary: Delete device + operationId: ScreenDevice_DeleteDevice + parameters: + - name: deviceId + in: path + required: true + description: Screen device id to update + 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/mqtt: + post: + tags: + - MQTT + summary: Publish mqtt test + operationId: MQTT_PublishMessage + requestBody: + x-name: mqttMessageDTO + description: Message to send + content: + application/json: + schema: + $ref: '#/components/schemas/MqttMessageDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: boolean + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/layout/panelSection: + get: + tags: + - Layout + summary: 'It''s a test ! :) ' + operationId: Layout_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PanelSection' + /api/token: + post: + tags: + - Token + summary: Connect user + operationId: Token_ConnectUser + requestBody: + x-name: loginDTO + description: login info + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/user: + get: + tags: + - User + summary: 'Get a list of user ' + operationId: User_GetAll + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserInfo' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - User + summary: Create an user + operationId: User_CreateUser + requestBody: + x-name: newUser + description: New user info + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + '400': + 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: + - User + summary: Update an user + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + description: User to update + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + '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 + summary: 'Get a specific user ' + operationId: User_Get + parameters: + - name: id + in: path + required: true + description: id user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - User + summary: Delete an user + operationId: User_DeleteUser + parameters: + - name: id + in: path + required: true + description: Id of user to delete + 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/user/email/{email}: + get: + tags: + - User + summary: Get a specific user by email + operationId: User_GetByEmail + parameters: + - name: email + in: path + required: true + description: user email + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/test: + get: + tags: + - Values + summary: 'It''s a test ! :) ' + operationId: Values_GetAll + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + type: string + post: + tags: + - Values + operationId: Values_Post + requestBody: + x-name: value + content: + application/json: + schema: + type: string + required: true + x-position: 1 + responses: + '200': + description: '' + security: + - bearer: [] + /api/test/{id}: + get: + tags: + - Values + operationId: Values_Get + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Values + operationId: Values_Put + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: value + content: + application/json: + schema: + type: string + required: true + x-position: 2 + responses: + '200': + description: '' + security: + - bearer: [] + delete: + tags: + - Values + operationId: Values_Delete + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + responses: + '200': + description: '' + security: + - bearer: [] + /api/alarm/{homeId}: + get: + tags: + - Alarm + summary: Get all alarm modes for the specified home + operationId: Alarm_GetAll + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AlarmModeDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/alarm/detail/{alarmModeId}: + get: + tags: + - Alarm + summary: Get detail info of a specified alarm mode + operationId: Alarm_GetDetail + parameters: + - name: alarmModeId + in: path + required: true + description: alarm id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmModeDetailDTO' + '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/alarm: + post: + tags: + - Alarm + summary: Create an alarm mode + operationId: Alarm_Create + requestBody: + x-name: alarmModeCreateOrUpdateDetailDTO + description: Alarm mode to create + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmModeCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmModeDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Alarm + summary: Update an alarm mode + operationId: Alarm_Update + requestBody: + x-name: alarmModeCreateOrUpdateDetailDTO + description: alarm mode to update + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmModeCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmModeDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/alarm/defaults/{homeId}: + post: + tags: + - Alarm + summary: Create default alarm modes + operationId: Alarm_CreateDefaultAlarms + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: boolean + '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/alarm/activate/{alarmModeId}: + post: + tags: + - Alarm + summary: Activate specified alarm mode + operationId: Alarm_Activate + parameters: + - name: alarmModeId + in: path + required: true + description: Alarm mode to activate + 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 + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/alarm/{alarmModeId}: + delete: + tags: + - Alarm + summary: Delete an alarm mode + operationId: Alarm_Delete + parameters: + - name: alarmModeId + in: path + required: true + description: Id of alarm mode to delete + 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 + '405': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/alarm/home/{homeId}: + delete: + tags: + - Alarm + summary: Delete all alarm mode for a specified home + operationId: Alarm_DeleteAllForHome + parameters: + - name: homeId + in: path + required: true + description: Home Id + 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 + summary: Authenticate with form parameters (used by Swagger test client) + 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: Token descriptor + 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 + summary: Authenticate with Json parameters (used by most clients) + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + description: Login DTO + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: Token descriptor + 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/automation/{homeId}: + get: + tags: + - Automation + summary: Get all automations for the specified home + operationId: Automation_GetAll + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AutomationDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/automation/detail/{automationId}: + get: + tags: + - Automation + summary: Get detail info of a specified automation + operationId: Automation_GetDetail + parameters: + - name: automationId + in: path + required: true + description: automation id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDetailDTO' + '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/automation: + post: + tags: + - Automation + summary: Create an automation + operationId: Automation_Create + requestBody: + x-name: automationDetailDTO + description: Automation to create + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Automation + summary: Update an automation + operationId: Automation_Update + requestBody: + x-name: automationDetailDTO + description: automation to update + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDetailDTO' + '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/automation/{automationId}: + delete: + tags: + - Automation + summary: Delete an automation + operationId: Automation_Delete + parameters: + - name: automationId + in: path + required: true + description: Id of automation to delete + 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/automation/home/{homeId}: + delete: + tags: + - Automation + summary: Delete all automation for a specified home + operationId: Automation_DeleteAllForHome + parameters: + - name: homeId + in: path + required: true + description: Home Id + 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/event/{homeId}: + get: + tags: + - Event + summary: 'Get events for the specified home ' + operationId: Event_Get + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + - name: DeviceId + in: query + schema: + type: string + nullable: true + x-position: 2 + - name: RoomId + in: query + schema: + type: string + nullable: true + x-position: 3 + - name: StartIndex + in: query + schema: + type: integer + format: int32 + x-position: 4 + - name: Count + in: query + schema: + type: integer + format: int32 + x-position: 5 + - name: DateStart + in: query + schema: + type: string + format: date-time + nullable: true + x-position: 6 + - name: DateEnd + in: query + schema: + type: string + format: date-time + nullable: true + x-position: 7 + - name: EventType + in: query + schema: + nullable: true + oneOf: + - $ref: '#/components/schemas/EventType' + x-position: 8 + - name: DeviceType + in: query + schema: + nullable: true + oneOf: + - $ref: '#/components/schemas/DeviceType' + x-position: 9 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: >- + #/components/schemas/ListResponseOfEventDetailDTOAndEventHomeFilter + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/event/detail/{eventId}: + get: + tags: + - Event + summary: Get detail info of a specified event + operationId: Event_GetDetail + parameters: + - name: eventId + in: path + required: true + description: event id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/EventDetailDTO' + '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/event/{eventId}: + delete: + tags: + - Event + summary: Delete an event + operationId: Event_Delete + parameters: + - name: eventId + in: path + required: true + description: Id of event to delete + 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/event/home/{homeId}: + delete: + tags: + - Event + summary: Delete all events for a specified home + operationId: Event_DeleteAllForHome + parameters: + - name: homeId + in: path + required: true + description: Home Id + 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/group/{homeId}: + get: + tags: + - Group + summary: Get all groups for the specified home + operationId: Group_GetAll + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupSummaryDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/group/detail/{groupId}: + get: + tags: + - Group + summary: Get detail info of a specified group + operationId: Group_GetDetail + parameters: + - name: groupId + in: path + required: true + description: groupid + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupDetailDTO' + '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/group/{homeId}/type/{type}: + get: + tags: + - Group + summary: Get list of group from a type + operationId: Group_GetGroupsByType + parameters: + - name: homeId + in: path + required: true + description: home Id + schema: + type: string + nullable: true + x-position: 1 + - name: type + in: path + required: true + description: group type + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupSummaryDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/group/zigbee2Mqtt/{homeId}: + get: + tags: + - Group + summary: Get all zigbee2Mqtt groups + operationId: Group_GetGroupsFromZigbee2Mqtt + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupDetailDTO' + '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/group: + post: + tags: + - Group + summary: Create a group + operationId: Group_Create + requestBody: + x-name: groupCreateOrUpdateDetail + description: Group to create + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Group + summary: Update a group + operationId: Group_Update + requestBody: + x-name: groupCreateOrUpdateDetail + description: group to update + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateOrUpdateDetailDTO' + '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/group/{homeId}/fromZigbee: + post: + tags: + - Group + summary: Create groups from provider + operationId: Group_CreateDevicesFromZigbee2Mqtt + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupDetailDTO' + '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/group/{groupId}/device/{deviceId}: + delete: + tags: + - Group + summary: Delete device from a group + operationId: Group_Delete + parameters: + - name: deviceId + in: path + required: true + description: Id of device to delete from the group + schema: + type: string + nullable: true + x-position: 1 + - name: groupId + in: path + required: true + description: 'Id of group ' + schema: + type: string + nullable: true + x-position: 2 + 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/group/{groupId}: + delete: + tags: + - Group + summary: Delete a group + operationId: Group_Delete2 + parameters: + - name: groupId + in: path + required: true + description: 'Id of group ' + 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/group/home/{homeId}: + delete: + tags: + - Group + summary: Delete all group for a specified home + operationId: Group_DeleteAllForHome + parameters: + - name: homeId + in: path + required: true + description: Home Id + 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/home/{userId}: + get: + tags: + - Home + summary: Get all home for specified user + operationId: Home_GetAll + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/HomeDTO' + '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/home/detail/{homeId}: + get: + tags: + - Home + summary: Get detail info of a specified home + operationId: Home_GetDetail + parameters: + - name: homeId + in: path + required: true + description: home id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/HomeDetailDTO' + '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/home: + post: + tags: + - Home + summary: Create a home + operationId: Home_Create + requestBody: + x-name: createOrUpdateHomeDTO + description: Home to create + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrUpdateHomeDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/HomeDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Home + summary: Update a home + operationId: Home_Update + requestBody: + x-name: createOrUpdateHomeDTO + description: Home to update + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrUpdateHomeDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/HomeDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/home/{homeId}: + delete: + tags: + - Home + summary: Delete a home + operationId: Home_Delete + parameters: + - name: homeId + in: path + required: true + description: Id of home to delete + 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/room/{homeId}: + get: + tags: + - Room + summary: Get all rooms for the specified home + operationId: Room_GetAll + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RoomSummaryDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/room/{homeId}/details: + get: + tags: + - Room + summary: Get all rooms main details for the specified home + operationId: Room_GetAllWithMainDetails + parameters: + - name: homeId + in: path + required: true + description: Home Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RoomMainDetailDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/room/detail/{roomId}: + get: + tags: + - Room + summary: Get detail info of a specified room + operationId: Room_GetDetail + parameters: + - name: roomId + in: path + required: true + description: room id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomDetailDTO' + '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/room: + post: + tags: + - Room + summary: Create a room + operationId: Room_Create + requestBody: + x-name: roomCreateOrUpdateDetail + description: Room to create + content: + application/json: + schema: + $ref: '#/components/schemas/RoomCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Room + summary: Update a room + operationId: Room_Update + requestBody: + x-name: roomCreateOrUpdateDetail + description: room to update + content: + application/json: + schema: + $ref: '#/components/schemas/RoomCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomCreateOrUpdateDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/room/{roomId}: + put: + tags: + - Room + summary: Add devices in the specified room + operationId: Room_AddDeviceToRoom + parameters: + - name: roomId + in: path + required: true + description: Room Id + schema: + type: string + nullable: true + x-position: 1 + requestBody: + x-name: deviceIds + description: Device Ids + content: + application/json: + schema: + type: array + items: + type: string + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomDetailDTO' + '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: [] + delete: + tags: + - Room + summary: Delete a room + operationId: Room_Delete + parameters: + - name: roomId + in: path + required: true + description: 'Id of room ' + 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/room/{roomId}/device/{deviceId}: + delete: + tags: + - Room + summary: Delete device from a room + operationId: Room_Delete2 + parameters: + - name: deviceId + in: path + required: true + description: Id of device to delete from the room + schema: + type: string + nullable: true + x-position: 1 + - name: roomId + in: path + required: true + description: 'Id of room ' + schema: + type: string + nullable: true + x-position: 2 + 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/room/home/{homeId}: + delete: + tags: + - Room + summary: Delete all rooms for a specified home + operationId: Room_DeleteAllForHome + parameters: + - name: homeId + in: path + required: true + description: Home Id + 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: [] + /azure: + post: + tags: + - Azure + operationId: Azure_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/AzureADAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /facebook: + post: + tags: + - Facebook + operationId: Facebook_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/FacebookAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /google: + post: + tags: + - Google + operationId: Google_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /token: + post: + tags: + - Token + operationId: Token_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /twitter: + post: + tags: + - Twitter + operationId: Twitter_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/TwitterAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary +components: + schemas: + Book: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + bookName: + type: string + nullable: true + price: + type: number + format: decimal + category: + type: string + nullable: true + author: + type: string + nullable: true + DeviceSummaryDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + homeId: + type: string + nullable: true + description: + type: string + nullable: true + name: + type: string + nullable: true + model: + type: string + nullable: true + type: + $ref: '#/components/schemas/DeviceType' + status: + type: boolean + connectionStatus: + $ref: '#/components/schemas/ConnectionStatus' + roomId: + type: string + nullable: true + providerId: + type: string + nullable: true + providerName: + type: string + nullable: true + lastStateDate: + type: string + format: date-time + battery: + type: boolean + batteryStatus: + type: integer + format: int32 + DeviceType: + type: string + description: '' + x-enumNames: + - Sensor + - Actuator + - Camera + - Switch + - Light + - Sound + - Plug + - Multiplug + - Thermostat + - Valve + - Door + - Environment + - Motion + - Gateway + - Unknown + enum: + - Sensor + - Actuator + - Camera + - Switch + - Light + - Sound + - Plug + - Multiplug + - Thermostat + - Valve + - Door + - Environment + - Motion + - Gateway + - Unknown + ConnectionStatus: + type: string + description: '' + x-enumNames: + - Connected + - Disconnected + - Unknown + enum: + - Connected + - Disconnected + - Unknown + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceSummaryDTO' + - type: object + additionalProperties: false + properties: + firmwareVersion: + type: string + nullable: true + hardwareVersion: + type: string + nullable: true + port: + type: integer + format: int32 + meansOfCommunications: + type: array + nullable: true + items: + $ref: '#/components/schemas/MeansOfCommunication' + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + lastState: + type: string + nullable: true + ipAddress: + type: string + nullable: true + serviceIdentification: + type: string + nullable: true + manufacturerName: + type: string + nullable: true + groupIds: + type: array + nullable: true + items: + type: string + properties: + type: string + nullable: true + supportedOperations: + type: array + nullable: true + items: + type: string + MeansOfCommunication: + type: string + description: '' + x-enumNames: + - Wifi + - Bluetooth + - Zigbee + - Zwave + enum: + - Wifi + - Bluetooth + - Zigbee + - Zwave + Action: + type: object + additionalProperties: false + properties: + groupId: + type: string + nullable: true + deviceId: + type: string + nullable: true + states: + type: array + nullable: true + items: + $ref: '#/components/schemas/AutomationState' + rawRequest: + type: string + nullable: true + providerId: + type: string + nullable: true + type: + $ref: '#/components/schemas/ActionType' + isForce: + type: boolean + AutomationState: + type: object + additionalProperties: false + properties: + name: + type: string + nullable: true + value: + type: string + nullable: true + ActionType: + type: string + description: '' + x-enumNames: + - DELAY + - DEVICE + - HTTP + - ZIGBEE2MQTT + - MQTT + - GROUP + enum: + - DELAY + - DEVICE + - HTTP + - ZIGBEE2MQTT + - MQTT + - GROUP + ElectricityProduction: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + deviceId: + type: string + nullable: true + homeId: + type: string + nullable: true + watt: + type: number + format: double + ampere: + type: number + format: double + timestamp: + type: string + format: date-time + ViewBy: + type: string + description: '' + x-enumNames: + - Year + - Month + - Day + enum: + - Year + - Month + - Day + SmartPrinterMessage: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + type: string + nullable: true + time: + type: string + nullable: true + temperature: + type: number + format: double + pressure: + type: number + format: double + smoke: + type: integer + format: int32 + SmartGardenMessage: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + type: string + nullable: true + time: + type: string + nullable: true + temperature: + type: number + format: double + pressure: + type: number + format: double + humidity: + type: number + format: double + water: + type: integer + format: int32 + light: + type: integer + format: int32 + OddNice: + type: object + additionalProperties: false + properties: + teams: + type: array + nullable: true + items: + type: string + commence_time: + type: integer + format: int32 + home_team: + type: string + nullable: true + odds: + nullable: true + oneOf: + - $ref: '#/components/schemas/OddObject' + OddObject: + type: object + additionalProperties: false + properties: + homeOdd: + type: number + format: double + drawOdd: + type: number + format: double + visitOdd: + type: number + format: double + ProviderDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + type: + $ref: '#/components/schemas/ProviderType' + homeId: + type: string + nullable: true + endpoint: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + apiKey: + type: string + nullable: true + active: + type: boolean + ProviderType: + type: string + description: '' + x-enumNames: + - arlo + - meross + - yeelight + - zigbee2mqtt + enum: + - arlo + - meross + - yeelight + - zigbee2mqtt + ScreenDevice: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + location: + type: string + nullable: true + locationExplanation: + type: string + nullable: true + height: + type: integer + format: int32 + width: + type: integer + format: int32 + MqttMessageDTO: + type: object + additionalProperties: false + properties: + topic: + type: string + nullable: true + message: + type: string + nullable: true + online: + type: boolean + PanelSection: + type: object + additionalProperties: false + properties: + label: + type: string + nullable: true + icon: + type: string + nullable: true + color: + type: string + nullable: true + defaultRoute: + type: string + nullable: true + children: + type: array + nullable: true + items: + $ref: '#/components/schemas/PanelMenuItem' + PanelMenuItem: + type: object + additionalProperties: false + properties: + label: + type: string + nullable: true + route: + type: string + nullable: true + icon: + type: string + nullable: true + color: + type: string + nullable: true + badgeValue: + type: integer + format: int32 + badgeType: + type: string + nullable: true + children: + type: array + nullable: true + items: + $ref: '#/components/schemas/PanelMenuItem' + UserInfo: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + role: + 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 + birthday: + type: string + format: date-time + homeIds: + type: array + nullable: true + items: + type: string + dateCreation: + type: string + format: date-time + address: + type: string + nullable: true + city: + type: string + nullable: true + state: + type: string + nullable: true + country: + type: string + nullable: true + language: + type: string + nullable: true + timeZone: + type: string + nullable: true + postalCode: + type: integer + format: int32 + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + UserInfoDetailDTO: + 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 + language: + type: string + nullable: true + homeIds: + type: array + nullable: true + items: + type: string + AlarmModeDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + homeId: + type: string + nullable: true + name: + type: string + nullable: true + type: + $ref: '#/components/schemas/AlarmType' + activated: + type: boolean + isDefault: + type: boolean + notification: + type: boolean + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + AlarmType: + type: string + description: '' + x-enumNames: + - Home + - Absent + - Geolocalized + - Programmed + - Desarmed + - Custom + enum: + - Home + - Absent + - Geolocalized + - Programmed + - Desarmed + - Custom + AlarmModeDetailDTO: + allOf: + - $ref: '#/components/schemas/AlarmModeDTO' + - type: object + additionalProperties: false + properties: + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + programmedMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/ProgrammedMode' + geolocalizedMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/GeolocalizedMode' + Trigger: + type: object + additionalProperties: false + properties: + providerId: + type: string + nullable: true + deviceId: + type: string + nullable: true + stateName: + type: string + nullable: true + stateValue: + type: string + nullable: true + type: + $ref: '#/components/schemas/TriggerType' + TriggerType: + type: string + description: '' + x-enumNames: + - MQTT + - WEB + - TIME + enum: + - MQTT + - WEB + - TIME + ProgrammedMode: + type: object + additionalProperties: false + properties: + monday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + tuesday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + wednesday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + thursday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + friday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + saturday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + sunday: + type: array + nullable: true + items: + $ref: '#/components/schemas/TimePeriodAlarm' + TimePeriodAlarm: + type: object + additionalProperties: false + properties: + start: + type: string + nullable: true + end: + type: string + nullable: true + alarmMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/AlarmMode' + AlarmMode: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + homeId: + type: string + nullable: true + name: + type: string + nullable: true + activated: + type: boolean + isDefault: + type: boolean + notification: + type: boolean + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + type: + $ref: '#/components/schemas/AlarmType' + programmedMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/ProgrammedMode' + geolocalizedMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/GeolocalizedMode' + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + actions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + devicesIds: + type: array + nullable: true + items: + type: string + GeolocalizedMode: + type: object + additionalProperties: false + properties: + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + homeMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/AlarmMode' + absentMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/AlarmMode' + AlarmModeCreateOrUpdateDetailDTO: + allOf: + - $ref: '#/components/schemas/AlarmModeDTO' + - type: object + additionalProperties: false + properties: + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + actions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + programmedMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/ProgrammedMode' + geolocalizedMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/GeolocalizedMode' + 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 + AutomationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + active: + type: boolean + homeId: + type: string + nullable: true + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + AutomationDetailDTO: + allOf: + - $ref: '#/components/schemas/AutomationDTO' + - type: object + additionalProperties: false + properties: + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + conditions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Condition' + actions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + devicesIds: + type: array + nullable: true + items: + type: string + Condition: + type: object + additionalProperties: false + properties: + deviceId: + type: string + nullable: true + state: + nullable: true + oneOf: + - $ref: '#/components/schemas/AutomationState' + startTime: + type: string + nullable: true + endTime: + type: string + nullable: true + type: + $ref: '#/components/schemas/ConditionType' + value: + $ref: '#/components/schemas/ConditionValue' + ConditionType: + type: string + description: '' + x-enumNames: + - STATE + - TIME + enum: + - STATE + - TIME + ConditionValue: + type: string + description: '' + x-enumNames: + - EQUAL + - NOT_EQUAL + - BIGGER + - BIGGEST + - SMALLER + - SMALLEST + enum: + - EQUAL + - NOT_EQUAL + - BIGGER + - BIGGEST + - SMALLER + - SMALLEST + ListResponseOfEventDetailDTOAndEventHomeFilter: + type: object + additionalProperties: false + properties: + values: + type: array + nullable: true + items: + $ref: '#/components/schemas/EventDetailDTO' + requestParameters: + nullable: true + oneOf: + - $ref: '#/components/schemas/EventHomeFilter' + totalCount: + type: integer + format: int32 + actualCount: + type: integer + format: int32 + EventDetailDTO: + allOf: + - $ref: '#/components/schemas/EventDTO' + - type: object + additionalProperties: false + properties: + deviceState: + nullable: true + oneOf: + - $ref: '#/components/schemas/DeviceState' + automationTriggered: + nullable: true + oneOf: + - $ref: '#/components/schemas/AutomationTriggered' + alarmTriggered: + nullable: true + oneOf: + - $ref: '#/components/schemas/AlarmTriggered' + DeviceState: + type: object + additionalProperties: false + properties: + deviceId: + type: string + nullable: true + deviceName: + type: string + nullable: true + message: + type: string + nullable: true + deviceType: + $ref: '#/components/schemas/DeviceType' + AutomationTriggered: + type: object + additionalProperties: false + properties: + automationId: + type: string + nullable: true + automationName: + type: string + nullable: true + AlarmTriggered: + type: object + additionalProperties: false + properties: + alarmModeId: + type: string + nullable: true + alarmModeName: + type: string + nullable: true + type: + $ref: '#/components/schemas/AlarmType' + EventDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + homeId: + type: string + nullable: true + date: + type: string + format: date-time + type: + $ref: '#/components/schemas/EventType' + roomId: + type: string + nullable: true + EventType: + type: string + description: '' + x-enumNames: + - DeviceState + - AutomationTriggered + - AlarmTriggered + enum: + - DeviceState + - AutomationTriggered + - AlarmTriggered + EventHomeFilter: + allOf: + - $ref: '#/components/schemas/EventFilter' + - type: object + additionalProperties: false + properties: + deviceId: + type: string + nullable: true + roomId: + type: string + nullable: true + EventFilter: + type: object + additionalProperties: false + properties: + startIndex: + type: integer + format: int32 + count: + type: integer + format: int32 + dateStart: + type: string + format: date-time + nullable: true + dateEnd: + type: string + format: date-time + nullable: true + eventType: + nullable: true + oneOf: + - $ref: '#/components/schemas/EventType' + deviceType: + nullable: true + oneOf: + - $ref: '#/components/schemas/DeviceType' + GroupSummaryDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + homeId: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + isAlarm: + type: boolean + GroupDetailDTO: + allOf: + - $ref: '#/components/schemas/GroupSummaryDTO' + - type: object + additionalProperties: false + properties: + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + GroupCreateOrUpdateDetailDTO: + allOf: + - $ref: '#/components/schemas/GroupSummaryDTO' + - type: object + additionalProperties: false + properties: + deviceIds: + type: array + nullable: true + items: + type: string + HomeDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + isAlarm: + type: boolean + isDefault: + type: boolean + currentAlarmMode: + nullable: true + oneOf: + - $ref: '#/components/schemas/AlarmModeDTO' + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + usersIds: + type: array + nullable: true + items: + type: string + HomeDetailDTO: + allOf: + - $ref: '#/components/schemas/HomeDTO' + - type: object + additionalProperties: false + properties: + users: + type: array + nullable: true + items: + $ref: '#/components/schemas/UserInfoDetailDTO' + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceSummaryDTO' + automations: + type: array + nullable: true + items: + $ref: '#/components/schemas/AutomationDTO' + providers: + type: array + nullable: true + items: + $ref: '#/components/schemas/ProviderDTO' + groups: + type: array + nullable: true + items: + $ref: '#/components/schemas/GroupSummaryDTO' + CreateOrUpdateHomeDTO: + allOf: + - $ref: '#/components/schemas/HomeDTO' + - type: object + additionalProperties: false + properties: + usersIds: + type: array + nullable: true + items: + type: string + RoomSummaryDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + homeId: + type: string + nullable: true + name: + type: string + nullable: true + RoomMainDetailDTO: + allOf: + - $ref: '#/components/schemas/RoomSummaryDTO' + - type: object + additionalProperties: false + properties: + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + isTemperature: + type: boolean + temperature: + type: string + nullable: true + isHumidity: + type: boolean + humidity: + type: string + nullable: true + isMotion: + type: boolean + motion: + type: boolean + nullable: true + isDoor: + type: boolean + door: + type: boolean + nullable: true + environmentalDevices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + securityDevices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + RoomDetailDTO: + allOf: + - $ref: '#/components/schemas/RoomSummaryDTO' + - type: object + additionalProperties: false + properties: + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + RoomCreateOrUpdateDetailDTO: + allOf: + - $ref: '#/components/schemas/RoomSummaryDTO' + - type: object + additionalProperties: false + properties: + deviceIds: + type: array + nullable: true + items: + type: string + AzureADAuthModel: + type: object + additionalProperties: false + properties: + apiKey: + type: string + nullable: true + FacebookAuthModel: + type: object + additionalProperties: false + properties: + userAccessToken: + type: string + nullable: true + GoogleAuthModel: + type: object + additionalProperties: false + properties: + authorizationCode: + type: string + nullable: true + apiKey: + type: string + nullable: true + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + password: + type: string + nullable: true + TwitterAuthModel: + type: object + additionalProperties: false + properties: + apiKey: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: MyCore Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + MyCore-api: MyCore WebAPI +security: + - bearer: [] +tags: + - name: Authentication + description: Authentication management diff --git a/lib/app_context.dart b/lib/app_context.dart index 891396c..122af11 100644 --- a/lib/app_context.dart +++ b/lib/app_context.dart @@ -5,7 +5,7 @@ import 'Models/homieContext.dart'; class AppContext with ChangeNotifier { HomieAppContext _homieContext; - Client clientAPI; + Client clientAPI = Client("http://192.168.31.140"); List _lastMQTTMessages = []; AppContext(this._homieContext); diff --git a/lib/client.dart b/lib/client.dart index f00d779..4c02955 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -1,42 +1,41 @@ -import 'package:mycoreapi/api.dart'; -//import 'package:openapi_dart_common/openapi.dart'; +import 'package:mycore_api/api.dart'; class Client { - ApiClient _apiClient; - ApiClient get apiApi => _apiClient; + ApiClient? _apiClient; + ApiClient? get apiApi => _apiClient; - TokenApi _tokenApi; - TokenApi get tokenApi => _tokenApi; + TokenApi? _tokenApi; + TokenApi? get tokenApi => _tokenApi; - AuthenticationApi _authenticationApi; - AuthenticationApi get authenticationApi => _authenticationApi; + AuthenticationApi? _authenticationApi; + AuthenticationApi? get authenticationApi => _authenticationApi; - UserApi _userApi; - UserApi get userApi => _userApi; + UserApi? _userApi; + UserApi? get userApi => _userApi; - HomeApi _homeApi; - HomeApi get homeApi => _homeApi; + HomeApi? _homeApi; + HomeApi? get homeApi => _homeApi; - AlarmApi _alarmApi; - AlarmApi get alarmApi => _alarmApi; + AlarmApi? _alarmApi; + AlarmApi? get alarmApi => _alarmApi; - EventApi _eventApi; - EventApi get eventApi => _eventApi; + EventApi? _eventApi; + EventApi? get eventApi => _eventApi; - GroupApi _groupApi; - GroupApi get groupApi => _groupApi; + GroupApi? _groupApi; + GroupApi? get groupApi => _groupApi; - DeviceApi _deviceApi; - DeviceApi get deviceApi => _deviceApi; + DeviceApi? _deviceApi; + DeviceApi? get deviceApi => _deviceApi; - AutomationApi _automationApi; - AutomationApi get automationApi => _automationApi; + AutomationApi? _automationApi; + AutomationApi? get automationApi => _automationApi; - ProviderApi _providerApi; - ProviderApi get providerApi => _providerApi; + ProviderApi? _providerApi; + ProviderApi? get providerApi => _providerApi; - RoomApi _roomApi; - RoomApi get roomApi => _roomApi; + RoomApi? _roomApi; + RoomApi? get roomApi => _roomApi; Client(String path) { _apiClient = ApiClient( diff --git a/lib/main.dart b/lib/main.dart index 83b8041..bc5b177 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,14 +12,14 @@ import 'constants.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); String initialRoute; - HomieAppContext localContext = new HomieAppContext(); + HomieAppContext? localContext = new HomieAppContext(); bool isLogged = false; localContext = await DatabaseHelper.instance.getData(); if(localContext != null) { print("we've got an local db !"); - localContext.clientAPI = new Client(localContext.host); // TODO "http://192.168.31.140" + localContext.clientAPI = new Client(localContext.host!); // TODO "http://192.168.31.140" //isLogged = localContext.token != null; // TODO refresh token.. isLogged = false; print(localContext); @@ -31,16 +31,16 @@ void main() async { final MyApp myApp = MyApp( initialRoute: initialRoute, - homieAppContext: localContext, + homieAppContext: localContext!, ); runApp(myApp); } class MyApp extends StatefulWidget { - final String initialRoute; - final HomieAppContext homieAppContext; - MyApp({this.initialRoute, this.homieAppContext}); + String initialRoute = ""; + HomieAppContext homieAppContext; + MyApp({Key? key, required this.initialRoute, required this.homieAppContext}) : super(key: key); @override _MyAppState createState() => _MyAppState(); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 51436ae..2e1de87 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/mycore_api/.gitignore b/mycore_api/.gitignore index 7c28044..1be28ce 100644 --- a/mycore_api/.gitignore +++ b/mycore_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/mycore_api/.openapi-generator/FILES b/mycore_api/.openapi-generator/FILES index c409ccc..45fadff 100644 --- a/mycore_api/.openapi-generator/FILES +++ b/mycore_api/.openapi-generator/FILES @@ -1,6 +1,8 @@ .gitignore +.openapi-generator-ignore .travis.yml README.md +analysis_options.yaml doc/Action.md doc/ActionType.md doc/AlarmApi.md @@ -10,6 +12,8 @@ doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md doc/AlarmModeDTO.md doc/AlarmModeDetailDTO.md doc/AlarmModeDetailDTOAllOf.md +doc/AlarmModeGeolocalizedMode.md +doc/AlarmModeProgrammedMode.md doc/AlarmTriggered.md doc/AlarmType.md doc/AuthenticationApi.md @@ -24,6 +28,7 @@ doc/AzureApi.md doc/Book.md doc/BooksApi.md doc/Condition.md +doc/ConditionState.md doc/ConditionType.md doc/ConditionValue.md doc/ConnectionStatus.md @@ -42,6 +47,8 @@ doc/EventDTO.md doc/EventDetailDTO.md doc/EventDetailDTOAllOf.md doc/EventFilter.md +doc/EventGetDeviceTypeParameter.md +doc/EventGetEventTypeParameter.md doc/EventHomeFilter.md doc/EventHomeFilterAllOf.md doc/EventType.md @@ -58,17 +65,20 @@ doc/GroupDetailDTOAllOf.md doc/GroupSummaryDTO.md doc/HomeApi.md doc/HomeDTO.md +doc/HomeDTOCurrentAlarmMode.md doc/HomeDetailDTO.md doc/HomeDetailDTOAllOf.md doc/IOTApi.md doc/LayoutApi.md doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md +doc/ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md doc/LoginDTO.md doc/MQTTApi.md doc/MeansOfCommunication.md doc/MqttMessageDTO.md doc/OddApi.md doc/OddNice.md +doc/OddNiceOdds.md doc/OddObject.md doc/PanelMenuItem.md doc/PanelSection.md @@ -87,6 +97,7 @@ doc/ScreenDeviceApi.md doc/SmartGardenMessage.md doc/SmartPrinterMessage.md doc/TimePeriodAlarm.md +doc/TimePeriodAlarmAlarmMode.md doc/TokenApi.md doc/TokenDTO.md doc/Trigger.md @@ -140,6 +151,8 @@ lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart lib/model/alarm_mode_detail_dto.dart lib/model/alarm_mode_detail_dto_all_of.dart lib/model/alarm_mode_dto.dart +lib/model/alarm_mode_geolocalized_mode.dart +lib/model/alarm_mode_programmed_mode.dart lib/model/alarm_triggered.dart lib/model/alarm_type.dart lib/model/automation_detail_dto.dart @@ -150,6 +163,7 @@ lib/model/automation_triggered.dart lib/model/azure_ad_auth_model.dart lib/model/book.dart lib/model/condition.dart +lib/model/condition_state.dart lib/model/condition_type.dart lib/model/condition_value.dart lib/model/connection_status.dart @@ -165,6 +179,8 @@ lib/model/event_detail_dto.dart lib/model/event_detail_dto_all_of.dart lib/model/event_dto.dart lib/model/event_filter.dart +lib/model/event_get_device_type_parameter.dart +lib/model/event_get_event_type_parameter.dart lib/model/event_home_filter.dart lib/model/event_home_filter_all_of.dart lib/model/event_type.dart @@ -179,11 +195,14 @@ lib/model/group_summary_dto.dart lib/model/home_detail_dto.dart lib/model/home_detail_dto_all_of.dart lib/model/home_dto.dart +lib/model/home_dto_current_alarm_mode.dart lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart +lib/model/list_response_of_event_detail_dto_and_event_home_filter_request_parameters.dart lib/model/login_dto.dart lib/model/means_of_communication.dart lib/model/mqtt_message_dto.dart lib/model/odd_nice.dart +lib/model/odd_nice_odds.dart lib/model/odd_object.dart lib/model/panel_menu_item.dart lib/model/panel_section.dart @@ -199,6 +218,7 @@ lib/model/screen_device.dart lib/model/smart_garden_message.dart lib/model/smart_printer_message.dart lib/model/time_period_alarm.dart +lib/model/time_period_alarm_alarm_mode.dart lib/model/token_dto.dart lib/model/trigger.dart lib/model/trigger_type.dart @@ -208,3 +228,110 @@ lib/model/user_info.dart lib/model/user_info_detail_dto.dart lib/model/view_by.dart pubspec.yaml +test/action_test.dart +test/action_type_test.dart +test/alarm_api_test.dart +test/alarm_mode_create_or_update_detail_dto_all_of_test.dart +test/alarm_mode_create_or_update_detail_dto_test.dart +test/alarm_mode_detail_dto_all_of_test.dart +test/alarm_mode_detail_dto_test.dart +test/alarm_mode_dto_test.dart +test/alarm_mode_geolocalized_mode_test.dart +test/alarm_mode_programmed_mode_test.dart +test/alarm_mode_test.dart +test/alarm_triggered_test.dart +test/alarm_type_test.dart +test/authentication_api_test.dart +test/automation_api_test.dart +test/automation_detail_dto_all_of_test.dart +test/automation_detail_dto_test.dart +test/automation_dto_test.dart +test/automation_state_test.dart +test/automation_triggered_test.dart +test/azure_ad_auth_model_test.dart +test/azure_api_test.dart +test/book_test.dart +test/books_api_test.dart +test/condition_state_test.dart +test/condition_test.dart +test/condition_type_test.dart +test/condition_value_test.dart +test/connection_status_test.dart +test/create_or_update_home_dto_all_of_test.dart +test/create_or_update_home_dto_test.dart +test/device_api_test.dart +test/device_detail_dto_all_of_test.dart +test/device_detail_dto_test.dart +test/device_state_test.dart +test/device_summary_dto_test.dart +test/device_type_test.dart +test/electricity_production_test.dart +test/energy_api_test.dart +test/event_api_test.dart +test/event_detail_dto_all_of_test.dart +test/event_detail_dto_test.dart +test/event_dto_test.dart +test/event_filter_test.dart +test/event_get_device_type_parameter_test.dart +test/event_get_event_type_parameter_test.dart +test/event_home_filter_all_of_test.dart +test/event_home_filter_test.dart +test/event_type_test.dart +test/facebook_api_test.dart +test/facebook_auth_model_test.dart +test/geolocalized_mode_test.dart +test/google_api_test.dart +test/google_auth_model_test.dart +test/group_api_test.dart +test/group_create_or_update_detail_dto_all_of_test.dart +test/group_create_or_update_detail_dto_test.dart +test/group_detail_dto_all_of_test.dart +test/group_detail_dto_test.dart +test/group_summary_dto_test.dart +test/home_api_test.dart +test/home_detail_dto_all_of_test.dart +test/home_detail_dto_test.dart +test/home_dto_current_alarm_mode_test.dart +test/home_dto_test.dart +test/iot_api_test.dart +test/layout_api_test.dart +test/list_response_of_event_detail_dto_and_event_home_filter_request_parameters_test.dart +test/list_response_of_event_detail_dto_and_event_home_filter_test.dart +test/login_dto_test.dart +test/means_of_communication_test.dart +test/mqtt_api_test.dart +test/mqtt_message_dto_test.dart +test/odd_api_test.dart +test/odd_nice_odds_test.dart +test/odd_nice_test.dart +test/odd_object_test.dart +test/panel_menu_item_test.dart +test/panel_section_test.dart +test/programmed_mode_test.dart +test/provider_api_test.dart +test/provider_dto_test.dart +test/provider_type_test.dart +test/room_api_test.dart +test/room_create_or_update_detail_dto_test.dart +test/room_detail_dto_test.dart +test/room_main_detail_dto_all_of_test.dart +test/room_main_detail_dto_test.dart +test/room_summary_dto_test.dart +test/screen_device_api_test.dart +test/screen_device_test.dart +test/smart_garden_message_test.dart +test/smart_printer_message_test.dart +test/time_period_alarm_alarm_mode_test.dart +test/time_period_alarm_test.dart +test/token_api_test.dart +test/token_dto_test.dart +test/trigger_test.dart +test/trigger_type_test.dart +test/twitter_api_test.dart +test/twitter_auth_model_test.dart +test/user_api_test.dart +test/user_info_detail_dto_test.dart +test/user_info_test.dart +test/user_test.dart +test/values_api_test.dart +test/view_by_test.dart diff --git a/mycore_api/.openapi-generator/VERSION b/mycore_api/.openapi-generator/VERSION index acf69b4..717311e 100644 --- a/mycore_api/.openapi-generator/VERSION +++ b/mycore_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/mycore_api/.travis.yml b/mycore_api/.travis.yml index 1a3af66..2774ccb 100644 --- a/mycore_api/.travis.yml +++ b/mycore_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/mycore_api/README.md b/mycore_api/README.md index 6aff251..8755b36 100644 --- a/mycore_api/README.md +++ b/mycore_api/README.md @@ -1,4 +1,4 @@ -# mycoreapi +# mycore_api API description 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: - mycoreapi: + mycore_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: - mycoreapi: - path: /path/to/mycoreapi + mycore_api: + path: /path/to/mycore_api ``` ## Tests @@ -37,7 +37,7 @@ TODO Please follow the [installation procedure](#installation--usage) and then run the following: ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -56,7 +56,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -167,6 +167,8 @@ Class | Method | HTTP request | Description - [AlarmModeDTO](doc\/AlarmModeDTO.md) - [AlarmModeDetailDTO](doc\/AlarmModeDetailDTO.md) - [AlarmModeDetailDTOAllOf](doc\/AlarmModeDetailDTOAllOf.md) + - [AlarmModeGeolocalizedMode](doc\/AlarmModeGeolocalizedMode.md) + - [AlarmModeProgrammedMode](doc\/AlarmModeProgrammedMode.md) - [AlarmTriggered](doc\/AlarmTriggered.md) - [AlarmType](doc\/AlarmType.md) - [AutomationDTO](doc\/AutomationDTO.md) @@ -177,6 +179,7 @@ Class | Method | HTTP request | Description - [AzureADAuthModel](doc\/AzureADAuthModel.md) - [Book](doc\/Book.md) - [Condition](doc\/Condition.md) + - [ConditionState](doc\/ConditionState.md) - [ConditionType](doc\/ConditionType.md) - [ConditionValue](doc\/ConditionValue.md) - [ConnectionStatus](doc\/ConnectionStatus.md) @@ -192,6 +195,8 @@ Class | Method | HTTP request | Description - [EventDetailDTO](doc\/EventDetailDTO.md) - [EventDetailDTOAllOf](doc\/EventDetailDTOAllOf.md) - [EventFilter](doc\/EventFilter.md) + - [EventGetDeviceTypeParameter](doc\/EventGetDeviceTypeParameter.md) + - [EventGetEventTypeParameter](doc\/EventGetEventTypeParameter.md) - [EventHomeFilter](doc\/EventHomeFilter.md) - [EventHomeFilterAllOf](doc\/EventHomeFilterAllOf.md) - [EventType](doc\/EventType.md) @@ -204,13 +209,16 @@ Class | Method | HTTP request | Description - [GroupDetailDTOAllOf](doc\/GroupDetailDTOAllOf.md) - [GroupSummaryDTO](doc\/GroupSummaryDTO.md) - [HomeDTO](doc\/HomeDTO.md) + - [HomeDTOCurrentAlarmMode](doc\/HomeDTOCurrentAlarmMode.md) - [HomeDetailDTO](doc\/HomeDetailDTO.md) - [HomeDetailDTOAllOf](doc\/HomeDetailDTOAllOf.md) - [ListResponseOfEventDetailDTOAndEventHomeFilter](doc\/ListResponseOfEventDetailDTOAndEventHomeFilter.md) + - [ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters](doc\/ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md) - [LoginDTO](doc\/LoginDTO.md) - [MeansOfCommunication](doc\/MeansOfCommunication.md) - [MqttMessageDTO](doc\/MqttMessageDTO.md) - [OddNice](doc\/OddNice.md) + - [OddNiceOdds](doc\/OddNiceOdds.md) - [OddObject](doc\/OddObject.md) - [PanelMenuItem](doc\/PanelMenuItem.md) - [PanelSection](doc\/PanelSection.md) @@ -226,6 +234,7 @@ Class | Method | HTTP request | Description - [SmartGardenMessage](doc\/SmartGardenMessage.md) - [SmartPrinterMessage](doc\/SmartPrinterMessage.md) - [TimePeriodAlarm](doc\/TimePeriodAlarm.md) + - [TimePeriodAlarmAlarmMode](doc\/TimePeriodAlarmAlarmMode.md) - [TokenDTO](doc\/TokenDTO.md) - [Trigger](doc\/Trigger.md) - [TriggerType](doc\/TriggerType.md) @@ -252,4 +261,3 @@ Class | Method | HTTP request | Description - diff --git a/mycore_api/analysis_options.yaml b/mycore_api/analysis_options.yaml new file mode 100644 index 0000000..e69de29 diff --git a/mycore_api/doc/Action.md b/mycore_api/doc/Action.md index 82d2f28..0194ba0 100644 --- a/mycore_api/doc/Action.md +++ b/mycore_api/doc/Action.md @@ -1,8 +1,8 @@ -# mycoreapi.model.Action +# mycore_api.model.Action ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ActionType.md b/mycore_api/doc/ActionType.md index 0529e1a..05a5b0a 100644 --- a/mycore_api/doc/ActionType.md +++ b/mycore_api/doc/ActionType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ActionType +# mycore_api.model.ActionType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmApi.md b/mycore_api/doc/AlarmApi.md index ee0b71f..7c3b5f0 100644 --- a/mycore_api/doc/AlarmApi.md +++ b/mycore_api/doc/AlarmApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.AlarmApi +# mycore_api.api.AlarmApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -24,16 +24,16 @@ Method | HTTP request | Description Activate specified alarm mode -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final alarmModeId = alarmModeId_example; // String | Alarm mode to activate -try { +try { final result = api_instance.alarmActivate(alarmModeId); print(result); } catch (e) { @@ -67,16 +67,16 @@ Name | Type | Description | Notes Create an alarm mode -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final alarmModeCreateOrUpdateDetailDTO = AlarmModeCreateOrUpdateDetailDTO(); // AlarmModeCreateOrUpdateDetailDTO | Alarm mode to create -try { +try { final result = api_instance.alarmCreate(alarmModeCreateOrUpdateDetailDTO); print(result); } catch (e) { @@ -110,16 +110,16 @@ Name | Type | Description | Notes Create default alarm modes -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.alarmCreateDefaultAlarms(homeId); print(result); } catch (e) { @@ -153,16 +153,16 @@ Name | Type | Description | Notes Delete an alarm mode -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final alarmModeId = alarmModeId_example; // String | Id of alarm mode to delete -try { +try { final result = api_instance.alarmDelete(alarmModeId); print(result); } catch (e) { @@ -196,16 +196,16 @@ Name | Type | Description | Notes Delete all alarm mode for a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.alarmDeleteAllForHome(homeId); print(result); } catch (e) { @@ -239,16 +239,16 @@ Name | Type | Description | Notes Get all alarm modes for the specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.alarmGetAll(homeId); print(result); } catch (e) { @@ -282,16 +282,16 @@ Name | Type | Description | Notes Get detail info of a specified alarm mode -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final alarmModeId = alarmModeId_example; // String | alarm id -try { +try { final result = api_instance.alarmGetDetail(alarmModeId); print(result); } catch (e) { @@ -325,16 +325,16 @@ Name | Type | Description | Notes Update an alarm mode -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AlarmApi(); final alarmModeCreateOrUpdateDetailDTO = AlarmModeCreateOrUpdateDetailDTO(); // AlarmModeCreateOrUpdateDetailDTO | alarm mode to update -try { +try { final result = api_instance.alarmUpdate(alarmModeCreateOrUpdateDetailDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/AlarmMode.md b/mycore_api/doc/AlarmMode.md index 983297e..b2d600f 100644 --- a/mycore_api/doc/AlarmMode.md +++ b/mycore_api/doc/AlarmMode.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmMode +# mycore_api.model.AlarmMode ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -17,8 +17,8 @@ Name | Type | Description | Notes **createdDate** | [**DateTime**](DateTime.md) | | [optional] **updatedDate** | [**DateTime**](DateTime.md) | | [optional] **type** | [**AlarmType**](AlarmType.md) | | [optional] -**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional] -**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional] +**programmedMode** | [**AlarmModeProgrammedMode**](AlarmModeProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**AlarmModeGeolocalizedMode**](AlarmModeGeolocalizedMode.md) | | [optional] **triggers** | [**List**](Trigger.md) | | [optional] [default to const []] **actions** | [**List**](Action.md) | | [optional] [default to const []] **devicesIds** | **List** | | [optional] [default to const []] diff --git a/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTO.md b/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTO.md index e0608f3..2ec5e09 100644 --- a/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTO.md +++ b/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmModeCreateOrUpdateDetailDTO +# mycore_api.model.AlarmModeCreateOrUpdateDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md b/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md index d8dbab5..c836cb1 100644 --- a/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md +++ b/mycore_api/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmModeCreateOrUpdateDetailDTOAllOf +# mycore_api.model.AlarmModeCreateOrUpdateDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmModeDTO.md b/mycore_api/doc/AlarmModeDTO.md index 5a2da17..cd451a2 100644 --- a/mycore_api/doc/AlarmModeDTO.md +++ b/mycore_api/doc/AlarmModeDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmModeDTO +# mycore_api.model.AlarmModeDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmModeDetailDTO.md b/mycore_api/doc/AlarmModeDetailDTO.md index 7079e79..24c9c83 100644 --- a/mycore_api/doc/AlarmModeDetailDTO.md +++ b/mycore_api/doc/AlarmModeDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmModeDetailDTO +# mycore_api.model.AlarmModeDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmModeDetailDTOAllOf.md b/mycore_api/doc/AlarmModeDetailDTOAllOf.md index 9b4ab2b..968ce3d 100644 --- a/mycore_api/doc/AlarmModeDetailDTOAllOf.md +++ b/mycore_api/doc/AlarmModeDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmModeDetailDTOAllOf +# mycore_api.model.AlarmModeDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmModeGeolocalizedMode.md b/mycore_api/doc/AlarmModeGeolocalizedMode.md new file mode 100644 index 0000000..86776e0 --- /dev/null +++ b/mycore_api/doc/AlarmModeGeolocalizedMode.md @@ -0,0 +1,18 @@ +# mycore_api.model.AlarmModeGeolocalizedMode + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**homeMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.md) | | [optional] +**absentMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.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/mycore_api/doc/AlarmModeProgrammedMode.md b/mycore_api/doc/AlarmModeProgrammedMode.md new file mode 100644 index 0000000..a2e17d0 --- /dev/null +++ b/mycore_api/doc/AlarmModeProgrammedMode.md @@ -0,0 +1,21 @@ +# mycore_api.model.AlarmModeProgrammedMode + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**tuesday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**wednesday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**thursday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**friday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**saturday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**sunday** | [**List**](TimePeriodAlarm.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/mycore_api/doc/AlarmTriggered.md b/mycore_api/doc/AlarmTriggered.md index ce21e22..528321b 100644 --- a/mycore_api/doc/AlarmTriggered.md +++ b/mycore_api/doc/AlarmTriggered.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmTriggered +# mycore_api.model.AlarmTriggered ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AlarmType.md b/mycore_api/doc/AlarmType.md index 1f4bf4f..e95505b 100644 --- a/mycore_api/doc/AlarmType.md +++ b/mycore_api/doc/AlarmType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AlarmType +# mycore_api.model.AlarmType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AuthenticationApi.md b/mycore_api/doc/AuthenticationApi.md index b996c89..27589a5 100644 --- a/mycore_api/doc/AuthenticationApi.md +++ b/mycore_api/doc/AuthenticationApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.AuthenticationApi +# mycore_api.api.AuthenticationApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -18,9 +18,9 @@ Method | HTTP request | Description Authenticate with form parameters (used by Swagger test client) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_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 Authenticate with Json parameters (used by most clients) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_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 | Login DTO -try { +try { final result = api_instance.authenticationAuthenticateWithJson(loginDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/AutomationApi.md b/mycore_api/doc/AutomationApi.md index 7912e8a..034e2b6 100644 --- a/mycore_api/doc/AutomationApi.md +++ b/mycore_api/doc/AutomationApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.AutomationApi +# mycore_api.api.AutomationApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,16 +22,16 @@ Method | HTTP request | Description Create an automation -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AutomationApi(); final automationDetailDTO = AutomationDetailDTO(); // AutomationDetailDTO | Automation to create -try { +try { final result = api_instance.automationCreate(automationDetailDTO); print(result); } catch (e) { @@ -65,16 +65,16 @@ Name | Type | Description | Notes Delete an automation -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AutomationApi(); final automationId = automationId_example; // String | Id of automation to delete -try { +try { final result = api_instance.automationDelete(automationId); print(result); } catch (e) { @@ -108,16 +108,16 @@ Name | Type | Description | Notes Delete all automation for a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AutomationApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.automationDeleteAllForHome(homeId); print(result); } catch (e) { @@ -151,16 +151,16 @@ Name | Type | Description | Notes Get all automations for the specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AutomationApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.automationGetAll(homeId); print(result); } catch (e) { @@ -194,16 +194,16 @@ Name | Type | Description | Notes Get detail info of a specified automation -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AutomationApi(); final automationId = automationId_example; // String | automation id -try { +try { final result = api_instance.automationGetDetail(automationId); print(result); } catch (e) { @@ -237,16 +237,16 @@ Name | Type | Description | Notes Update an automation -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AutomationApi(); final automationDetailDTO = AutomationDetailDTO(); // AutomationDetailDTO | automation to update -try { +try { final result = api_instance.automationUpdate(automationDetailDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/AutomationDTO.md b/mycore_api/doc/AutomationDTO.md index 4d167e4..10f5fc5 100644 --- a/mycore_api/doc/AutomationDTO.md +++ b/mycore_api/doc/AutomationDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AutomationDTO +# mycore_api.model.AutomationDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AutomationDetailDTO.md b/mycore_api/doc/AutomationDetailDTO.md index 5c95094..1622177 100644 --- a/mycore_api/doc/AutomationDetailDTO.md +++ b/mycore_api/doc/AutomationDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AutomationDetailDTO +# mycore_api.model.AutomationDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AutomationDetailDTOAllOf.md b/mycore_api/doc/AutomationDetailDTOAllOf.md index 1a10d67..142695a 100644 --- a/mycore_api/doc/AutomationDetailDTOAllOf.md +++ b/mycore_api/doc/AutomationDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AutomationDetailDTOAllOf +# mycore_api.model.AutomationDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AutomationState.md b/mycore_api/doc/AutomationState.md index dcd8a45..f0e95e3 100644 --- a/mycore_api/doc/AutomationState.md +++ b/mycore_api/doc/AutomationState.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AutomationState +# mycore_api.model.AutomationState ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AutomationTriggered.md b/mycore_api/doc/AutomationTriggered.md index 12a5484..d7c832a 100644 --- a/mycore_api/doc/AutomationTriggered.md +++ b/mycore_api/doc/AutomationTriggered.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AutomationTriggered +# mycore_api.model.AutomationTriggered ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AzureADAuthModel.md b/mycore_api/doc/AzureADAuthModel.md index 76da060..1db294d 100644 --- a/mycore_api/doc/AzureADAuthModel.md +++ b/mycore_api/doc/AzureADAuthModel.md @@ -1,8 +1,8 @@ -# mycoreapi.model.AzureADAuthModel +# mycore_api.model.AzureADAuthModel ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/AzureApi.md b/mycore_api/doc/AzureApi.md index 77b096d..70bf32a 100644 --- a/mycore_api/doc/AzureApi.md +++ b/mycore_api/doc/AzureApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.AzureApi +# mycore_api.api.AzureApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,16 +17,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = AzureApi(); final azureADAuthModel = AzureADAuthModel(); // AzureADAuthModel | -try { +try { final result = api_instance.azureCreate(azureADAuthModel); print(result); } catch (e) { diff --git a/mycore_api/doc/Book.md b/mycore_api/doc/Book.md index 4e3d95f..6791f96 100644 --- a/mycore_api/doc/Book.md +++ b/mycore_api/doc/Book.md @@ -1,8 +1,8 @@ -# mycoreapi.model.Book +# mycore_api.model.Book ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/BooksApi.md b/mycore_api/doc/BooksApi.md index 6bdff46..00d2d06 100644 --- a/mycore_api/doc/BooksApi.md +++ b/mycore_api/doc/BooksApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.BooksApi +# mycore_api.api.BooksApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -21,16 +21,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = BooksApi(); final book = Book(); // Book | -try { +try { final result = api_instance.booksCreate(book); print(result); } catch (e) { @@ -64,16 +64,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = BooksApi(); final id = id_example; // String | -try { +try { final result = api_instance.booksDelete(id); print(result); } catch (e) { @@ -107,16 +107,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = BooksApi(); final id = id_example; // String | -try { +try { final result = api_instance.booksGet(id); print(result); } catch (e) { @@ -150,15 +150,15 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = BooksApi(); -try { +try { final result = api_instance.booksGetAll(); print(result); } catch (e) { @@ -189,9 +189,9 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -199,7 +199,7 @@ final api_instance = BooksApi(); final id = id_example; // String | final book = Book(); // Book | -try { +try { final result = api_instance.booksUpdate(id, book); print(result); } catch (e) { diff --git a/mycore_api/doc/Condition.md b/mycore_api/doc/Condition.md index 3268817..86e4a3f 100644 --- a/mycore_api/doc/Condition.md +++ b/mycore_api/doc/Condition.md @@ -1,15 +1,15 @@ -# mycoreapi.model.Condition +# mycore_api.model.Condition ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deviceId** | **String** | | [optional] -**state** | [**OneOfAutomationState**](OneOfAutomationState.md) | | [optional] +**state** | [**ConditionState**](ConditionState.md) | | [optional] **startTime** | **String** | | [optional] **endTime** | **String** | | [optional] **type** | [**ConditionType**](ConditionType.md) | | [optional] diff --git a/mycore_api/doc/ConditionState.md b/mycore_api/doc/ConditionState.md new file mode 100644 index 0000000..7f2e571 --- /dev/null +++ b/mycore_api/doc/ConditionState.md @@ -0,0 +1,16 @@ +# mycore_api.model.ConditionState + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **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/mycore_api/doc/ConditionType.md b/mycore_api/doc/ConditionType.md index 0ab4c5f..c24dab1 100644 --- a/mycore_api/doc/ConditionType.md +++ b/mycore_api/doc/ConditionType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ConditionType +# mycore_api.model.ConditionType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ConditionValue.md b/mycore_api/doc/ConditionValue.md index a557e0c..643572f 100644 --- a/mycore_api/doc/ConditionValue.md +++ b/mycore_api/doc/ConditionValue.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ConditionValue +# mycore_api.model.ConditionValue ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ConnectionStatus.md b/mycore_api/doc/ConnectionStatus.md index 7c1e861..5f7fe05 100644 --- a/mycore_api/doc/ConnectionStatus.md +++ b/mycore_api/doc/ConnectionStatus.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ConnectionStatus +# mycore_api.model.ConnectionStatus ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/CreateOrUpdateHomeDTO.md b/mycore_api/doc/CreateOrUpdateHomeDTO.md index 537a60d..b5a884d 100644 --- a/mycore_api/doc/CreateOrUpdateHomeDTO.md +++ b/mycore_api/doc/CreateOrUpdateHomeDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.CreateOrUpdateHomeDTO +# mycore_api.model.CreateOrUpdateHomeDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -12,7 +12,7 @@ Name | Type | Description | Notes **name** | **String** | | [optional] **isAlarm** | **bool** | | [optional] **isDefault** | **bool** | | [optional] -**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional] +**currentAlarmMode** | [**HomeDTOCurrentAlarmMode**](HomeDTOCurrentAlarmMode.md) | | [optional] **createdDate** | [**DateTime**](DateTime.md) | | [optional] **updatedDate** | [**DateTime**](DateTime.md) | | [optional] **usersIds** | **List** | | [optional] [default to const []] diff --git a/mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md b/mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md index b34361e..1d19e87 100644 --- a/mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md +++ b/mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.CreateOrUpdateHomeDTOAllOf +# mycore_api.model.CreateOrUpdateHomeDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/DeviceApi.md b/mycore_api/doc/DeviceApi.md index b9dae3e..b6e383c 100644 --- a/mycore_api/doc/DeviceApi.md +++ b/mycore_api/doc/DeviceApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.DeviceApi +# mycore_api.api.DeviceApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -28,16 +28,16 @@ Method | HTTP request | Description Create a device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_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 | Device to create -try { +try { final result = api_instance.deviceCreate(deviceDetailDTO); print(result); } catch (e) { @@ -71,9 +71,9 @@ Name | Type | Description | Notes Create devices from provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -81,7 +81,7 @@ final api_instance = DeviceApi(); final homeId = homeId_example; // String | Home Id final providerId = providerId_example; // String | Id of Provider -try { +try { final result = api_instance.deviceCreateDevicesFromProvider(homeId, providerId); print(result); } catch (e) { @@ -116,16 +116,16 @@ Name | Type | Description | Notes Delete a device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceId = deviceId_example; // String | Id of device to delete -try { +try { final result = api_instance.deviceDelete(deviceId); print(result); } catch (e) { @@ -159,16 +159,16 @@ Name | Type | Description | Notes Delete all device for a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final homeId = homeId_example; // String | Id of home -try { +try { final result = api_instance.deviceDeleteAllForHome(homeId); print(result); } catch (e) { @@ -202,9 +202,9 @@ Name | Type | Description | Notes Delete devices from provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -212,7 +212,7 @@ final api_instance = DeviceApi(); final homeId = homeId_example; // String | Home Id final providerId = providerId_example; // String | Id of Provider -try { +try { final result = api_instance.deviceDeleteDevicesFromProvider(homeId, providerId); print(result); } catch (e) { @@ -247,16 +247,16 @@ Name | Type | Description | Notes Get all devices summary -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.deviceGetAll(homeId); print(result); } catch (e) { @@ -290,16 +290,16 @@ Name | Type | Description | Notes Get a specific device info -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceId = deviceId_example; // String | id of device -try { +try { final result = api_instance.deviceGetDetail(deviceId); print(result); } catch (e) { @@ -333,9 +333,9 @@ Name | Type | Description | Notes Get list of devices from a type -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -343,7 +343,7 @@ final api_instance = DeviceApi(); final homeId = homeId_example; // String | Home Id final type = ; // DeviceType | device type -try { +try { final result = api_instance.deviceGetDevicesByType(homeId, type); print(result); } catch (e) { @@ -378,9 +378,9 @@ Name | Type | Description | Notes Get devices from provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -388,7 +388,7 @@ final api_instance = DeviceApi(); final homeId = homeId_example; // String | Home Id final providerId = providerId_example; // String | Id of Provider -try { +try { final result = api_instance.deviceGetDevicesFromProvider(homeId, providerId); print(result); } catch (e) { @@ -423,16 +423,16 @@ Name | Type | Description | Notes Get all zigbee2Mqtt devices -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(homeId); print(result); } catch (e) { @@ -466,16 +466,16 @@ Name | Type | Description | Notes Send action to device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final action = Action(); // Action | Action to sent -try { +try { final result = api_instance.deviceSendAction(action); print(result); } catch (e) { @@ -509,9 +509,9 @@ Name | Type | Description | Notes Update a device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -519,7 +519,7 @@ final api_instance = DeviceApi(); final deviceId = deviceId_example; // String | final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to update -try { +try { final result = api_instance.deviceUpdate(deviceId, deviceDetailDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/DeviceDetailDTO.md b/mycore_api/doc/DeviceDetailDTO.md index ea98169..e8c4faa 100644 --- a/mycore_api/doc/DeviceDetailDTO.md +++ b/mycore_api/doc/DeviceDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.DeviceDetailDTO +# mycore_api.model.DeviceDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/DeviceDetailDTOAllOf.md b/mycore_api/doc/DeviceDetailDTOAllOf.md index e6fb511..2238d67 100644 --- a/mycore_api/doc/DeviceDetailDTOAllOf.md +++ b/mycore_api/doc/DeviceDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.DeviceDetailDTOAllOf +# mycore_api.model.DeviceDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/DeviceState.md b/mycore_api/doc/DeviceState.md index 930d187..1031a19 100644 --- a/mycore_api/doc/DeviceState.md +++ b/mycore_api/doc/DeviceState.md @@ -1,8 +1,8 @@ -# mycoreapi.model.DeviceState +# mycore_api.model.DeviceState ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/DeviceSummaryDTO.md b/mycore_api/doc/DeviceSummaryDTO.md index 34560ab..9b97603 100644 --- a/mycore_api/doc/DeviceSummaryDTO.md +++ b/mycore_api/doc/DeviceSummaryDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.DeviceSummaryDTO +# mycore_api.model.DeviceSummaryDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/DeviceType.md b/mycore_api/doc/DeviceType.md index a35a53e..eb781c1 100644 --- a/mycore_api/doc/DeviceType.md +++ b/mycore_api/doc/DeviceType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.DeviceType +# mycore_api.model.DeviceType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ElectricityProduction.md b/mycore_api/doc/ElectricityProduction.md index 208fd2e..c11cc85 100644 --- a/mycore_api/doc/ElectricityProduction.md +++ b/mycore_api/doc/ElectricityProduction.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ElectricityProduction +# mycore_api.model.ElectricityProduction ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/EnergyApi.md b/mycore_api/doc/EnergyApi.md index add8f51..2693d4b 100644 --- a/mycore_api/doc/EnergyApi.md +++ b/mycore_api/doc/EnergyApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.EnergyApi +# mycore_api.api.EnergyApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,9 +17,9 @@ Method | HTTP request | Description Get summary production of Kwh/Year -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -27,7 +27,7 @@ final api_instance = EnergyApi(); final homeId = homeId_example; // String | final viewBy = ; // ViewBy | -try { +try { final result = api_instance.energyGetElectricityProduction(homeId, viewBy); print(result); } catch (e) { diff --git a/mycore_api/doc/EventApi.md b/mycore_api/doc/EventApi.md index c386fb6..5c945eb 100644 --- a/mycore_api/doc/EventApi.md +++ b/mycore_api/doc/EventApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.EventApi +# mycore_api.api.EventApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,16 +20,16 @@ Method | HTTP request | Description Delete an event -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = EventApi(); final eventId = eventId_example; // String | Id of event to delete -try { +try { final result = api_instance.eventDelete(eventId); print(result); } catch (e) { @@ -63,16 +63,16 @@ Name | Type | Description | Notes Delete all events for a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = EventApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.eventDeleteAllForHome(homeId); print(result); } catch (e) { @@ -106,9 +106,9 @@ Name | Type | Description | Notes Get events for the specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -120,10 +120,10 @@ final startIndex = 56; // int | final count = 56; // int | final dateStart = 2013-10-20T19:20:30+01:00; // DateTime | final dateEnd = 2013-10-20T19:20:30+01:00; // DateTime | -final eventType = ; // OneOfEventType | -final deviceType = ; // OneOfDeviceType | +final eventType = ; // EventGetEventTypeParameter | +final deviceType = ; // EventGetDeviceTypeParameter | -try { +try { final result = api_instance.eventGet(homeId, deviceId, roomId, startIndex, count, dateStart, dateEnd, eventType, deviceType); print(result); } catch (e) { @@ -142,8 +142,8 @@ Name | Type | Description | Notes **count** | **int**| | [optional] **dateStart** | **DateTime**| | [optional] **dateEnd** | **DateTime**| | [optional] - **eventType** | [**OneOfEventType**](.md)| | [optional] - **deviceType** | [**OneOfDeviceType**](.md)| | [optional] + **eventType** | [**EventGetEventTypeParameter**](.md)| | [optional] + **deviceType** | [**EventGetDeviceTypeParameter**](.md)| | [optional] ### Return type @@ -165,16 +165,16 @@ Name | Type | Description | Notes Get detail info of a specified event -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = EventApi(); final eventId = eventId_example; // String | event id -try { +try { final result = api_instance.eventGetDetail(eventId); print(result); } catch (e) { diff --git a/mycore_api/doc/EventDTO.md b/mycore_api/doc/EventDTO.md index 12ff11c..a0fa28a 100644 --- a/mycore_api/doc/EventDTO.md +++ b/mycore_api/doc/EventDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventDTO +# mycore_api.model.EventDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/EventDetailDTO.md b/mycore_api/doc/EventDetailDTO.md index 2b065ea..a11865c 100644 --- a/mycore_api/doc/EventDetailDTO.md +++ b/mycore_api/doc/EventDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventDetailDTO +# mycore_api.model.EventDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/EventDetailDTOAllOf.md b/mycore_api/doc/EventDetailDTOAllOf.md index 9abd25a..2759bdf 100644 --- a/mycore_api/doc/EventDetailDTOAllOf.md +++ b/mycore_api/doc/EventDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventDetailDTOAllOf +# mycore_api.model.EventDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/EventFilter.md b/mycore_api/doc/EventFilter.md index 091e7b3..b130b01 100644 --- a/mycore_api/doc/EventFilter.md +++ b/mycore_api/doc/EventFilter.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventFilter +# mycore_api.model.EventFilter ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -12,8 +12,8 @@ Name | Type | Description | Notes **count** | **int** | | [optional] **dateStart** | [**DateTime**](DateTime.md) | | [optional] **dateEnd** | [**DateTime**](DateTime.md) | | [optional] -**eventType** | [**OneOfEventType**](OneOfEventType.md) | | [optional] -**deviceType** | [**OneOfDeviceType**](OneOfDeviceType.md) | | [optional] +**eventType** | [**EventGetEventTypeParameter**](EventGetEventTypeParameter.md) | | [optional] +**deviceType** | [**EventGetDeviceTypeParameter**](EventGetDeviceTypeParameter.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/mycore_api/doc/EventGetDeviceTypeParameter.md b/mycore_api/doc/EventGetDeviceTypeParameter.md new file mode 100644 index 0000000..6891887 --- /dev/null +++ b/mycore_api/doc/EventGetDeviceTypeParameter.md @@ -0,0 +1,14 @@ +# mycore_api.model.EventGetDeviceTypeParameter + +## Load the model package +```dart +import 'package:mycore_api/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/mycore_api/doc/EventGetEventTypeParameter.md b/mycore_api/doc/EventGetEventTypeParameter.md new file mode 100644 index 0000000..782f861 --- /dev/null +++ b/mycore_api/doc/EventGetEventTypeParameter.md @@ -0,0 +1,14 @@ +# mycore_api.model.EventGetEventTypeParameter + +## Load the model package +```dart +import 'package:mycore_api/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/mycore_api/doc/EventHomeFilter.md b/mycore_api/doc/EventHomeFilter.md index 98f9ba6..3db1d25 100644 --- a/mycore_api/doc/EventHomeFilter.md +++ b/mycore_api/doc/EventHomeFilter.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventHomeFilter +# mycore_api.model.EventHomeFilter ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -12,8 +12,8 @@ Name | Type | Description | Notes **count** | **int** | | [optional] **dateStart** | [**DateTime**](DateTime.md) | | [optional] **dateEnd** | [**DateTime**](DateTime.md) | | [optional] -**eventType** | [**OneOfEventType**](OneOfEventType.md) | | [optional] -**deviceType** | [**OneOfDeviceType**](OneOfDeviceType.md) | | [optional] +**eventType** | [**EventGetEventTypeParameter**](EventGetEventTypeParameter.md) | | [optional] +**deviceType** | [**EventGetDeviceTypeParameter**](EventGetDeviceTypeParameter.md) | | [optional] **deviceId** | **String** | | [optional] **roomId** | **String** | | [optional] diff --git a/mycore_api/doc/EventHomeFilterAllOf.md b/mycore_api/doc/EventHomeFilterAllOf.md index 4af7976..839bf8a 100644 --- a/mycore_api/doc/EventHomeFilterAllOf.md +++ b/mycore_api/doc/EventHomeFilterAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventHomeFilterAllOf +# mycore_api.model.EventHomeFilterAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/EventType.md b/mycore_api/doc/EventType.md index e2b757d..c00f5c6 100644 --- a/mycore_api/doc/EventType.md +++ b/mycore_api/doc/EventType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.EventType +# mycore_api.model.EventType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/FacebookApi.md b/mycore_api/doc/FacebookApi.md index d33af2a..15112d1 100644 --- a/mycore_api/doc/FacebookApi.md +++ b/mycore_api/doc/FacebookApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.FacebookApi +# mycore_api.api.FacebookApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,16 +17,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = FacebookApi(); final facebookAuthModel = FacebookAuthModel(); // FacebookAuthModel | -try { +try { final result = api_instance.facebookCreate(facebookAuthModel); print(result); } catch (e) { diff --git a/mycore_api/doc/FacebookAuthModel.md b/mycore_api/doc/FacebookAuthModel.md index fbc7fdc..829449c 100644 --- a/mycore_api/doc/FacebookAuthModel.md +++ b/mycore_api/doc/FacebookAuthModel.md @@ -1,8 +1,8 @@ -# mycoreapi.model.FacebookAuthModel +# mycore_api.model.FacebookAuthModel ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/GeolocalizedMode.md b/mycore_api/doc/GeolocalizedMode.md index 6756db9..bf2c1bf 100644 --- a/mycore_api/doc/GeolocalizedMode.md +++ b/mycore_api/doc/GeolocalizedMode.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GeolocalizedMode +# mycore_api.model.GeolocalizedMode ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -10,8 +10,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **latitude** | **String** | | [optional] **longitude** | **String** | | [optional] -**homeMode** | [**OneOfAlarmMode**](OneOfAlarmMode.md) | | [optional] -**absentMode** | [**OneOfAlarmMode**](OneOfAlarmMode.md) | | [optional] +**homeMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.md) | | [optional] +**absentMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.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/mycore_api/doc/GoogleApi.md b/mycore_api/doc/GoogleApi.md index 039ee0f..88f0584 100644 --- a/mycore_api/doc/GoogleApi.md +++ b/mycore_api/doc/GoogleApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.GoogleApi +# mycore_api.api.GoogleApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,16 +17,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GoogleApi(); final googleAuthModel = GoogleAuthModel(); // GoogleAuthModel | -try { +try { final result = api_instance.googleCreate(googleAuthModel); print(result); } catch (e) { diff --git a/mycore_api/doc/GoogleAuthModel.md b/mycore_api/doc/GoogleAuthModel.md index aad8249..ea826fc 100644 --- a/mycore_api/doc/GoogleAuthModel.md +++ b/mycore_api/doc/GoogleAuthModel.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GoogleAuthModel +# mycore_api.model.GoogleAuthModel ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/GroupApi.md b/mycore_api/doc/GroupApi.md index 194bb41..6c2c548 100644 --- a/mycore_api/doc/GroupApi.md +++ b/mycore_api/doc/GroupApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.GroupApi +# mycore_api.api.GroupApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -26,16 +26,16 @@ Method | HTTP request | Description Create a group -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | Group to create -try { +try { final result = api_instance.groupCreate(groupCreateOrUpdateDetailDTO); print(result); } catch (e) { @@ -69,16 +69,16 @@ Name | Type | Description | Notes Create groups from provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(homeId); print(result); } catch (e) { @@ -112,9 +112,9 @@ Name | Type | Description | Notes Delete device from a group -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -122,7 +122,7 @@ final api_instance = GroupApi(); final deviceId = deviceId_example; // String | Id of device to delete from the group final groupId = groupId_example; // String | Id of group -try { +try { final result = api_instance.groupDelete(deviceId, groupId); print(result); } catch (e) { @@ -157,16 +157,16 @@ Name | Type | Description | Notes Delete a group -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final groupId = groupId_example; // String | Id of group -try { +try { final result = api_instance.groupDelete2(groupId); print(result); } catch (e) { @@ -200,16 +200,16 @@ Name | Type | Description | Notes Delete all group for a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.groupDeleteAllForHome(homeId); print(result); } catch (e) { @@ -243,16 +243,16 @@ Name | Type | Description | Notes Get all groups for the specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.groupGetAll(homeId); print(result); } catch (e) { @@ -286,16 +286,16 @@ Name | Type | Description | Notes Get detail info of a specified group -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final groupId = groupId_example; // String | groupid -try { +try { final result = api_instance.groupGetDetail(groupId); print(result); } catch (e) { @@ -329,9 +329,9 @@ Name | Type | Description | Notes Get list of group from a type -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -339,7 +339,7 @@ final api_instance = GroupApi(); final homeId = homeId_example; // String | home Id final type = type_example; // String | group type -try { +try { final result = api_instance.groupGetGroupsByType(homeId, type); print(result); } catch (e) { @@ -374,16 +374,16 @@ Name | Type | Description | Notes Get all zigbee2Mqtt groups -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.groupGetGroupsFromZigbee2Mqtt(homeId); print(result); } catch (e) { @@ -417,16 +417,16 @@ Name | Type | Description | Notes Update a group -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = GroupApi(); final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | group to update -try { +try { final result = api_instance.groupUpdate(groupCreateOrUpdateDetailDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md b/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md index 257392f..6f1ec34 100644 --- a/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md +++ b/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GroupCreateOrUpdateDetailDTO +# mycore_api.model.GroupCreateOrUpdateDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md b/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md index 759be14..5d3d1d2 100644 --- a/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md +++ b/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GroupCreateOrUpdateDetailDTOAllOf +# mycore_api.model.GroupCreateOrUpdateDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/GroupDetailDTO.md b/mycore_api/doc/GroupDetailDTO.md index 288905c..0c0d14f 100644 --- a/mycore_api/doc/GroupDetailDTO.md +++ b/mycore_api/doc/GroupDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GroupDetailDTO +# mycore_api.model.GroupDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/GroupDetailDTOAllOf.md b/mycore_api/doc/GroupDetailDTOAllOf.md index 619df51..6db114e 100644 --- a/mycore_api/doc/GroupDetailDTOAllOf.md +++ b/mycore_api/doc/GroupDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GroupDetailDTOAllOf +# mycore_api.model.GroupDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/GroupSummaryDTO.md b/mycore_api/doc/GroupSummaryDTO.md index 1e5caf5..5d32d19 100644 --- a/mycore_api/doc/GroupSummaryDTO.md +++ b/mycore_api/doc/GroupSummaryDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.GroupSummaryDTO +# mycore_api.model.GroupSummaryDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/HomeApi.md b/mycore_api/doc/HomeApi.md index 5fa3b15..325e677 100644 --- a/mycore_api/doc/HomeApi.md +++ b/mycore_api/doc/HomeApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.HomeApi +# mycore_api.api.HomeApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -21,16 +21,16 @@ Method | HTTP request | Description Create a home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = HomeApi(); final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to create -try { +try { final result = api_instance.homeCreate(createOrUpdateHomeDTO); print(result); } catch (e) { @@ -64,16 +64,16 @@ Name | Type | Description | Notes Delete a home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = HomeApi(); final homeId = homeId_example; // String | Id of home to delete -try { +try { final result = api_instance.homeDelete(homeId); print(result); } catch (e) { @@ -107,16 +107,16 @@ Name | Type | Description | Notes Get all home for specified user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = HomeApi(); final userId = userId_example; // String | User Id -try { +try { final result = api_instance.homeGetAll(userId); print(result); } catch (e) { @@ -150,16 +150,16 @@ Name | Type | Description | Notes Get detail info of a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = HomeApi(); final homeId = homeId_example; // String | home id -try { +try { final result = api_instance.homeGetDetail(homeId); print(result); } catch (e) { @@ -193,16 +193,16 @@ Name | Type | Description | Notes Update a home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = HomeApi(); final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to update -try { +try { final result = api_instance.homeUpdate(createOrUpdateHomeDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/HomeDTO.md b/mycore_api/doc/HomeDTO.md index 177cc58..5deb28b 100644 --- a/mycore_api/doc/HomeDTO.md +++ b/mycore_api/doc/HomeDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.HomeDTO +# mycore_api.model.HomeDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -12,7 +12,7 @@ Name | Type | Description | Notes **name** | **String** | | [optional] **isAlarm** | **bool** | | [optional] **isDefault** | **bool** | | [optional] -**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional] +**currentAlarmMode** | [**HomeDTOCurrentAlarmMode**](HomeDTOCurrentAlarmMode.md) | | [optional] **createdDate** | [**DateTime**](DateTime.md) | | [optional] **updatedDate** | [**DateTime**](DateTime.md) | | [optional] **usersIds** | **List** | | [optional] [default to const []] diff --git a/mycore_api/doc/HomeDTOCurrentAlarmMode.md b/mycore_api/doc/HomeDTOCurrentAlarmMode.md new file mode 100644 index 0000000..0efca1d --- /dev/null +++ b/mycore_api/doc/HomeDTOCurrentAlarmMode.md @@ -0,0 +1,23 @@ +# mycore_api.model.HomeDTOCurrentAlarmMode + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | [**AlarmType**](AlarmType.md) | | [optional] +**activated** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**notification** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**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/mycore_api/doc/HomeDetailDTO.md b/mycore_api/doc/HomeDetailDTO.md index a3ee022..7a7e3b7 100644 --- a/mycore_api/doc/HomeDetailDTO.md +++ b/mycore_api/doc/HomeDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.HomeDetailDTO +# mycore_api.model.HomeDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -12,7 +12,7 @@ Name | Type | Description | Notes **name** | **String** | | [optional] **isAlarm** | **bool** | | [optional] **isDefault** | **bool** | | [optional] -**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional] +**currentAlarmMode** | [**HomeDTOCurrentAlarmMode**](HomeDTOCurrentAlarmMode.md) | | [optional] **createdDate** | [**DateTime**](DateTime.md) | | [optional] **updatedDate** | [**DateTime**](DateTime.md) | | [optional] **usersIds** | **List** | | [optional] [default to const []] diff --git a/mycore_api/doc/HomeDetailDTOAllOf.md b/mycore_api/doc/HomeDetailDTOAllOf.md index beccd35..dd9dd61 100644 --- a/mycore_api/doc/HomeDetailDTOAllOf.md +++ b/mycore_api/doc/HomeDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.HomeDetailDTOAllOf +# mycore_api.model.HomeDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/IOTApi.md b/mycore_api/doc/IOTApi.md index 2ab1ec2..1074985 100644 --- a/mycore_api/doc/IOTApi.md +++ b/mycore_api/doc/IOTApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.IOTApi +# mycore_api.api.IOTApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -19,9 +19,9 @@ Method | HTTP request | Description Retrieve all SmartPrinterMessage -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -29,7 +29,7 @@ final api_instance = IOTApi(); final idDevice = idDevice_example; // String | final id = 56; // int | Id of the smart printer message -try { +try { final result = api_instance.iOTGetSmartPrinterMessages(idDevice, id); print(result); } catch (e) { @@ -64,9 +64,9 @@ Name | Type | Description | Notes It's the method to post data from mqtt broker to Database (Thanks Rpi!) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -74,7 +74,7 @@ final api_instance = IOTApi(); final idDevice = 56; // int | Id of the device to upload to DB final smartPrinterMessage = [List()]; // List | Content that will be uploaded -try { +try { final result = api_instance.iOTPostToDBPrinter(idDevice, smartPrinterMessage); print(result); } catch (e) { @@ -109,9 +109,9 @@ Name | Type | Description | Notes It's the method to post data from mqtt broker to Database (Thanks Rpi!) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -119,7 +119,7 @@ final api_instance = IOTApi(); final idDevice = 56; // int | final smartGardenMessage = [List()]; // List | -try { +try { final result = api_instance.iOTPostToDBSmartGarden(idDevice, smartGardenMessage); print(result); } catch (e) { diff --git a/mycore_api/doc/LayoutApi.md b/mycore_api/doc/LayoutApi.md index 5435092..7218988 100644 --- a/mycore_api/doc/LayoutApi.md +++ b/mycore_api/doc/LayoutApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.LayoutApi +# mycore_api.api.LayoutApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,15 +17,15 @@ Method | HTTP request | Description It's a test ! :) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = LayoutApi(); -try { +try { final result = api_instance.layoutGet(); print(result); } catch (e) { diff --git a/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md b/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md index 97d1289..44b4524 100644 --- a/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md +++ b/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md @@ -1,15 +1,15 @@ -# mycoreapi.model.ListResponseOfEventDetailDTOAndEventHomeFilter +# mycore_api.model.ListResponseOfEventDetailDTOAndEventHomeFilter ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **values** | [**List**](EventDetailDTO.md) | | [optional] [default to const []] -**requestParameters** | [**OneOfEventHomeFilter**](OneOfEventHomeFilter.md) | | [optional] +**requestParameters** | [**ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters**](ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md) | | [optional] **totalCount** | **int** | | [optional] **actualCount** | **int** | | [optional] diff --git a/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md b/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md new file mode 100644 index 0000000..76c3937 --- /dev/null +++ b/mycore_api/doc/ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.md @@ -0,0 +1,22 @@ +# mycore_api.model.ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startIndex** | **int** | | [optional] +**count** | **int** | | [optional] +**dateStart** | [**DateTime**](DateTime.md) | | [optional] +**dateEnd** | [**DateTime**](DateTime.md) | | [optional] +**eventType** | [**EventGetEventTypeParameter**](EventGetEventTypeParameter.md) | | [optional] +**deviceType** | [**EventGetDeviceTypeParameter**](EventGetDeviceTypeParameter.md) | | [optional] +**deviceId** | **String** | | [optional] +**roomId** | **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/mycore_api/doc/LoginDTO.md b/mycore_api/doc/LoginDTO.md index 80fa242..b8dbaed 100644 --- a/mycore_api/doc/LoginDTO.md +++ b/mycore_api/doc/LoginDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.LoginDTO +# mycore_api.model.LoginDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/MQTTApi.md b/mycore_api/doc/MQTTApi.md index 0e31849..1c87906 100644 --- a/mycore_api/doc/MQTTApi.md +++ b/mycore_api/doc/MQTTApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.MQTTApi +# mycore_api.api.MQTTApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,16 +17,16 @@ Method | HTTP request | Description Publish mqtt test -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = MQTTApi(); final mqttMessageDTO = MqttMessageDTO(); // MqttMessageDTO | Message to send -try { +try { final result = api_instance.mQTTPublishMessage(mqttMessageDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/MeansOfCommunication.md b/mycore_api/doc/MeansOfCommunication.md index 6545c1c..818179f 100644 --- a/mycore_api/doc/MeansOfCommunication.md +++ b/mycore_api/doc/MeansOfCommunication.md @@ -1,8 +1,8 @@ -# mycoreapi.model.MeansOfCommunication +# mycore_api.model.MeansOfCommunication ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/MqttMessageDTO.md b/mycore_api/doc/MqttMessageDTO.md index 14e4475..b5e6d3e 100644 --- a/mycore_api/doc/MqttMessageDTO.md +++ b/mycore_api/doc/MqttMessageDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.MqttMessageDTO +# mycore_api.model.MqttMessageDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/OddApi.md b/mycore_api/doc/OddApi.md index f30b595..d1d57eb 100644 --- a/mycore_api/doc/OddApi.md +++ b/mycore_api/doc/OddApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.OddApi +# mycore_api.api.OddApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -18,16 +18,16 @@ Method | HTTP request | Description Get odds for one country and one odd value maximum -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = OddApi(); final oddRequest = 1.2; // double | Odd Maximum value -try { +try { final result = api_instance.oddGetAll(oddRequest); print(result); } catch (e) { @@ -61,9 +61,9 @@ Name | Type | Description | Notes Get odds for one country and one odd value maximum -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -71,7 +71,7 @@ final api_instance = OddApi(); final id = id_example; // String | id of country, e.g = BE for Belgium final oddRequest = 1.2; // double | Odd Maximum value -try { +try { final result = api_instance.oddGetForCountry(id, oddRequest); print(result); } catch (e) { diff --git a/mycore_api/doc/OddNice.md b/mycore_api/doc/OddNice.md index de75aaa..59ea708 100644 --- a/mycore_api/doc/OddNice.md +++ b/mycore_api/doc/OddNice.md @@ -1,8 +1,8 @@ -# mycoreapi.model.OddNice +# mycore_api.model.OddNice ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -11,7 +11,7 @@ Name | Type | Description | Notes **teams** | **List** | | [optional] [default to const []] **commenceTime** | **int** | | [optional] **homeTeam** | **String** | | [optional] -**odds** | [**OneOfOddObject**](OneOfOddObject.md) | | [optional] +**odds** | [**OddNiceOdds**](OddNiceOdds.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/mycore_api/doc/OddNiceOdds.md b/mycore_api/doc/OddNiceOdds.md new file mode 100644 index 0000000..239c766 --- /dev/null +++ b/mycore_api/doc/OddNiceOdds.md @@ -0,0 +1,17 @@ +# mycore_api.model.OddNiceOdds + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**homeOdd** | **double** | | [optional] +**drawOdd** | **double** | | [optional] +**visitOdd** | **double** | | [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/mycore_api/doc/OddObject.md b/mycore_api/doc/OddObject.md index 5204f6b..78d3dd5 100644 --- a/mycore_api/doc/OddObject.md +++ b/mycore_api/doc/OddObject.md @@ -1,8 +1,8 @@ -# mycoreapi.model.OddObject +# mycore_api.model.OddObject ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/PanelMenuItem.md b/mycore_api/doc/PanelMenuItem.md index 62ec649..a578837 100644 --- a/mycore_api/doc/PanelMenuItem.md +++ b/mycore_api/doc/PanelMenuItem.md @@ -1,8 +1,8 @@ -# mycoreapi.model.PanelMenuItem +# mycore_api.model.PanelMenuItem ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/PanelSection.md b/mycore_api/doc/PanelSection.md index fa22d45..20b388c 100644 --- a/mycore_api/doc/PanelSection.md +++ b/mycore_api/doc/PanelSection.md @@ -1,8 +1,8 @@ -# mycoreapi.model.PanelSection +# mycore_api.model.PanelSection ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ProgrammedMode.md b/mycore_api/doc/ProgrammedMode.md index e3fd09b..d457d2f 100644 --- a/mycore_api/doc/ProgrammedMode.md +++ b/mycore_api/doc/ProgrammedMode.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ProgrammedMode +# mycore_api.model.ProgrammedMode ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ProviderApi.md b/mycore_api/doc/ProviderApi.md index e9716f1..02e3196 100644 --- a/mycore_api/doc/ProviderApi.md +++ b/mycore_api/doc/ProviderApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.ProviderApi +# mycore_api.api.ProviderApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,16 +20,16 @@ Method | HTTP request | Description Create a provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ProviderApi(); final providerDTO = ProviderDTO(); // ProviderDTO | Provider to create -try { +try { final result = api_instance.providerCreate(providerDTO); print(result); } catch (e) { @@ -63,16 +63,16 @@ Name | Type | Description | Notes Delete a provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ProviderApi(); final providerId = providerId_example; // String | Id of provider to delete -try { +try { final result = api_instance.providerDelete(providerId); print(result); } catch (e) { @@ -106,16 +106,16 @@ Name | Type | Description | Notes Get all home providers -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ProviderApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.providerGetAll(homeId); print(result); } catch (e) { @@ -149,16 +149,16 @@ Name | Type | Description | Notes Update a provider -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ProviderApi(); final providerDTO = ProviderDTO(); // ProviderDTO | Provider to update -try { +try { final result = api_instance.providerUpdate(providerDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/ProviderDTO.md b/mycore_api/doc/ProviderDTO.md index fe1e9cf..a3fbfb3 100644 --- a/mycore_api/doc/ProviderDTO.md +++ b/mycore_api/doc/ProviderDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ProviderDTO +# mycore_api.model.ProviderDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ProviderType.md b/mycore_api/doc/ProviderType.md index 2c1cccb..f8b2a5f 100644 --- a/mycore_api/doc/ProviderType.md +++ b/mycore_api/doc/ProviderType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ProviderType +# mycore_api.model.ProviderType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/RoomApi.md b/mycore_api/doc/RoomApi.md index ad72908..4bef24c 100644 --- a/mycore_api/doc/RoomApi.md +++ b/mycore_api/doc/RoomApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.RoomApi +# mycore_api.api.RoomApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -25,9 +25,9 @@ Method | HTTP request | Description Add devices in the specified room -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -35,7 +35,7 @@ final api_instance = RoomApi(); final roomId = roomId_example; // String | Room Id final requestBody = [List()]; // List | Device Ids -try { +try { final result = api_instance.roomAddDeviceToRoom(roomId, requestBody); print(result); } catch (e) { @@ -70,16 +70,16 @@ Name | Type | Description | Notes Create a room -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | Room to create -try { +try { final result = api_instance.roomCreate(roomCreateOrUpdateDetailDTO); print(result); } catch (e) { @@ -113,16 +113,16 @@ Name | Type | Description | Notes Delete a room -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final roomId = roomId_example; // String | Id of room -try { +try { final result = api_instance.roomDelete(roomId); print(result); } catch (e) { @@ -156,9 +156,9 @@ Name | Type | Description | Notes Delete device from a room -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -166,7 +166,7 @@ final api_instance = RoomApi(); final deviceId = deviceId_example; // String | Id of device to delete from the room final roomId = roomId_example; // String | Id of room -try { +try { final result = api_instance.roomDelete2(deviceId, roomId); print(result); } catch (e) { @@ -201,16 +201,16 @@ Name | Type | Description | Notes Delete all rooms for a specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.roomDeleteAllForHome(homeId); print(result); } catch (e) { @@ -244,16 +244,16 @@ Name | Type | Description | Notes Get all rooms for the specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.roomGetAll(homeId); print(result); } catch (e) { @@ -287,16 +287,16 @@ Name | Type | Description | Notes Get all rooms main details for the specified home -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final homeId = homeId_example; // String | Home Id -try { +try { final result = api_instance.roomGetAllWithMainDetails(homeId); print(result); } catch (e) { @@ -330,16 +330,16 @@ Name | Type | Description | Notes Get detail info of a specified room -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final roomId = roomId_example; // String | room id -try { +try { final result = api_instance.roomGetDetail(roomId); print(result); } catch (e) { @@ -373,16 +373,16 @@ Name | Type | Description | Notes Update a room -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = RoomApi(); final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | room to update -try { +try { final result = api_instance.roomUpdate(roomCreateOrUpdateDetailDTO); print(result); } catch (e) { diff --git a/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md b/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md index afd96b0..40bf9da 100644 --- a/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md +++ b/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.RoomCreateOrUpdateDetailDTO +# mycore_api.model.RoomCreateOrUpdateDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/RoomDetailDTO.md b/mycore_api/doc/RoomDetailDTO.md index 84d671a..5beda54 100644 --- a/mycore_api/doc/RoomDetailDTO.md +++ b/mycore_api/doc/RoomDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.RoomDetailDTO +# mycore_api.model.RoomDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/RoomMainDetailDTO.md b/mycore_api/doc/RoomMainDetailDTO.md index 7a28efe..2f37d92 100644 --- a/mycore_api/doc/RoomMainDetailDTO.md +++ b/mycore_api/doc/RoomMainDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.RoomMainDetailDTO +# mycore_api.model.RoomMainDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/RoomMainDetailDTOAllOf.md b/mycore_api/doc/RoomMainDetailDTOAllOf.md index 8dc495c..c047321 100644 --- a/mycore_api/doc/RoomMainDetailDTOAllOf.md +++ b/mycore_api/doc/RoomMainDetailDTOAllOf.md @@ -1,8 +1,8 @@ -# mycoreapi.model.RoomMainDetailDTOAllOf +# mycore_api.model.RoomMainDetailDTOAllOf ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/RoomSummaryDTO.md b/mycore_api/doc/RoomSummaryDTO.md index d80c8f9..41208fe 100644 --- a/mycore_api/doc/RoomSummaryDTO.md +++ b/mycore_api/doc/RoomSummaryDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.RoomSummaryDTO +# mycore_api.model.RoomSummaryDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ScreenDevice.md b/mycore_api/doc/ScreenDevice.md index d512606..8a10b7d 100644 --- a/mycore_api/doc/ScreenDevice.md +++ b/mycore_api/doc/ScreenDevice.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ScreenDevice +# mycore_api.model.ScreenDevice ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ScreenDeviceApi.md b/mycore_api/doc/ScreenDeviceApi.md index 314565c..37df6f2 100644 --- a/mycore_api/doc/ScreenDeviceApi.md +++ b/mycore_api/doc/ScreenDeviceApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.ScreenDeviceApi +# mycore_api.api.ScreenDeviceApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -21,16 +21,16 @@ Method | HTTP request | Description Create screen device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ScreenDeviceApi(); final screenDevice = ScreenDevice(); // ScreenDevice | Screen device to create -try { +try { final result = api_instance.screenDeviceCreateDevice(screenDevice); print(result); } catch (e) { @@ -64,16 +64,16 @@ Name | Type | Description | Notes Delete device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ScreenDeviceApi(); final deviceId = deviceId_example; // String | Screen device id to update -try { +try { final result = api_instance.screenDeviceDeleteDevice(deviceId); print(result); } catch (e) { @@ -107,15 +107,15 @@ Name | Type | Description | Notes Get all screen devices -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ScreenDeviceApi(); -try { +try { final result = api_instance.screenDeviceGetAllScreenDevices(); print(result); } catch (e) { @@ -146,16 +146,16 @@ This endpoint does not need any parameter. Get screen device info -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ScreenDeviceApi(); final screenDeviceId = screenDeviceId_example; // String | Id of the screen device you want to get information -try { +try { final result = api_instance.screenDeviceGetDeviceInfo(screenDeviceId); print(result); } catch (e) { @@ -189,16 +189,16 @@ Name | Type | Description | Notes Update screen device -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ScreenDeviceApi(); final screenDevice = ScreenDevice(); // ScreenDevice | Screen device to update -try { +try { final result = api_instance.screenDeviceUpdateDevice(screenDevice); print(result); } catch (e) { diff --git a/mycore_api/doc/SmartGardenMessage.md b/mycore_api/doc/SmartGardenMessage.md index 5e42dc5..96dda42 100644 --- a/mycore_api/doc/SmartGardenMessage.md +++ b/mycore_api/doc/SmartGardenMessage.md @@ -1,8 +1,8 @@ -# mycoreapi.model.SmartGardenMessage +# mycore_api.model.SmartGardenMessage ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/SmartPrinterMessage.md b/mycore_api/doc/SmartPrinterMessage.md index cff4fae..f3d457d 100644 --- a/mycore_api/doc/SmartPrinterMessage.md +++ b/mycore_api/doc/SmartPrinterMessage.md @@ -1,8 +1,8 @@ -# mycoreapi.model.SmartPrinterMessage +# mycore_api.model.SmartPrinterMessage ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/TimePeriodAlarm.md b/mycore_api/doc/TimePeriodAlarm.md index 88eb586..fe2a622 100644 --- a/mycore_api/doc/TimePeriodAlarm.md +++ b/mycore_api/doc/TimePeriodAlarm.md @@ -1,8 +1,8 @@ -# mycoreapi.model.TimePeriodAlarm +# mycore_api.model.TimePeriodAlarm ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **start** | **String** | | [optional] **end** | **String** | | [optional] -**alarmMode** | [**OneOfAlarmMode**](OneOfAlarmMode.md) | | [optional] +**alarmMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.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/mycore_api/doc/TimePeriodAlarmAlarmMode.md b/mycore_api/doc/TimePeriodAlarmAlarmMode.md new file mode 100644 index 0000000..6a096f4 --- /dev/null +++ b/mycore_api/doc/TimePeriodAlarmAlarmMode.md @@ -0,0 +1,28 @@ +# mycore_api.model.TimePeriodAlarmAlarmMode + +## Load the model package +```dart +import 'package:mycore_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**activated** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**notification** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**type** | [**AlarmType**](AlarmType.md) | | [optional] +**programmedMode** | [**AlarmModeProgrammedMode**](AlarmModeProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**AlarmModeGeolocalizedMode**](AlarmModeGeolocalizedMode.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [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/mycore_api/doc/TokenApi.md b/mycore_api/doc/TokenApi.md index 9c8a82c..68ae463 100644 --- a/mycore_api/doc/TokenApi.md +++ b/mycore_api/doc/TokenApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.TokenApi +# mycore_api.api.TokenApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -18,16 +18,16 @@ Method | HTTP request | Description Connect user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = TokenApi(); final loginDTO = LoginDTO(); // LoginDTO | login info -try { +try { final result = api_instance.tokenConnectUser(loginDTO); print(result); } catch (e) { @@ -61,16 +61,16 @@ Name | Type | Description | Notes -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = TokenApi(); final user = User(); // User | -try { +try { final result = api_instance.tokenCreate(user); print(result); } catch (e) { diff --git a/mycore_api/doc/TokenDTO.md b/mycore_api/doc/TokenDTO.md index be926b3..e7e4f78 100644 --- a/mycore_api/doc/TokenDTO.md +++ b/mycore_api/doc/TokenDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.TokenDTO +# mycore_api.model.TokenDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/Trigger.md b/mycore_api/doc/Trigger.md index 1ab8cb4..9a03800 100644 --- a/mycore_api/doc/Trigger.md +++ b/mycore_api/doc/Trigger.md @@ -1,8 +1,8 @@ -# mycoreapi.model.Trigger +# mycore_api.model.Trigger ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/TriggerType.md b/mycore_api/doc/TriggerType.md index 6d73e21..01b660f 100644 --- a/mycore_api/doc/TriggerType.md +++ b/mycore_api/doc/TriggerType.md @@ -1,8 +1,8 @@ -# mycoreapi.model.TriggerType +# mycore_api.model.TriggerType ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/TwitterApi.md b/mycore_api/doc/TwitterApi.md index 11050d6..8dfc13b 100644 --- a/mycore_api/doc/TwitterApi.md +++ b/mycore_api/doc/TwitterApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.TwitterApi +# mycore_api.api.TwitterApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -17,16 +17,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = TwitterApi(); final twitterAuthModel = TwitterAuthModel(); // TwitterAuthModel | -try { +try { final result = api_instance.twitterCreate(twitterAuthModel); print(result); } catch (e) { diff --git a/mycore_api/doc/TwitterAuthModel.md b/mycore_api/doc/TwitterAuthModel.md index 3f56c06..0a89e0b 100644 --- a/mycore_api/doc/TwitterAuthModel.md +++ b/mycore_api/doc/TwitterAuthModel.md @@ -1,8 +1,8 @@ -# mycoreapi.model.TwitterAuthModel +# mycore_api.model.TwitterAuthModel ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/User.md b/mycore_api/doc/User.md index 6ee02f4..9c3ac9e 100644 --- a/mycore_api/doc/User.md +++ b/mycore_api/doc/User.md @@ -1,8 +1,8 @@ -# mycoreapi.model.User +# mycore_api.model.User ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/UserApi.md b/mycore_api/doc/UserApi.md index 89f2c7a..5f5b8c7 100644 --- a/mycore_api/doc/UserApi.md +++ b/mycore_api/doc/UserApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.UserApi +# mycore_api.api.UserApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,16 +22,16 @@ Method | HTTP request | Description Create an user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final userInfo = UserInfo(); // UserInfo | New user info -try { +try { final result = api_instance.userCreateUser(userInfo); print(result); } catch (e) { @@ -65,16 +65,16 @@ Name | Type | Description | Notes Delete an user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_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 | Id of user to delete -try { +try { final result = api_instance.userDeleteUser(id); print(result); } catch (e) { @@ -108,16 +108,16 @@ Name | Type | Description | Notes Get a specific user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_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 | id user -try { +try { final result = api_instance.userGet(id); print(result); } catch (e) { @@ -151,15 +151,15 @@ Name | Type | Description | Notes Get a list of user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_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.userGetAll(); print(result); } catch (e) { @@ -190,16 +190,16 @@ This endpoint does not need any parameter. Get a specific user by email -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final email = email_example; // String | user email -try { +try { final result = api_instance.userGetByEmail(email); print(result); } catch (e) { @@ -233,16 +233,16 @@ Name | Type | Description | Notes Update an user -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = UserApi(); final userInfo = UserInfo(); // UserInfo | User to update -try { +try { final result = api_instance.userUpdateUser(userInfo); print(result); } catch (e) { diff --git a/mycore_api/doc/UserInfo.md b/mycore_api/doc/UserInfo.md index e17644a..0bc0c3d 100644 --- a/mycore_api/doc/UserInfo.md +++ b/mycore_api/doc/UserInfo.md @@ -1,8 +1,8 @@ -# mycoreapi.model.UserInfo +# mycore_api.model.UserInfo ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/UserInfoDetailDTO.md b/mycore_api/doc/UserInfoDetailDTO.md index 2f49668..c2e1bbf 100644 --- a/mycore_api/doc/UserInfoDetailDTO.md +++ b/mycore_api/doc/UserInfoDetailDTO.md @@ -1,8 +1,8 @@ -# mycoreapi.model.UserInfoDetailDTO +# mycore_api.model.UserInfoDetailDTO ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/doc/ValuesApi.md b/mycore_api/doc/ValuesApi.md index 416a89c..49f7512 100644 --- a/mycore_api/doc/ValuesApi.md +++ b/mycore_api/doc/ValuesApi.md @@ -1,11 +1,11 @@ -# mycoreapi.api.ValuesApi +# mycore_api.api.ValuesApi ## Load the API package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -21,16 +21,16 @@ Method | HTTP request | Description -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ValuesApi(); final id = 56; // int | -try { +try { api_instance.valuesDelete(id); } catch (e) { print('Exception when calling ValuesApi->valuesDelete: $e\n'); @@ -63,16 +63,16 @@ void (empty response body) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ValuesApi(); final id = 56; // int | -try { +try { final result = api_instance.valuesGet(id); print(result); } catch (e) { @@ -106,15 +106,15 @@ Name | Type | Description | Notes It's a test ! :) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ValuesApi(); -try { +try { final result = api_instance.valuesGetAll(); print(result); } catch (e) { @@ -145,16 +145,16 @@ This endpoint does not need any parameter. -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ValuesApi(); final body = String(); // String | -try { +try { api_instance.valuesPost(body); } catch (e) { print('Exception when calling ValuesApi->valuesPost: $e\n'); @@ -187,9 +187,9 @@ void (empty response body) -### Example +### Example ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -197,7 +197,7 @@ final api_instance = ValuesApi(); final id = 56; // int | final body = String(); // String | -try { +try { api_instance.valuesPut(id, body); } catch (e) { print('Exception when calling ValuesApi->valuesPut: $e\n'); diff --git a/mycore_api/doc/ViewBy.md b/mycore_api/doc/ViewBy.md index a23cd79..7222003 100644 --- a/mycore_api/doc/ViewBy.md +++ b/mycore_api/doc/ViewBy.md @@ -1,8 +1,8 @@ -# mycoreapi.model.ViewBy +# mycore_api.model.ViewBy ## Load the model package ```dart -import 'package:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; ``` ## Properties diff --git a/mycore_api/git_push.sh b/mycore_api/git_push.sh index ced3be2..f53a75d 100644 --- a/mycore_api/git_push.sh +++ b/mycore_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/mycore_api/lib/api.dart b/mycore_api/lib/api.dart index 1665c6c..d88e707 100644 --- a/mycore_api/lib/api.dart +++ b/mycore_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'; @@ -59,6 +59,8 @@ part 'model/alarm_mode_create_or_update_detail_dto_all_of.dart'; part 'model/alarm_mode_dto.dart'; part 'model/alarm_mode_detail_dto.dart'; part 'model/alarm_mode_detail_dto_all_of.dart'; +part 'model/alarm_mode_geolocalized_mode.dart'; +part 'model/alarm_mode_programmed_mode.dart'; part 'model/alarm_triggered.dart'; part 'model/alarm_type.dart'; part 'model/automation_dto.dart'; @@ -69,6 +71,7 @@ part 'model/automation_triggered.dart'; part 'model/azure_ad_auth_model.dart'; part 'model/book.dart'; part 'model/condition.dart'; +part 'model/condition_state.dart'; part 'model/condition_type.dart'; part 'model/condition_value.dart'; part 'model/connection_status.dart'; @@ -103,6 +106,7 @@ part 'model/login_dto.dart'; part 'model/means_of_communication.dart'; part 'model/mqtt_message_dto.dart'; part 'model/odd_nice.dart'; +part 'model/odd_nice_odds.dart'; part 'model/odd_object.dart'; part 'model/panel_menu_item.dart'; part 'model/panel_section.dart'; diff --git a/mycore_api/lib/api/alarm_api.dart b/mycore_api/lib/api/alarm_api.dart index d0ddfba..f3ad2fd 100644 --- a/mycore_api/lib/api/alarm_api.dart +++ b/mycore_api/lib/api/alarm_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 AlarmApi { - AlarmApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + AlarmApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,46 +24,29 @@ class AlarmApi { /// /// * [String] alarmModeId (required): /// Alarm mode to activate - Future alarmActivateWithHttpInfo(String alarmModeId) async { - // Verify required params are set. - if (alarmModeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId'); - } - + Future alarmActivateWithHttpInfo(String alarmModeId,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm/activate/{alarmModeId}' - .replaceAll('{' + 'alarmModeId' + '}', alarmModeId.toString()); + .replaceAll('{alarmModeId}', alarmModeId); - 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, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } @@ -72,18 +56,19 @@ class AlarmApi { /// /// * [String] alarmModeId (required): /// Alarm mode to activate - Future alarmActivate(String alarmModeId) async { - final response = await alarmActivateWithHttpInfo(alarmModeId); + Future alarmActivate(String alarmModeId,) async { + final response = await alarmActivateWithHttpInfo(alarmModeId,); 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; } /// Create an alarm mode @@ -94,45 +79,28 @@ class AlarmApi { /// /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): /// Alarm mode to create - Future alarmCreateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { - // Verify required params are set. - if (alarmModeCreateOrUpdateDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeCreateOrUpdateDetailDTO'); - } - + Future alarmCreateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm'; - Object postBody = alarmModeCreateOrUpdateDetailDTO; + // ignore: prefer_final_locals + Object? postBody = alarmModeCreateOrUpdateDetailDTO; 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, ); } @@ -142,18 +110,19 @@ class AlarmApi { /// /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): /// Alarm mode to create - Future alarmCreate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { - final response = await alarmCreateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO); + Future alarmCreate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO,) async { + final response = await alarmCreateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO,); 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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlarmModeDetailDTO',) as AlarmModeDetailDTO; + + } + return null; } /// Create default alarm modes @@ -164,46 +133,29 @@ class AlarmApi { /// /// * [String] homeId (required): /// Home Id - Future alarmCreateDefaultAlarmsWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future alarmCreateDefaultAlarmsWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm/defaults/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } @@ -213,18 +165,19 @@ class AlarmApi { /// /// * [String] homeId (required): /// Home Id - Future alarmCreateDefaultAlarms(String homeId) async { - final response = await alarmCreateDefaultAlarmsWithHttpInfo(homeId); + Future alarmCreateDefaultAlarms(String homeId,) async { + final response = await alarmCreateDefaultAlarmsWithHttpInfo(homeId,); 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), 'bool') as bool; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'bool',) as bool; + + } + return null; } /// Delete an alarm mode @@ -235,46 +188,29 @@ class AlarmApi { /// /// * [String] alarmModeId (required): /// Id of alarm mode to delete - Future alarmDeleteWithHttpInfo(String alarmModeId) async { - // Verify required params are set. - if (alarmModeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId'); - } - + Future alarmDeleteWithHttpInfo(String alarmModeId,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm/{alarmModeId}' - .replaceAll('{' + 'alarmModeId' + '}', alarmModeId.toString()); + .replaceAll('{alarmModeId}', alarmModeId); - 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, ); } @@ -284,18 +220,19 @@ class AlarmApi { /// /// * [String] alarmModeId (required): /// Id of alarm mode to delete - Future alarmDelete(String alarmModeId) async { - final response = await alarmDeleteWithHttpInfo(alarmModeId); + Future alarmDelete(String alarmModeId,) async { + final response = await alarmDeleteWithHttpInfo(alarmModeId,); 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; } /// Delete all alarm mode for a specified home @@ -306,46 +243,29 @@ class AlarmApi { /// /// * [String] homeId (required): /// Home Id - Future alarmDeleteAllForHomeWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future alarmDeleteAllForHomeWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -355,18 +275,19 @@ class AlarmApi { /// /// * [String] homeId (required): /// Home Id - Future alarmDeleteAllForHome(String homeId) async { - final response = await alarmDeleteAllForHomeWithHttpInfo(homeId); + Future alarmDeleteAllForHome(String homeId,) async { + final response = await alarmDeleteAllForHomeWithHttpInfo(homeId,); 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; } /// Get all alarm modes for the specified home @@ -377,46 +298,29 @@ class AlarmApi { /// /// * [String] homeId (required): /// Home Id - Future alarmGetAllWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future alarmGetAllWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -426,20 +330,22 @@ class AlarmApi { /// /// * [String] homeId (required): /// Home Id - Future> alarmGetAll(String homeId) async { - final response = await alarmGetAllWithHttpInfo(homeId); + Future?> alarmGetAll(String homeId,) async { + final response = await alarmGetAllWithHttpInfo(homeId,); 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; } /// Get detail info of a specified alarm mode @@ -450,46 +356,29 @@ class AlarmApi { /// /// * [String] alarmModeId (required): /// alarm id - Future alarmGetDetailWithHttpInfo(String alarmModeId) async { - // Verify required params are set. - if (alarmModeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId'); - } - + Future alarmGetDetailWithHttpInfo(String alarmModeId,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm/detail/{alarmModeId}' - .replaceAll('{' + 'alarmModeId' + '}', alarmModeId.toString()); + .replaceAll('{alarmModeId}', alarmModeId); - 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, ); } @@ -499,18 +388,19 @@ class AlarmApi { /// /// * [String] alarmModeId (required): /// alarm id - Future alarmGetDetail(String alarmModeId) async { - final response = await alarmGetDetailWithHttpInfo(alarmModeId); + Future alarmGetDetail(String alarmModeId,) async { + final response = await alarmGetDetailWithHttpInfo(alarmModeId,); 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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlarmModeDetailDTO',) as AlarmModeDetailDTO; + + } + return null; } /// Update an alarm mode @@ -521,45 +411,28 @@ class AlarmApi { /// /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): /// alarm mode to update - Future alarmUpdateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { - // Verify required params are set. - if (alarmModeCreateOrUpdateDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeCreateOrUpdateDetailDTO'); - } - + Future alarmUpdateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/alarm'; - Object postBody = alarmModeCreateOrUpdateDetailDTO; + // ignore: prefer_final_locals + Object? postBody = alarmModeCreateOrUpdateDetailDTO; 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, ); } @@ -569,17 +442,18 @@ class AlarmApi { /// /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): /// alarm mode to update - Future alarmUpdate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { - final response = await alarmUpdateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO); + Future alarmUpdate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO,) async { + final response = await alarmUpdateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO,); 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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlarmModeDetailDTO',) as AlarmModeDetailDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/authentication_api.dart b/mycore_api/lib/api/authentication_api.dart index 1a9a13a..9be6063 100644 --- a/mycore_api/lib/api/authentication_api.dart +++ b/mycore_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; @@ -30,77 +31,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, ); } @@ -117,18 +94,19 @@ 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; } /// Authenticate with Json parameters (used by most clients) @@ -139,45 +117,28 @@ class AuthenticationApi { /// /// * [LoginDTO] loginDTO (required): /// Login DTO - 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, ); } @@ -187,17 +148,18 @@ class AuthenticationApi { /// /// * [LoginDTO] loginDTO (required): /// Login DTO - 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/mycore_api/lib/api/automation_api.dart b/mycore_api/lib/api/automation_api.dart index 70fe930..637e8eb 100644 --- a/mycore_api/lib/api/automation_api.dart +++ b/mycore_api/lib/api/automation_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 AutomationApi { - AutomationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + AutomationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class AutomationApi { /// /// * [AutomationDetailDTO] automationDetailDTO (required): /// Automation to create - Future automationCreateWithHttpInfo(AutomationDetailDTO automationDetailDTO) async { - // Verify required params are set. - if (automationDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: automationDetailDTO'); - } - + Future automationCreateWithHttpInfo(AutomationDetailDTO automationDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/automation'; - Object postBody = automationDetailDTO; + // ignore: prefer_final_locals + Object? postBody = automationDetailDTO; 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, ); } @@ -71,18 +55,19 @@ class AutomationApi { /// /// * [AutomationDetailDTO] automationDetailDTO (required): /// Automation to create - Future automationCreate(AutomationDetailDTO automationDetailDTO) async { - final response = await automationCreateWithHttpInfo(automationDetailDTO); + Future automationCreate(AutomationDetailDTO automationDetailDTO,) async { + final response = await automationCreateWithHttpInfo(automationDetailDTO,); 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), 'AutomationDTO') as AutomationDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AutomationDTO',) as AutomationDTO; + + } + return null; } /// Delete an automation @@ -93,46 +78,29 @@ class AutomationApi { /// /// * [String] automationId (required): /// Id of automation to delete - Future automationDeleteWithHttpInfo(String automationId) async { - // Verify required params are set. - if (automationId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); - } - + Future automationDeleteWithHttpInfo(String automationId,) async { + // ignore: prefer_const_declarations final path = r'/api/automation/{automationId}' - .replaceAll('{' + 'automationId' + '}', automationId.toString()); + .replaceAll('{automationId}', automationId); - 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, ); } @@ -142,18 +110,19 @@ class AutomationApi { /// /// * [String] automationId (required): /// Id of automation to delete - Future automationDelete(String automationId) async { - final response = await automationDeleteWithHttpInfo(automationId); + Future automationDelete(String automationId,) async { + final response = await automationDeleteWithHttpInfo(automationId,); 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; } /// Delete all automation for a specified home @@ -164,46 +133,29 @@ class AutomationApi { /// /// * [String] homeId (required): /// Home Id - Future automationDeleteAllForHomeWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future automationDeleteAllForHomeWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/automation/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -213,18 +165,19 @@ class AutomationApi { /// /// * [String] homeId (required): /// Home Id - Future automationDeleteAllForHome(String homeId) async { - final response = await automationDeleteAllForHomeWithHttpInfo(homeId); + Future automationDeleteAllForHome(String homeId,) async { + final response = await automationDeleteAllForHomeWithHttpInfo(homeId,); 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; } /// Get all automations for the specified home @@ -235,46 +188,29 @@ class AutomationApi { /// /// * [String] homeId (required): /// Home Id - Future automationGetAllWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future automationGetAllWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/automation/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -284,20 +220,22 @@ class AutomationApi { /// /// * [String] homeId (required): /// Home Id - Future> automationGetAll(String homeId) async { - final response = await automationGetAllWithHttpInfo(homeId); + Future?> automationGetAll(String homeId,) async { + final response = await automationGetAllWithHttpInfo(homeId,); 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; } /// Get detail info of a specified automation @@ -308,46 +246,29 @@ class AutomationApi { /// /// * [String] automationId (required): /// automation id - Future automationGetDetailWithHttpInfo(String automationId) async { - // Verify required params are set. - if (automationId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); - } - + Future automationGetDetailWithHttpInfo(String automationId,) async { + // ignore: prefer_const_declarations final path = r'/api/automation/detail/{automationId}' - .replaceAll('{' + 'automationId' + '}', automationId.toString()); + .replaceAll('{automationId}', automationId); - 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, ); } @@ -357,18 +278,19 @@ class AutomationApi { /// /// * [String] automationId (required): /// automation id - Future automationGetDetail(String automationId) async { - final response = await automationGetDetailWithHttpInfo(automationId); + Future automationGetDetail(String automationId,) async { + final response = await automationGetDetailWithHttpInfo(automationId,); 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), 'AutomationDetailDTO') as AutomationDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AutomationDetailDTO',) as AutomationDetailDTO; + + } + return null; } /// Update an automation @@ -379,45 +301,28 @@ class AutomationApi { /// /// * [AutomationDetailDTO] automationDetailDTO (required): /// automation to update - Future automationUpdateWithHttpInfo(AutomationDetailDTO automationDetailDTO) async { - // Verify required params are set. - if (automationDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: automationDetailDTO'); - } - + Future automationUpdateWithHttpInfo(AutomationDetailDTO automationDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/automation'; - Object postBody = automationDetailDTO; + // ignore: prefer_final_locals + Object? postBody = automationDetailDTO; 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, ); } @@ -427,17 +332,18 @@ class AutomationApi { /// /// * [AutomationDetailDTO] automationDetailDTO (required): /// automation to update - Future automationUpdate(AutomationDetailDTO automationDetailDTO) async { - final response = await automationUpdateWithHttpInfo(automationDetailDTO); + Future automationUpdate(AutomationDetailDTO automationDetailDTO,) async { + final response = await automationUpdateWithHttpInfo(automationDetailDTO,); 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), 'AutomationDetailDTO') as AutomationDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AutomationDetailDTO',) as AutomationDetailDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/azure_api.dart b/mycore_api/lib/api/azure_api.dart index 3e2266a..cf053e1 100644 --- a/mycore_api/lib/api/azure_api.dart +++ b/mycore_api/lib/api/azure_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 AzureApi { - AzureApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + AzureApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,62 +20,46 @@ class AzureApi { /// Parameters: /// /// * [AzureADAuthModel] azureADAuthModel (required): - Future azureCreateWithHttpInfo(AzureADAuthModel azureADAuthModel) async { - // Verify required params are set. - if (azureADAuthModel == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: azureADAuthModel'); - } - + Future azureCreateWithHttpInfo(AzureADAuthModel azureADAuthModel,) async { + // ignore: prefer_const_declarations final path = r'/azure'; - Object postBody = azureADAuthModel; + // ignore: prefer_final_locals + Object? postBody = azureADAuthModel; 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: /// /// * [AzureADAuthModel] azureADAuthModel (required): - Future azureCreate(AzureADAuthModel azureADAuthModel) async { - final response = await azureCreateWithHttpInfo(azureADAuthModel); + Future azureCreate(AzureADAuthModel azureADAuthModel,) async { + final response = await azureCreateWithHttpInfo(azureADAuthModel,); 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; } } diff --git a/mycore_api/lib/api/books_api.dart b/mycore_api/lib/api/books_api.dart index 03998f3..29a28f9 100644 --- a/mycore_api/lib/api/books_api.dart +++ b/mycore_api/lib/api/books_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 BooksApi { - BooksApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + BooksApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,245 +20,187 @@ class BooksApi { /// Parameters: /// /// * [Book] book (required): - Future booksCreateWithHttpInfo(Book book) async { - // Verify required params are set. - if (book == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: book'); - } - + Future booksCreateWithHttpInfo(Book book,) async { + // ignore: prefer_const_declarations final path = r'/api/books'; - Object postBody = book; + // ignore: prefer_final_locals + Object? postBody = book; 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: /// /// * [Book] book (required): - Future booksCreate(Book book) async { - final response = await booksCreateWithHttpInfo(book); + Future booksCreate(Book book,) async { + final response = await booksCreateWithHttpInfo(book,); 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), 'Book') as Book; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Book',) as Book; + + } + return null; } /// Performs an HTTP 'DELETE /api/books/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future booksDeleteWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future booksDeleteWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/books/{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 booksDelete(String id) async { - final response = await booksDeleteWithHttpInfo(id); + Future booksDelete(String id,) async { + final response = await booksDeleteWithHttpInfo(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 'GET /api/books/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): - Future booksGetWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future booksGetWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations final path = r'/api/books/{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 booksGet(String id) async { - final response = await booksGetWithHttpInfo(id); + Future booksGet(String id,) async { + final response = await booksGetWithHttpInfo(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), 'Book') as Book; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Book',) as Book; + + } + return null; } /// Performs an HTTP 'GET /api/books' operation and returns the [Response]. Future booksGetAllWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/books'; - 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> booksGetAll() async { + Future?> booksGetAll() async { final response = await booksGetAllWithHttpInfo(); 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 'PUT /api/books/{id}' operation and returns the [Response]. @@ -266,49 +209,29 @@ class BooksApi { /// * [String] id (required): /// /// * [Book] book (required): - Future booksUpdateWithHttpInfo(String id, Book book) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - if (book == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: book'); - } - + Future booksUpdateWithHttpInfo(String id, Book book,) async { + // ignore: prefer_const_declarations final path = r'/api/books/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id); - Object postBody = book; + // ignore: prefer_final_locals + Object? postBody = book; 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, ); } @@ -317,17 +240,18 @@ class BooksApi { /// * [String] id (required): /// /// * [Book] book (required): - Future booksUpdate(String id, Book book) async { - final response = await booksUpdateWithHttpInfo(id, book); + Future booksUpdate(String id, Book book,) async { + final response = await booksUpdateWithHttpInfo(id, book,); 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; } } diff --git a/mycore_api/lib/api/device_api.dart b/mycore_api/lib/api/device_api.dart index 553d786..0a04946 100644 --- a/mycore_api/lib/api/device_api.dart +++ b/mycore_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; @@ -23,45 +24,28 @@ class DeviceApi { /// /// * [DeviceDetailDTO] deviceDetailDTO (required): /// Device to create - 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, ); } @@ -71,18 +55,19 @@ class DeviceApi { /// /// * [DeviceDetailDTO] deviceDetailDTO (required): /// Device to create - 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; } /// Create devices from provider @@ -96,50 +81,30 @@ class DeviceApi { /// /// * [String] providerId (required): /// Id of Provider - Future deviceCreateDevicesFromProviderWithHttpInfo(String homeId, String providerId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - if (providerId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); - } - + Future deviceCreateDevicesFromProviderWithHttpInfo(String homeId, String providerId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{homeId}/fromProvider/{providerId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()) - .replaceAll('{' + 'providerId' + '}', providerId.toString()); + .replaceAll('{homeId}', homeId) + .replaceAll('{providerId}', providerId); - 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, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } @@ -152,20 +117,22 @@ class DeviceApi { /// /// * [String] providerId (required): /// Id of Provider - Future> deviceCreateDevicesFromProvider(String homeId, String providerId) async { - final response = await deviceCreateDevicesFromProviderWithHttpInfo(homeId, providerId); + Future?> deviceCreateDevicesFromProvider(String homeId, String providerId,) async { + final response = await deviceCreateDevicesFromProviderWithHttpInfo(homeId, providerId,); 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; } /// Delete a device @@ -176,46 +143,29 @@ class DeviceApi { /// /// * [String] deviceId (required): /// Id of device to delete - Future deviceDeleteWithHttpInfo(String deviceId) async { - // Verify required params are set. - if (deviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); - } - + Future deviceDeleteWithHttpInfo(String deviceId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{deviceId}' - .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + .replaceAll('{deviceId}', deviceId); - 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, ); } @@ -225,18 +175,19 @@ class DeviceApi { /// /// * [String] deviceId (required): /// Id of device to delete - Future deviceDelete(String deviceId) async { - final response = await deviceDeleteWithHttpInfo(deviceId); + Future deviceDelete(String deviceId,) async { + final response = await deviceDeleteWithHttpInfo(deviceId,); 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; } /// Delete all device for a specified home @@ -247,46 +198,29 @@ class DeviceApi { /// /// * [String] homeId (required): /// Id of home - Future deviceDeleteAllForHomeWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future deviceDeleteAllForHomeWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -296,18 +230,19 @@ class DeviceApi { /// /// * [String] homeId (required): /// Id of home - Future deviceDeleteAllForHome(String homeId) async { - final response = await deviceDeleteAllForHomeWithHttpInfo(homeId); + Future deviceDeleteAllForHome(String homeId,) async { + final response = await deviceDeleteAllForHomeWithHttpInfo(homeId,); 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; } /// Delete devices from provider @@ -321,50 +256,30 @@ class DeviceApi { /// /// * [String] providerId (required): /// Id of Provider - Future deviceDeleteDevicesFromProviderWithHttpInfo(String homeId, String providerId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - if (providerId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); - } - + Future deviceDeleteDevicesFromProviderWithHttpInfo(String homeId, String providerId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{homeId}/fromProvider/{providerId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()) - .replaceAll('{' + 'providerId' + '}', providerId.toString()); + .replaceAll('{homeId}', homeId) + .replaceAll('{providerId}', providerId); - 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, ); } @@ -377,18 +292,19 @@ class DeviceApi { /// /// * [String] providerId (required): /// Id of Provider - Future deviceDeleteDevicesFromProvider(String homeId, String providerId) async { - final response = await deviceDeleteDevicesFromProviderWithHttpInfo(homeId, providerId); + Future deviceDeleteDevicesFromProvider(String homeId, String providerId,) async { + final response = await deviceDeleteDevicesFromProviderWithHttpInfo(homeId, providerId,); 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; } /// Get all devices summary @@ -399,46 +315,29 @@ class DeviceApi { /// /// * [String] homeId (required): /// Home Id - Future deviceGetAllWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future deviceGetAllWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -448,20 +347,22 @@ class DeviceApi { /// /// * [String] homeId (required): /// Home Id - Future> deviceGetAll(String homeId) async { - final response = await deviceGetAllWithHttpInfo(homeId); + Future?> deviceGetAll(String homeId,) async { + final response = await deviceGetAllWithHttpInfo(homeId,); 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; } /// Get a specific device info @@ -472,46 +373,29 @@ class DeviceApi { /// /// * [String] deviceId (required): /// id of device - Future deviceGetDetailWithHttpInfo(String deviceId) async { - // Verify required params are set. - if (deviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); - } - + Future deviceGetDetailWithHttpInfo(String deviceId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/detail/{deviceId}' - .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + .replaceAll('{deviceId}', deviceId); - 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, ); } @@ -521,18 +405,19 @@ class DeviceApi { /// /// * [String] deviceId (required): /// id of device - Future deviceGetDetail(String deviceId) async { - final response = await deviceGetDetailWithHttpInfo(deviceId); + Future deviceGetDetail(String deviceId,) async { + final response = await deviceGetDetailWithHttpInfo(deviceId,); 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; } /// Get list of devices from a type @@ -546,50 +431,30 @@ class DeviceApi { /// /// * [DeviceType] type (required): /// device type - Future deviceGetDevicesByTypeWithHttpInfo(String homeId, DeviceType type) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - if (type == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: type'); - } - + Future deviceGetDevicesByTypeWithHttpInfo(String homeId, DeviceType type,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{homeId}/type/{type}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()) - .replaceAll('{' + 'type' + '}', type.toString()); + .replaceAll('{homeId}', homeId) + .replaceAll('{type}', type.toString()); - 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, ); } @@ -602,20 +467,22 @@ class DeviceApi { /// /// * [DeviceType] type (required): /// device type - Future> deviceGetDevicesByType(String homeId, DeviceType type) async { - final response = await deviceGetDevicesByTypeWithHttpInfo(homeId, type); + Future?> deviceGetDevicesByType(String homeId, DeviceType type,) async { + final response = await deviceGetDevicesByTypeWithHttpInfo(homeId, type,); 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; } /// Get devices from provider @@ -629,50 +496,30 @@ class DeviceApi { /// /// * [String] providerId (required): /// Id of Provider - Future deviceGetDevicesFromProviderWithHttpInfo(String homeId, String providerId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - if (providerId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); - } - + Future deviceGetDevicesFromProviderWithHttpInfo(String homeId, String providerId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{homeId}/fromProvider/{providerId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()) - .replaceAll('{' + 'providerId' + '}', providerId.toString()); + .replaceAll('{homeId}', homeId) + .replaceAll('{providerId}', providerId); - 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, ); } @@ -685,20 +532,22 @@ class DeviceApi { /// /// * [String] providerId (required): /// Id of Provider - Future> deviceGetDevicesFromProvider(String homeId, String providerId) async { - final response = await deviceGetDevicesFromProviderWithHttpInfo(homeId, providerId); + Future?> deviceGetDevicesFromProvider(String homeId, String providerId,) async { + final response = await deviceGetDevicesFromProviderWithHttpInfo(homeId, providerId,); 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; } /// Get all zigbee2Mqtt devices @@ -709,46 +558,29 @@ class DeviceApi { /// /// * [String] homeId (required): /// Home Id - Future deviceGetDevicesFromZigbee2MqttWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future deviceGetDevicesFromZigbee2MqttWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/zigbee2Mqtt/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -758,20 +590,22 @@ class DeviceApi { /// /// * [String] homeId (required): /// Home Id - Future> deviceGetDevicesFromZigbee2Mqtt(String homeId) async { - final response = await deviceGetDevicesFromZigbee2MqttWithHttpInfo(homeId); + Future?> deviceGetDevicesFromZigbee2Mqtt(String homeId,) async { + final response = await deviceGetDevicesFromZigbee2MqttWithHttpInfo(homeId,); 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; } /// Send action to device @@ -782,45 +616,28 @@ class DeviceApi { /// /// * [Action] action (required): /// Action to sent - Future deviceSendActionWithHttpInfo(Action action) async { - // Verify required params are set. - if (action == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: action'); - } - + Future deviceSendActionWithHttpInfo(Action action,) async { + // ignore: prefer_const_declarations final path = r'/api/device/action'; - Object postBody = action; + // ignore: prefer_final_locals + Object? postBody = action; 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, ); } @@ -830,18 +647,19 @@ class DeviceApi { /// /// * [Action] action (required): /// Action to sent - Future deviceSendAction(Action action) async { - final response = await deviceSendActionWithHttpInfo(action); + Future deviceSendAction(Action action,) async { + final response = await deviceSendActionWithHttpInfo(action,); 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; } /// Update a device @@ -854,49 +672,29 @@ class DeviceApi { /// /// * [DeviceDetailDTO] deviceDetailDTO (required): /// Device to update - Future deviceUpdateWithHttpInfo(String deviceId, DeviceDetailDTO deviceDetailDTO) async { - // Verify required params are set. - if (deviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); - } - if (deviceDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); - } - + Future deviceUpdateWithHttpInfo(String deviceId, DeviceDetailDTO deviceDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/device/{deviceId}' - .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + .replaceAll('{deviceId}', deviceId); - 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, ); } @@ -908,17 +706,18 @@ class DeviceApi { /// /// * [DeviceDetailDTO] deviceDetailDTO (required): /// Device to update - Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO) async { - final response = await deviceUpdateWithHttpInfo(deviceId, deviceDetailDTO); + Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO,) async { + final response = await deviceUpdateWithHttpInfo(deviceId, 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; } } diff --git a/mycore_api/lib/api/energy_api.dart b/mycore_api/lib/api/energy_api.dart index 431e6d2..0410de7 100644 --- a/mycore_api/lib/api/energy_api.dart +++ b/mycore_api/lib/api/energy_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 EnergyApi { - EnergyApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + EnergyApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -24,49 +25,35 @@ class EnergyApi { /// * [String] homeId: /// /// * [ViewBy] viewBy: - Future energyGetElectricityProductionWithHttpInfo({ String homeId, ViewBy viewBy }) async { - // Verify required params are set. - + Future energyGetElectricityProductionWithHttpInfo({ String? homeId, ViewBy? viewBy, }) async { + // ignore: prefer_const_declarations final path = r'/api/energy/electricity'; - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; if (homeId != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'homeId', homeId)); + queryParams.addAll(_queryParams('', 'homeId', homeId)); } if (viewBy != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'viewBy', viewBy)); + queryParams.addAll(_queryParams('', 'viewBy', viewBy)); } - 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, ); } @@ -77,19 +64,21 @@ class EnergyApi { /// * [String] homeId: /// /// * [ViewBy] viewBy: - Future> energyGetElectricityProduction({ String homeId, ViewBy viewBy }) async { - final response = await energyGetElectricityProductionWithHttpInfo( homeId: homeId, viewBy: viewBy ); + Future?> energyGetElectricityProduction({ String? homeId, ViewBy? viewBy, }) async { + final response = await energyGetElectricityProductionWithHttpInfo( homeId: homeId, viewBy: viewBy, ); 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; } } diff --git a/mycore_api/lib/api/event_api.dart b/mycore_api/lib/api/event_api.dart index 236c4d1..20c7a26 100644 --- a/mycore_api/lib/api/event_api.dart +++ b/mycore_api/lib/api/event_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 EventApi { - EventApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + EventApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,46 +24,29 @@ class EventApi { /// /// * [String] eventId (required): /// Id of event to delete - Future eventDeleteWithHttpInfo(String eventId) async { - // Verify required params are set. - if (eventId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: eventId'); - } - + Future eventDeleteWithHttpInfo(String eventId,) async { + // ignore: prefer_const_declarations final path = r'/api/event/{eventId}' - .replaceAll('{' + 'eventId' + '}', eventId.toString()); + .replaceAll('{eventId}', eventId); - 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, ); } @@ -72,18 +56,19 @@ class EventApi { /// /// * [String] eventId (required): /// Id of event to delete - Future eventDelete(String eventId) async { - final response = await eventDeleteWithHttpInfo(eventId); + Future eventDelete(String eventId,) async { + final response = await eventDeleteWithHttpInfo(eventId,); 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; } /// Delete all events for a specified home @@ -94,46 +79,29 @@ class EventApi { /// /// * [String] homeId (required): /// Home Id - Future eventDeleteAllForHomeWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future eventDeleteAllForHomeWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/event/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -143,18 +111,19 @@ class EventApi { /// /// * [String] homeId (required): /// Home Id - Future eventDeleteAllForHome(String homeId) async { - final response = await eventDeleteAllForHomeWithHttpInfo(homeId); + Future eventDeleteAllForHome(String homeId,) async { + final response = await eventDeleteAllForHomeWithHttpInfo(homeId,); 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; } /// Get events for the specified home @@ -178,74 +147,57 @@ class EventApi { /// /// * [DateTime] dateEnd: /// - /// * [OneOfEventType] eventType: + /// * [EventGetEventTypeParameter] eventType: /// - /// * [OneOfDeviceType] deviceType: - Future eventGetWithHttpInfo(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventType eventType, DeviceType deviceType }) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + /// * [EventGetDeviceTypeParameter] deviceType: + Future eventGetWithHttpInfo(String homeId, { String? deviceId, String? roomId, int? startIndex, int? count, DateTime? dateStart, DateTime? dateEnd, EventType? eventType, DeviceType? deviceType, }) async { + // ignore: prefer_const_declarations final path = r'/api/event/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; if (deviceId != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'DeviceId', deviceId)); + queryParams.addAll(_queryParams('', 'DeviceId', deviceId)); } if (roomId != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'RoomId', roomId)); + queryParams.addAll(_queryParams('', 'RoomId', roomId)); } if (startIndex != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'StartIndex', startIndex)); + queryParams.addAll(_queryParams('', 'StartIndex', startIndex)); } if (count != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'Count', count)); + queryParams.addAll(_queryParams('', 'Count', count)); } if (dateStart != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'DateStart', dateStart)); + queryParams.addAll(_queryParams('', 'DateStart', dateStart)); } if (dateEnd != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'DateEnd', dateEnd)); + queryParams.addAll(_queryParams('', 'DateEnd', dateEnd)); } if (eventType != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'EventType', eventType)); + queryParams.addAll(_queryParams('', 'EventType', eventType)); } if (deviceType != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'DeviceType', deviceType)); + queryParams.addAll(_queryParams('', 'DeviceType', deviceType)); } - 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, ); } @@ -268,21 +220,22 @@ class EventApi { /// /// * [DateTime] dateEnd: /// - /// * [OneOfEventType] eventType: + /// * [EventGetEventTypeParameter] eventType: /// - /// * [OneOfDeviceType] deviceType: - Future eventGet(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventType eventType, DeviceType deviceType }) async { - final response = await eventGetWithHttpInfo(homeId, deviceId: deviceId, roomId: roomId, startIndex: startIndex, count: count, dateStart: dateStart, dateEnd: dateEnd, eventType: eventType, deviceType: deviceType ); + /// * [EventGetDeviceTypeParameter] deviceType: + Future eventGet(String homeId, { String? deviceId, String? roomId, int? startIndex, int? count, DateTime? dateStart, DateTime? dateEnd, EventType? eventType,DeviceType? deviceType, }) async { + final response = await eventGetWithHttpInfo(homeId, deviceId: deviceId, roomId: roomId, startIndex: startIndex, count: count, dateStart: dateStart, dateEnd: dateEnd, eventType: eventType, deviceType: deviceType, ); 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), 'ListResponseOfEventDetailDTOAndEventHomeFilter') as ListResponseOfEventDetailDTOAndEventHomeFilter; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ListResponseOfEventDetailDTOAndEventHomeFilter',) as ListResponseOfEventDetailDTOAndEventHomeFilter; + + } + return null; } /// Get detail info of a specified event @@ -293,46 +246,29 @@ class EventApi { /// /// * [String] eventId (required): /// event id - Future eventGetDetailWithHttpInfo(String eventId) async { - // Verify required params are set. - if (eventId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: eventId'); - } - + Future eventGetDetailWithHttpInfo(String eventId,) async { + // ignore: prefer_const_declarations final path = r'/api/event/detail/{eventId}' - .replaceAll('{' + 'eventId' + '}', eventId.toString()); + .replaceAll('{eventId}', eventId); - 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, ); } @@ -342,17 +278,18 @@ class EventApi { /// /// * [String] eventId (required): /// event id - Future eventGetDetail(String eventId) async { - final response = await eventGetDetailWithHttpInfo(eventId); + Future eventGetDetail(String eventId,) async { + final response = await eventGetDetailWithHttpInfo(eventId,); 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), 'EventDetailDTO') as EventDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'EventDetailDTO',) as EventDetailDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/facebook_api.dart b/mycore_api/lib/api/facebook_api.dart index d98657b..38314ab 100644 --- a/mycore_api/lib/api/facebook_api.dart +++ b/mycore_api/lib/api/facebook_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 FacebookApi { - FacebookApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + FacebookApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,62 +20,46 @@ class FacebookApi { /// Parameters: /// /// * [FacebookAuthModel] facebookAuthModel (required): - Future facebookCreateWithHttpInfo(FacebookAuthModel facebookAuthModel) async { - // Verify required params are set. - if (facebookAuthModel == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: facebookAuthModel'); - } - + Future facebookCreateWithHttpInfo(FacebookAuthModel facebookAuthModel,) async { + // ignore: prefer_const_declarations final path = r'/facebook'; - Object postBody = facebookAuthModel; + // ignore: prefer_final_locals + Object? postBody = facebookAuthModel; 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: /// /// * [FacebookAuthModel] facebookAuthModel (required): - Future facebookCreate(FacebookAuthModel facebookAuthModel) async { - final response = await facebookCreateWithHttpInfo(facebookAuthModel); + Future facebookCreate(FacebookAuthModel facebookAuthModel,) async { + final response = await facebookCreateWithHttpInfo(facebookAuthModel,); 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; } } diff --git a/mycore_api/lib/api/google_api.dart b/mycore_api/lib/api/google_api.dart index 64faecc..ecb42db 100644 --- a/mycore_api/lib/api/google_api.dart +++ b/mycore_api/lib/api/google_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 GoogleApi { - GoogleApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + GoogleApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,62 +20,46 @@ class GoogleApi { /// Parameters: /// /// * [GoogleAuthModel] googleAuthModel (required): - Future googleCreateWithHttpInfo(GoogleAuthModel googleAuthModel) async { - // Verify required params are set. - if (googleAuthModel == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: googleAuthModel'); - } - + Future googleCreateWithHttpInfo(GoogleAuthModel googleAuthModel,) async { + // ignore: prefer_const_declarations final path = r'/google'; - Object postBody = googleAuthModel; + // ignore: prefer_final_locals + Object? postBody = googleAuthModel; 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: /// /// * [GoogleAuthModel] googleAuthModel (required): - Future googleCreate(GoogleAuthModel googleAuthModel) async { - final response = await googleCreateWithHttpInfo(googleAuthModel); + Future googleCreate(GoogleAuthModel googleAuthModel,) async { + final response = await googleCreateWithHttpInfo(googleAuthModel,); 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; } } diff --git a/mycore_api/lib/api/group_api.dart b/mycore_api/lib/api/group_api.dart index 020e8f1..3c0e488 100644 --- a/mycore_api/lib/api/group_api.dart +++ b/mycore_api/lib/api/group_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 GroupApi { - GroupApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + GroupApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class GroupApi { /// /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): /// Group to create - Future groupCreateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { - // Verify required params are set. - if (groupCreateOrUpdateDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: groupCreateOrUpdateDetailDTO'); - } - + Future groupCreateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/group'; - Object postBody = groupCreateOrUpdateDetailDTO; + // ignore: prefer_final_locals + Object? postBody = groupCreateOrUpdateDetailDTO; 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, ); } @@ -71,18 +55,19 @@ class GroupApi { /// /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): /// Group to create - Future groupCreate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { - final response = await groupCreateWithHttpInfo(groupCreateOrUpdateDetailDTO); + Future groupCreate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO,) async { + final response = await groupCreateWithHttpInfo(groupCreateOrUpdateDetailDTO,); 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), 'GroupDetailDTO') as GroupDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GroupDetailDTO',) as GroupDetailDTO; + + } + return null; } /// Create groups from provider @@ -93,46 +78,29 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future groupCreateDevicesFromZigbee2MqttWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future groupCreateDevicesFromZigbee2MqttWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/{homeId}/fromZigbee' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, 'POST', queryParams, postBody, headerParams, formParams, - nullableContentType, - authNames, + contentTypes.isEmpty ? null : contentTypes.first, ); } @@ -142,20 +110,22 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future> groupCreateDevicesFromZigbee2Mqtt(String homeId) async { - final response = await groupCreateDevicesFromZigbee2MqttWithHttpInfo(homeId); + Future?> groupCreateDevicesFromZigbee2Mqtt(String homeId,) async { + final response = await groupCreateDevicesFromZigbee2MqttWithHttpInfo(homeId,); 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; } /// Delete device from a group @@ -169,50 +139,30 @@ class GroupApi { /// /// * [String] groupId (required): /// Id of group - Future groupDeleteWithHttpInfo(String deviceId, String groupId) async { - // Verify required params are set. - if (deviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); - } - if (groupId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); - } - + Future groupDeleteWithHttpInfo(String deviceId, String groupId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/{groupId}/device/{deviceId}' - .replaceAll('{' + 'deviceId' + '}', deviceId.toString()) - .replaceAll('{' + 'groupId' + '}', groupId.toString()); + .replaceAll('{deviceId}', deviceId) + .replaceAll('{groupId}', groupId); - 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, ); } @@ -225,18 +175,19 @@ class GroupApi { /// /// * [String] groupId (required): /// Id of group - Future groupDelete(String deviceId, String groupId) async { - final response = await groupDeleteWithHttpInfo(deviceId, groupId); + Future groupDelete(String deviceId, String groupId,) async { + final response = await groupDeleteWithHttpInfo(deviceId, groupId,); 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; } /// Delete a group @@ -247,46 +198,29 @@ class GroupApi { /// /// * [String] groupId (required): /// Id of group - Future groupDelete2WithHttpInfo(String groupId) async { - // Verify required params are set. - if (groupId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); - } - + Future groupDelete2WithHttpInfo(String groupId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/{groupId}' - .replaceAll('{' + 'groupId' + '}', groupId.toString()); + .replaceAll('{groupId}', groupId); - 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, ); } @@ -296,18 +230,19 @@ class GroupApi { /// /// * [String] groupId (required): /// Id of group - Future groupDelete2(String groupId) async { - final response = await groupDelete2WithHttpInfo(groupId); + Future groupDelete2(String groupId,) async { + final response = await groupDelete2WithHttpInfo(groupId,); 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; } /// Delete all group for a specified home @@ -318,46 +253,29 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future groupDeleteAllForHomeWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future groupDeleteAllForHomeWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -367,18 +285,19 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future groupDeleteAllForHome(String homeId) async { - final response = await groupDeleteAllForHomeWithHttpInfo(homeId); + Future groupDeleteAllForHome(String homeId,) async { + final response = await groupDeleteAllForHomeWithHttpInfo(homeId,); 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; } /// Get all groups for the specified home @@ -389,46 +308,29 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future groupGetAllWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future groupGetAllWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -438,20 +340,22 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future> groupGetAll(String homeId) async { - final response = await groupGetAllWithHttpInfo(homeId); + Future?> groupGetAll(String homeId,) async { + final response = await groupGetAllWithHttpInfo(homeId,); 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; } /// Get detail info of a specified group @@ -462,46 +366,29 @@ class GroupApi { /// /// * [String] groupId (required): /// groupid - Future groupGetDetailWithHttpInfo(String groupId) async { - // Verify required params are set. - if (groupId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); - } - + Future groupGetDetailWithHttpInfo(String groupId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/detail/{groupId}' - .replaceAll('{' + 'groupId' + '}', groupId.toString()); + .replaceAll('{groupId}', groupId); - 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, ); } @@ -511,18 +398,19 @@ class GroupApi { /// /// * [String] groupId (required): /// groupid - Future groupGetDetail(String groupId) async { - final response = await groupGetDetailWithHttpInfo(groupId); + Future groupGetDetail(String groupId,) async { + final response = await groupGetDetailWithHttpInfo(groupId,); 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), 'GroupDetailDTO') as GroupDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GroupDetailDTO',) as GroupDetailDTO; + + } + return null; } /// Get list of group from a type @@ -536,50 +424,30 @@ class GroupApi { /// /// * [String] type (required): /// group type - Future groupGetGroupsByTypeWithHttpInfo(String homeId, String type) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - if (type == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: type'); - } - + Future groupGetGroupsByTypeWithHttpInfo(String homeId, String type,) async { + // ignore: prefer_const_declarations final path = r'/api/group/{homeId}/type/{type}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()) - .replaceAll('{' + 'type' + '}', type.toString()); + .replaceAll('{homeId}', homeId) + .replaceAll('{type}', type); - 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, ); } @@ -592,20 +460,22 @@ class GroupApi { /// /// * [String] type (required): /// group type - Future> groupGetGroupsByType(String homeId, String type) async { - final response = await groupGetGroupsByTypeWithHttpInfo(homeId, type); + Future?> groupGetGroupsByType(String homeId, String type,) async { + final response = await groupGetGroupsByTypeWithHttpInfo(homeId, type,); 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; } /// Get all zigbee2Mqtt groups @@ -616,46 +486,29 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future groupGetGroupsFromZigbee2MqttWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future groupGetGroupsFromZigbee2MqttWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/group/zigbee2Mqtt/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -665,20 +518,22 @@ class GroupApi { /// /// * [String] homeId (required): /// Home Id - Future> groupGetGroupsFromZigbee2Mqtt(String homeId) async { - final response = await groupGetGroupsFromZigbee2MqttWithHttpInfo(homeId); + Future?> groupGetGroupsFromZigbee2Mqtt(String homeId,) async { + final response = await groupGetGroupsFromZigbee2MqttWithHttpInfo(homeId,); 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; } /// Update a group @@ -689,45 +544,28 @@ class GroupApi { /// /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): /// group to update - Future groupUpdateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { - // Verify required params are set. - if (groupCreateOrUpdateDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: groupCreateOrUpdateDetailDTO'); - } - + Future groupUpdateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/group'; - Object postBody = groupCreateOrUpdateDetailDTO; + // ignore: prefer_final_locals + Object? postBody = groupCreateOrUpdateDetailDTO; 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, ); } @@ -737,17 +575,18 @@ class GroupApi { /// /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): /// group to update - Future groupUpdate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { - final response = await groupUpdateWithHttpInfo(groupCreateOrUpdateDetailDTO); + Future groupUpdate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO,) async { + final response = await groupUpdateWithHttpInfo(groupCreateOrUpdateDetailDTO,); 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), 'GroupCreateOrUpdateDetailDTO') as GroupCreateOrUpdateDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GroupCreateOrUpdateDetailDTO',) as GroupCreateOrUpdateDetailDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/home_api.dart b/mycore_api/lib/api/home_api.dart index 64dbdd8..c19ac58 100644 --- a/mycore_api/lib/api/home_api.dart +++ b/mycore_api/lib/api/home_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 HomeApi { - HomeApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + HomeApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class HomeApi { /// /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): /// Home to create - Future homeCreateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { - // Verify required params are set. - if (createOrUpdateHomeDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: createOrUpdateHomeDTO'); - } - + Future homeCreateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/home'; - Object postBody = createOrUpdateHomeDTO; + // ignore: prefer_final_locals + Object? postBody = createOrUpdateHomeDTO; 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, ); } @@ -71,18 +55,19 @@ class HomeApi { /// /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): /// Home to create - Future homeCreate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { - final response = await homeCreateWithHttpInfo(createOrUpdateHomeDTO); + Future homeCreate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO,) async { + final response = await homeCreateWithHttpInfo(createOrUpdateHomeDTO,); 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), 'HomeDTO') as HomeDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'HomeDTO',) as HomeDTO; + + } + return null; } /// Delete a home @@ -93,46 +78,29 @@ class HomeApi { /// /// * [String] homeId (required): /// Id of home to delete - Future homeDeleteWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future homeDeleteWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -142,18 +110,19 @@ class HomeApi { /// /// * [String] homeId (required): /// Id of home to delete - Future homeDelete(String homeId) async { - final response = await homeDeleteWithHttpInfo(homeId); + Future homeDelete(String homeId,) async { + final response = await homeDeleteWithHttpInfo(homeId,); 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; } /// Get all home for specified user @@ -164,46 +133,29 @@ class HomeApi { /// /// * [String] userId (required): /// User Id - Future homeGetAllWithHttpInfo(String userId) async { - // Verify required params are set. - if (userId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); - } - + Future homeGetAllWithHttpInfo(String userId,) async { + // ignore: prefer_const_declarations final path = r'/api/home/{userId}' - .replaceAll('{' + 'userId' + '}', userId.toString()); + .replaceAll('{userId}', userId); - 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, ); } @@ -213,20 +165,22 @@ class HomeApi { /// /// * [String] userId (required): /// User Id - Future> homeGetAll(String userId) async { - final response = await homeGetAllWithHttpInfo(userId); + Future?> homeGetAll(String userId,) async { + final response = await homeGetAllWithHttpInfo(userId,); 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; } /// Get detail info of a specified home @@ -237,46 +191,29 @@ class HomeApi { /// /// * [String] homeId (required): /// home id - Future homeGetDetailWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future homeGetDetailWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/home/detail/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -286,18 +223,19 @@ class HomeApi { /// /// * [String] homeId (required): /// home id - Future homeGetDetail(String homeId) async { - final response = await homeGetDetailWithHttpInfo(homeId); + Future homeGetDetail(String homeId,) async { + final response = await homeGetDetailWithHttpInfo(homeId,); 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), 'HomeDetailDTO') as HomeDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'HomeDetailDTO',) as HomeDetailDTO; + + } + return null; } /// Update a home @@ -308,45 +246,28 @@ class HomeApi { /// /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): /// Home to update - Future homeUpdateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { - // Verify required params are set. - if (createOrUpdateHomeDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: createOrUpdateHomeDTO'); - } - + Future homeUpdateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/home'; - Object postBody = createOrUpdateHomeDTO; + // ignore: prefer_final_locals + Object? postBody = createOrUpdateHomeDTO; 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, ); } @@ -356,17 +277,18 @@ class HomeApi { /// /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): /// Home to update - Future homeUpdate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { - final response = await homeUpdateWithHttpInfo(createOrUpdateHomeDTO); + Future homeUpdate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO,) async { + final response = await homeUpdateWithHttpInfo(createOrUpdateHomeDTO,); 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), 'HomeDTO') as HomeDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'HomeDTO',) as HomeDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/iot_api.dart b/mycore_api/lib/api/iot_api.dart index 33bb0f4..26d3543 100644 --- a/mycore_api/lib/api/iot_api.dart +++ b/mycore_api/lib/api/iot_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 IOTApi { - IOTApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + IOTApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -25,50 +26,33 @@ class IOTApi { /// /// * [int] id: /// Id of the smart printer message - Future iOTGetSmartPrinterMessagesWithHttpInfo(String idDevice, { int id }) async { - // Verify required params are set. - if (idDevice == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); - } - + Future iOTGetSmartPrinterMessagesWithHttpInfo(String idDevice, { int? id, }) async { + // ignore: prefer_const_declarations final path = r'/api/iot/smartprinter/{idDevice}' - .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + .replaceAll('{idDevice}', idDevice); - Object postBody; + // ignore: prefer_final_locals + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; if (id != null) { - queryParams.addAll(_convertParametersForCollectionFormat('', 'id', id)); + queryParams.addAll(_queryParams('', 'id', id)); } - 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, ); } @@ -80,20 +64,22 @@ class IOTApi { /// /// * [int] id: /// Id of the smart printer message - Future> iOTGetSmartPrinterMessages(String idDevice, { int id }) async { - final response = await iOTGetSmartPrinterMessagesWithHttpInfo(idDevice, id: id ); + Future?> iOTGetSmartPrinterMessages(String idDevice, { int? id, }) async { + final response = await iOTGetSmartPrinterMessagesWithHttpInfo(idDevice, id: 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; } /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) @@ -107,49 +93,29 @@ class IOTApi { /// /// * [List] smartPrinterMessage (required): /// Content that will be uploaded - Future iOTPostToDBPrinterWithHttpInfo(int idDevice, List smartPrinterMessage) async { - // Verify required params are set. - if (idDevice == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); - } - if (smartPrinterMessage == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: smartPrinterMessage'); - } - + Future iOTPostToDBPrinterWithHttpInfo(int idDevice, List smartPrinterMessage,) async { + // ignore: prefer_const_declarations final path = r'/api/iot/smartprinter/{idDevice}' - .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + .replaceAll('{idDevice}', idDevice.toString()); - Object postBody = smartPrinterMessage; + // ignore: prefer_final_locals + Object? postBody = smartPrinterMessage; 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, ); } @@ -162,18 +128,19 @@ class IOTApi { /// /// * [List] smartPrinterMessage (required): /// Content that will be uploaded - Future iOTPostToDBPrinter(int idDevice, List smartPrinterMessage) async { - final response = await iOTPostToDBPrinterWithHttpInfo(idDevice, smartPrinterMessage); + Future iOTPostToDBPrinter(int idDevice, List smartPrinterMessage,) async { + final response = await iOTPostToDBPrinterWithHttpInfo(idDevice, smartPrinterMessage,); 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; } /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) @@ -185,49 +152,29 @@ class IOTApi { /// * [int] idDevice (required): /// /// * [List] smartGardenMessage (required): - Future iOTPostToDBSmartGardenWithHttpInfo(int idDevice, List smartGardenMessage) async { - // Verify required params are set. - if (idDevice == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); - } - if (smartGardenMessage == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: smartGardenMessage'); - } - + Future iOTPostToDBSmartGardenWithHttpInfo(int idDevice, List smartGardenMessage,) async { + // ignore: prefer_const_declarations final path = r'/api/iot/smartgarden/{idDevice}' - .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + .replaceAll('{idDevice}', idDevice.toString()); - Object postBody = smartGardenMessage; + // ignore: prefer_final_locals + Object? postBody = smartGardenMessage; 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, ); } @@ -238,17 +185,18 @@ class IOTApi { /// * [int] idDevice (required): /// /// * [List] smartGardenMessage (required): - Future iOTPostToDBSmartGarden(int idDevice, List smartGardenMessage) async { - final response = await iOTPostToDBSmartGardenWithHttpInfo(idDevice, smartGardenMessage); + Future iOTPostToDBSmartGarden(int idDevice, List smartGardenMessage,) async { + final response = await iOTPostToDBSmartGardenWithHttpInfo(idDevice, smartGardenMessage,); 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; } } diff --git a/mycore_api/lib/api/layout_api.dart b/mycore_api/lib/api/layout_api.dart index c433978..41acffd 100644 --- a/mycore_api/lib/api/layout_api.dart +++ b/mycore_api/lib/api/layout_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 LayoutApi { - LayoutApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + LayoutApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,56 +20,46 @@ class LayoutApi { /// /// Note: This method returns the HTTP [Response]. Future layoutGetWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/layout/panelSection'; - 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, ); } /// It's a test ! :) - Future> layoutGet() async { + Future?> layoutGet() async { final response = await layoutGetWithHttpInfo(); 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; } } diff --git a/mycore_api/lib/api/mqtt_api.dart b/mycore_api/lib/api/mqtt_api.dart index 4b360bf..6dd3b8f 100644 --- a/mycore_api/lib/api/mqtt_api.dart +++ b/mycore_api/lib/api/mqtt_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 MQTTApi { - MQTTApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + MQTTApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class MQTTApi { /// /// * [MqttMessageDTO] mqttMessageDTO (required): /// Message to send - Future mQTTPublishMessageWithHttpInfo(MqttMessageDTO mqttMessageDTO) async { - // Verify required params are set. - if (mqttMessageDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: mqttMessageDTO'); - } - + Future mQTTPublishMessageWithHttpInfo(MqttMessageDTO mqttMessageDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/mqtt'; - Object postBody = mqttMessageDTO; + // ignore: prefer_final_locals + Object? postBody = mqttMessageDTO; 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, ); } @@ -71,17 +55,18 @@ class MQTTApi { /// /// * [MqttMessageDTO] mqttMessageDTO (required): /// Message to send - Future mQTTPublishMessage(MqttMessageDTO mqttMessageDTO) async { - final response = await mQTTPublishMessageWithHttpInfo(mqttMessageDTO); + Future mQTTPublishMessage(MqttMessageDTO mqttMessageDTO,) async { + final response = await mQTTPublishMessageWithHttpInfo(mqttMessageDTO,); 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), 'bool') as bool; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'bool',) as bool; + + } + return null; } } diff --git a/mycore_api/lib/api/odd_api.dart b/mycore_api/lib/api/odd_api.dart index cfde296..fee2faf 100644 --- a/mycore_api/lib/api/odd_api.dart +++ b/mycore_api/lib/api/odd_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 OddApi { - OddApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + OddApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,46 +24,29 @@ class OddApi { /// /// * [double] oddRequest (required): /// Odd Maximum value - Future oddGetAllWithHttpInfo(double oddRequest) async { - // Verify required params are set. - if (oddRequest == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: oddRequest'); - } - + Future oddGetAllWithHttpInfo(double oddRequest,) async { + // ignore: prefer_const_declarations final path = r'/api/odd/{oddRequest}' - .replaceAll('{' + 'oddRequest' + '}', oddRequest.toString()); + .replaceAll('{oddRequest}', oddRequest.toString()); - 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, ); } @@ -72,20 +56,22 @@ class OddApi { /// /// * [double] oddRequest (required): /// Odd Maximum value - Future> oddGetAll(double oddRequest) async { - final response = await oddGetAllWithHttpInfo(oddRequest); + Future?> oddGetAll(double oddRequest,) async { + final response = await oddGetAllWithHttpInfo(oddRequest,); 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; } /// Get odds for one country and one odd value maximum @@ -99,50 +85,30 @@ class OddApi { /// /// * [double] oddRequest (required): /// Odd Maximum value - Future oddGetForCountryWithHttpInfo(String id, double oddRequest) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - if (oddRequest == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: oddRequest'); - } - + Future oddGetForCountryWithHttpInfo(String id, double oddRequest,) async { + // ignore: prefer_const_declarations final path = r'/api/odd/country/{id}/{oddRequest}' - .replaceAll('{' + 'id' + '}', id.toString()) - .replaceAll('{' + 'oddRequest' + '}', oddRequest.toString()); + .replaceAll('{id}', id) + .replaceAll('{oddRequest}', oddRequest.toString()); - 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, ); } @@ -155,19 +121,21 @@ class OddApi { /// /// * [double] oddRequest (required): /// Odd Maximum value - Future> oddGetForCountry(String id, double oddRequest) async { - final response = await oddGetForCountryWithHttpInfo(id, oddRequest); + Future?> oddGetForCountry(String id, double oddRequest,) async { + final response = await oddGetForCountryWithHttpInfo(id, oddRequest,); 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; } } diff --git a/mycore_api/lib/api/provider_api.dart b/mycore_api/lib/api/provider_api.dart index 03bfdde..4b20829 100644 --- a/mycore_api/lib/api/provider_api.dart +++ b/mycore_api/lib/api/provider_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 ProviderApi { - ProviderApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + ProviderApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class ProviderApi { /// /// * [ProviderDTO] providerDTO (required): /// Provider to create - Future providerCreateWithHttpInfo(ProviderDTO providerDTO) async { - // Verify required params are set. - if (providerDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: providerDTO'); - } - + Future providerCreateWithHttpInfo(ProviderDTO providerDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/provider'; - Object postBody = providerDTO; + // ignore: prefer_final_locals + Object? postBody = providerDTO; 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, ); } @@ -71,18 +55,19 @@ class ProviderApi { /// /// * [ProviderDTO] providerDTO (required): /// Provider to create - Future providerCreate(ProviderDTO providerDTO) async { - final response = await providerCreateWithHttpInfo(providerDTO); + Future providerCreate(ProviderDTO providerDTO,) async { + final response = await providerCreateWithHttpInfo(providerDTO,); 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), 'ProviderDTO') as ProviderDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ProviderDTO',) as ProviderDTO; + + } + return null; } /// Delete a provider @@ -93,46 +78,29 @@ class ProviderApi { /// /// * [String] providerId (required): /// Id of provider to delete - Future providerDeleteWithHttpInfo(String providerId) async { - // Verify required params are set. - if (providerId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); - } - + Future providerDeleteWithHttpInfo(String providerId,) async { + // ignore: prefer_const_declarations final path = r'/api/provider/{providerId}' - .replaceAll('{' + 'providerId' + '}', providerId.toString()); + .replaceAll('{providerId}', providerId); - 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, ); } @@ -142,18 +110,19 @@ class ProviderApi { /// /// * [String] providerId (required): /// Id of provider to delete - Future providerDelete(String providerId) async { - final response = await providerDeleteWithHttpInfo(providerId); + Future providerDelete(String providerId,) async { + final response = await providerDeleteWithHttpInfo(providerId,); 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; } /// Get all home providers @@ -164,46 +133,29 @@ class ProviderApi { /// /// * [String] homeId (required): /// Home Id - Future providerGetAllWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future providerGetAllWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/provider/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -213,20 +165,22 @@ class ProviderApi { /// /// * [String] homeId (required): /// Home Id - Future> providerGetAll(String homeId) async { - final response = await providerGetAllWithHttpInfo(homeId); + Future?> providerGetAll(String homeId,) async { + final response = await providerGetAllWithHttpInfo(homeId,); 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; } /// Update a provider @@ -237,45 +191,28 @@ class ProviderApi { /// /// * [ProviderDTO] providerDTO (required): /// Provider to update - Future providerUpdateWithHttpInfo(ProviderDTO providerDTO) async { - // Verify required params are set. - if (providerDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: providerDTO'); - } - + Future providerUpdateWithHttpInfo(ProviderDTO providerDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/provider'; - Object postBody = providerDTO; + // ignore: prefer_final_locals + Object? postBody = providerDTO; 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, ); } @@ -285,17 +222,18 @@ class ProviderApi { /// /// * [ProviderDTO] providerDTO (required): /// Provider to update - Future providerUpdate(ProviderDTO providerDTO) async { - final response = await providerUpdateWithHttpInfo(providerDTO); + Future providerUpdate(ProviderDTO providerDTO,) async { + final response = await providerUpdateWithHttpInfo(providerDTO,); 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; } } diff --git a/mycore_api/lib/api/room_api.dart b/mycore_api/lib/api/room_api.dart index db5c5a2..06f6455 100644 --- a/mycore_api/lib/api/room_api.dart +++ b/mycore_api/lib/api/room_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 RoomApi { - RoomApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + RoomApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -26,49 +27,29 @@ class RoomApi { /// /// * [List] requestBody (required): /// Device Ids - Future roomAddDeviceToRoomWithHttpInfo(String roomId, List requestBody) async { - // Verify required params are set. - if (roomId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); - } - if (requestBody == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: requestBody'); - } - + Future roomAddDeviceToRoomWithHttpInfo(String roomId, List requestBody,) async { + // ignore: prefer_const_declarations final path = r'/api/room/{roomId}' - .replaceAll('{' + 'roomId' + '}', roomId.toString()); + .replaceAll('{roomId}', roomId); - Object postBody = requestBody; + // ignore: prefer_final_locals + Object? postBody = requestBody; 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, ); } @@ -81,18 +62,19 @@ class RoomApi { /// /// * [List] requestBody (required): /// Device Ids - Future roomAddDeviceToRoom(String roomId, List requestBody) async { - final response = await roomAddDeviceToRoomWithHttpInfo(roomId, requestBody); + Future roomAddDeviceToRoom(String roomId, List requestBody,) async { + final response = await roomAddDeviceToRoomWithHttpInfo(roomId, requestBody,); 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), 'RoomDetailDTO') as RoomDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RoomDetailDTO',) as RoomDetailDTO; + + } + return null; } /// Create a room @@ -103,45 +85,28 @@ class RoomApi { /// /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): /// Room to create - Future roomCreateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { - // Verify required params are set. - if (roomCreateOrUpdateDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: roomCreateOrUpdateDetailDTO'); - } - + Future roomCreateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/room'; - Object postBody = roomCreateOrUpdateDetailDTO; + // ignore: prefer_final_locals + Object? postBody = roomCreateOrUpdateDetailDTO; 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, ); } @@ -151,18 +116,19 @@ class RoomApi { /// /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): /// Room to create - Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { - final response = await roomCreateWithHttpInfo(roomCreateOrUpdateDetailDTO); + Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO,) async { + final response = await roomCreateWithHttpInfo(roomCreateOrUpdateDetailDTO,); 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), 'RoomDetailDTO') as RoomDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RoomDetailDTO',) as RoomDetailDTO; + + } + return null; } /// Delete a room @@ -173,46 +139,29 @@ class RoomApi { /// /// * [String] roomId (required): /// Id of room - Future roomDeleteWithHttpInfo(String roomId) async { - // Verify required params are set. - if (roomId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); - } - + Future roomDeleteWithHttpInfo(String roomId,) async { + // ignore: prefer_const_declarations final path = r'/api/room/{roomId}' - .replaceAll('{' + 'roomId' + '}', roomId.toString()); + .replaceAll('{roomId}', roomId); - 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, ); } @@ -222,18 +171,19 @@ class RoomApi { /// /// * [String] roomId (required): /// Id of room - Future roomDelete(String roomId) async { - final response = await roomDeleteWithHttpInfo(roomId); + Future roomDelete(String roomId,) async { + final response = await roomDeleteWithHttpInfo(roomId,); 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; } /// Delete device from a room @@ -247,50 +197,30 @@ class RoomApi { /// /// * [String] roomId (required): /// Id of room - Future roomDelete2WithHttpInfo(String deviceId, String roomId) async { - // Verify required params are set. - if (deviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); - } - if (roomId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); - } - + Future roomDelete2WithHttpInfo(String deviceId, String roomId,) async { + // ignore: prefer_const_declarations final path = r'/api/room/{roomId}/device/{deviceId}' - .replaceAll('{' + 'deviceId' + '}', deviceId.toString()) - .replaceAll('{' + 'roomId' + '}', roomId.toString()); + .replaceAll('{deviceId}', deviceId) + .replaceAll('{roomId}', roomId); - 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, ); } @@ -303,18 +233,19 @@ class RoomApi { /// /// * [String] roomId (required): /// Id of room - Future roomDelete2(String deviceId, String roomId) async { - final response = await roomDelete2WithHttpInfo(deviceId, roomId); + Future roomDelete2(String deviceId, String roomId,) async { + final response = await roomDelete2WithHttpInfo(deviceId, roomId,); 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; } /// Delete all rooms for a specified home @@ -325,46 +256,29 @@ class RoomApi { /// /// * [String] homeId (required): /// Home Id - Future roomDeleteAllForHomeWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future roomDeleteAllForHomeWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/room/home/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -374,18 +288,19 @@ class RoomApi { /// /// * [String] homeId (required): /// Home Id - Future roomDeleteAllForHome(String homeId) async { - final response = await roomDeleteAllForHomeWithHttpInfo(homeId); + Future roomDeleteAllForHome(String homeId,) async { + final response = await roomDeleteAllForHomeWithHttpInfo(homeId,); 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; } /// Get all rooms for the specified home @@ -396,46 +311,29 @@ class RoomApi { /// /// * [String] homeId (required): /// Home Id - Future roomGetAllWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future roomGetAllWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/room/{homeId}' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -445,20 +343,22 @@ class RoomApi { /// /// * [String] homeId (required): /// Home Id - Future> roomGetAll(String homeId) async { - final response = await roomGetAllWithHttpInfo(homeId); + Future?> roomGetAll(String homeId,) async { + final response = await roomGetAllWithHttpInfo(homeId,); 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; } /// Get all rooms main details for the specified home @@ -469,46 +369,29 @@ class RoomApi { /// /// * [String] homeId (required): /// Home Id - Future roomGetAllWithMainDetailsWithHttpInfo(String homeId) async { - // Verify required params are set. - if (homeId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); - } - + Future roomGetAllWithMainDetailsWithHttpInfo(String homeId,) async { + // ignore: prefer_const_declarations final path = r'/api/room/{homeId}/details' - .replaceAll('{' + 'homeId' + '}', homeId.toString()); + .replaceAll('{homeId}', homeId); - 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, ); } @@ -518,20 +401,22 @@ class RoomApi { /// /// * [String] homeId (required): /// Home Id - Future> roomGetAllWithMainDetails(String homeId) async { - final response = await roomGetAllWithMainDetailsWithHttpInfo(homeId); + Future?> roomGetAllWithMainDetails(String homeId,) async { + final response = await roomGetAllWithMainDetailsWithHttpInfo(homeId,); 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; } /// Get detail info of a specified room @@ -542,46 +427,29 @@ class RoomApi { /// /// * [String] roomId (required): /// room id - Future roomGetDetailWithHttpInfo(String roomId) async { - // Verify required params are set. - if (roomId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); - } - + Future roomGetDetailWithHttpInfo(String roomId,) async { + // ignore: prefer_const_declarations final path = r'/api/room/detail/{roomId}' - .replaceAll('{' + 'roomId' + '}', roomId.toString()); + .replaceAll('{roomId}', roomId); - 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, ); } @@ -591,18 +459,19 @@ class RoomApi { /// /// * [String] roomId (required): /// room id - Future roomGetDetail(String roomId) async { - final response = await roomGetDetailWithHttpInfo(roomId); + Future roomGetDetail(String roomId,) async { + final response = await roomGetDetailWithHttpInfo(roomId,); 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), 'RoomDetailDTO') as RoomDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RoomDetailDTO',) as RoomDetailDTO; + + } + return null; } /// Update a room @@ -613,45 +482,28 @@ class RoomApi { /// /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): /// room to update - Future roomUpdateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { - // Verify required params are set. - if (roomCreateOrUpdateDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: roomCreateOrUpdateDetailDTO'); - } - + Future roomUpdateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/room'; - Object postBody = roomCreateOrUpdateDetailDTO; + // ignore: prefer_final_locals + Object? postBody = roomCreateOrUpdateDetailDTO; 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, ); } @@ -661,17 +513,18 @@ class RoomApi { /// /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): /// room to update - Future roomUpdate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { - final response = await roomUpdateWithHttpInfo(roomCreateOrUpdateDetailDTO); + Future roomUpdate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO,) async { + final response = await roomUpdateWithHttpInfo(roomCreateOrUpdateDetailDTO,); 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), 'RoomCreateOrUpdateDetailDTO') as RoomCreateOrUpdateDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RoomCreateOrUpdateDetailDTO',) as RoomCreateOrUpdateDetailDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/screen_device_api.dart b/mycore_api/lib/api/screen_device_api.dart index 6def34f..ce404c5 100644 --- a/mycore_api/lib/api/screen_device_api.dart +++ b/mycore_api/lib/api/screen_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 ScreenDeviceApi { - ScreenDeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + ScreenDeviceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class ScreenDeviceApi { /// /// * [ScreenDevice] screenDevice (required): /// Screen device to create - Future screenDeviceCreateDeviceWithHttpInfo(ScreenDevice screenDevice) async { - // Verify required params are set. - if (screenDevice == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDevice'); - } - + Future screenDeviceCreateDeviceWithHttpInfo(ScreenDevice screenDevice,) async { + // ignore: prefer_const_declarations final path = r'/api/device/screen'; - Object postBody = screenDevice; + // ignore: prefer_final_locals + Object? postBody = screenDevice; 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, ); } @@ -71,18 +55,19 @@ class ScreenDeviceApi { /// /// * [ScreenDevice] screenDevice (required): /// Screen device to create - Future screenDeviceCreateDevice(ScreenDevice screenDevice) async { - final response = await screenDeviceCreateDeviceWithHttpInfo(screenDevice); + Future screenDeviceCreateDevice(ScreenDevice screenDevice,) async { + final response = await screenDeviceCreateDeviceWithHttpInfo(screenDevice,); 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), 'ScreenDevice') as ScreenDevice; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ScreenDevice',) as ScreenDevice; + + } + return null; } /// Delete device @@ -93,46 +78,29 @@ class ScreenDeviceApi { /// /// * [String] deviceId (required): /// Screen device id to update - Future screenDeviceDeleteDeviceWithHttpInfo(String deviceId) async { - // Verify required params are set. - if (deviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); - } - + Future screenDeviceDeleteDeviceWithHttpInfo(String deviceId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/screen/{deviceId}' - .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + .replaceAll('{deviceId}', deviceId); - 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, ); } @@ -142,75 +110,66 @@ class ScreenDeviceApi { /// /// * [String] deviceId (required): /// Screen device id to update - Future screenDeviceDeleteDevice(String deviceId) async { - final response = await screenDeviceDeleteDeviceWithHttpInfo(deviceId); + Future screenDeviceDeleteDevice(String deviceId,) async { + final response = await screenDeviceDeleteDeviceWithHttpInfo(deviceId,); 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; } /// Get all screen devices /// /// Note: This method returns the HTTP [Response]. Future screenDeviceGetAllScreenDevicesWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/device/screen'; - 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, ); } /// Get all screen devices - Future> screenDeviceGetAllScreenDevices() async { + Future?> screenDeviceGetAllScreenDevices() async { final response = await screenDeviceGetAllScreenDevicesWithHttpInfo(); 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; } /// Get screen device info @@ -221,46 +180,29 @@ class ScreenDeviceApi { /// /// * [String] screenDeviceId (required): /// Id of the screen device you want to get information - Future screenDeviceGetDeviceInfoWithHttpInfo(String screenDeviceId) async { - // Verify required params are set. - if (screenDeviceId == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDeviceId'); - } - + Future screenDeviceGetDeviceInfoWithHttpInfo(String screenDeviceId,) async { + // ignore: prefer_const_declarations final path = r'/api/device/screen/{screenDeviceId}' - .replaceAll('{' + 'screenDeviceId' + '}', screenDeviceId.toString()); + .replaceAll('{screenDeviceId}', screenDeviceId); - 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, ); } @@ -270,18 +212,19 @@ class ScreenDeviceApi { /// /// * [String] screenDeviceId (required): /// Id of the screen device you want to get information - Future screenDeviceGetDeviceInfo(String screenDeviceId) async { - final response = await screenDeviceGetDeviceInfoWithHttpInfo(screenDeviceId); + Future screenDeviceGetDeviceInfo(String screenDeviceId,) async { + final response = await screenDeviceGetDeviceInfoWithHttpInfo(screenDeviceId,); 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), 'ScreenDevice') as ScreenDevice; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ScreenDevice',) as ScreenDevice; + + } + return null; } /// Update screen device @@ -292,45 +235,28 @@ class ScreenDeviceApi { /// /// * [ScreenDevice] screenDevice (required): /// Screen device to update - Future screenDeviceUpdateDeviceWithHttpInfo(ScreenDevice screenDevice) async { - // Verify required params are set. - if (screenDevice == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDevice'); - } - + Future screenDeviceUpdateDeviceWithHttpInfo(ScreenDevice screenDevice,) async { + // ignore: prefer_const_declarations final path = r'/api/device/screen'; - Object postBody = screenDevice; + // ignore: prefer_final_locals + Object? postBody = screenDevice; 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, ); } @@ -340,17 +266,18 @@ class ScreenDeviceApi { /// /// * [ScreenDevice] screenDevice (required): /// Screen device to update - Future screenDeviceUpdateDevice(ScreenDevice screenDevice) async { - final response = await screenDeviceUpdateDeviceWithHttpInfo(screenDevice); + Future screenDeviceUpdateDevice(ScreenDevice screenDevice,) async { + final response = await screenDeviceUpdateDeviceWithHttpInfo(screenDevice,); 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), 'ScreenDevice') as ScreenDevice; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ScreenDevice',) as ScreenDevice; + + } + return null; } } diff --git a/mycore_api/lib/api/token_api.dart b/mycore_api/lib/api/token_api.dart index 88287aa..e42b8a9 100644 --- a/mycore_api/lib/api/token_api.dart +++ b/mycore_api/lib/api/token_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 TokenApi { - TokenApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + TokenApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -23,45 +24,28 @@ class TokenApi { /// /// * [LoginDTO] loginDTO (required): /// login info - Future tokenConnectUserWithHttpInfo(LoginDTO loginDTO) async { - // Verify required params are set. - if (loginDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO'); - } - + Future tokenConnectUserWithHttpInfo(LoginDTO loginDTO,) async { + // ignore: prefer_const_declarations final path = r'/api/token'; - 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, ); } @@ -71,80 +55,65 @@ class TokenApi { /// /// * [LoginDTO] loginDTO (required): /// login info - Future tokenConnectUser(LoginDTO loginDTO) async { - final response = await tokenConnectUserWithHttpInfo(loginDTO); + Future tokenConnectUser(LoginDTO loginDTO,) async { + final response = await tokenConnectUserWithHttpInfo(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), 'UserInfo') as UserInfo; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserInfo',) as UserInfo; + + } + return null; } /// Performs an HTTP 'POST /token' operation and returns the [Response]. /// Parameters: /// /// * [User] user (required): - Future tokenCreateWithHttpInfo(User user) async { - // Verify required params are set. - if (user == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); - } - + Future tokenCreateWithHttpInfo(User user,) async { + // ignore: prefer_const_declarations final path = r'/token'; - 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 tokenCreate(User user) async { - final response = await tokenCreateWithHttpInfo(user); + Future tokenCreate(User user,) async { + final response = await tokenCreateWithHttpInfo(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), '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; } } diff --git a/mycore_api/lib/api/twitter_api.dart b/mycore_api/lib/api/twitter_api.dart index 426572c..5eca96e 100644 --- a/mycore_api/lib/api/twitter_api.dart +++ b/mycore_api/lib/api/twitter_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 TwitterApi { - TwitterApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + TwitterApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,62 +20,46 @@ class TwitterApi { /// Parameters: /// /// * [TwitterAuthModel] twitterAuthModel (required): - Future twitterCreateWithHttpInfo(TwitterAuthModel twitterAuthModel) async { - // Verify required params are set. - if (twitterAuthModel == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: twitterAuthModel'); - } - + Future twitterCreateWithHttpInfo(TwitterAuthModel twitterAuthModel,) async { + // ignore: prefer_const_declarations final path = r'/twitter'; - Object postBody = twitterAuthModel; + // ignore: prefer_final_locals + Object? postBody = twitterAuthModel; 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: /// /// * [TwitterAuthModel] twitterAuthModel (required): - Future twitterCreate(TwitterAuthModel twitterAuthModel) async { - final response = await twitterCreateWithHttpInfo(twitterAuthModel); + Future twitterCreate(TwitterAuthModel twitterAuthModel,) async { + final response = await twitterCreateWithHttpInfo(twitterAuthModel,); 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; } } diff --git a/mycore_api/lib/api/user_api.dart b/mycore_api/lib/api/user_api.dart index e22c4f9..41580ca 100644 --- a/mycore_api/lib/api/user_api.dart +++ b/mycore_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; @@ -23,45 +24,28 @@ class UserApi { /// /// * [UserInfo] userInfo (required): /// New user info - Future userCreateUserWithHttpInfo(UserInfo userInfo) async { - // Verify required params are set. - if (userInfo == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: userInfo'); - } - + Future userCreateUserWithHttpInfo(UserInfo userInfo,) async { + // ignore: prefer_const_declarations final path = r'/api/user'; - Object postBody = userInfo; + // ignore: prefer_final_locals + Object? postBody = userInfo; 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, ); } @@ -71,18 +55,19 @@ class UserApi { /// /// * [UserInfo] userInfo (required): /// New user info - Future userCreateUser(UserInfo userInfo) async { - final response = await userCreateUserWithHttpInfo(userInfo); + Future userCreateUser(UserInfo userInfo,) async { + final response = await userCreateUserWithHttpInfo(userInfo,); 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), 'UserInfoDetailDTO') as UserInfoDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserInfoDetailDTO',) as UserInfoDetailDTO; + + } + return null; } /// Delete an user @@ -93,46 +78,29 @@ class UserApi { /// /// * [String] id (required): /// Id of user to delete - 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, ); } @@ -142,18 +110,19 @@ class UserApi { /// /// * [String] id (required): /// Id of user to delete - 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; } /// Get a specific user @@ -164,46 +133,29 @@ class UserApi { /// /// * [String] id (required): /// id user - Future userGetWithHttpInfo(String id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future userGetWithHttpInfo(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, ); } @@ -213,75 +165,66 @@ class UserApi { /// /// * [String] id (required): /// id user - Future userGet(String id) async { - final response = await userGetWithHttpInfo(id); + Future userGet(String id,) async { + final response = await userGetWithHttpInfo(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), 'UserInfoDetailDTO') as UserInfoDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserInfoDetailDTO',) as UserInfoDetailDTO; + + } + return null; } /// Get a list of user /// /// Note: This method returns the HTTP [Response]. Future userGetAllWithHttpInfo() 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, ); } /// Get a list of user - Future> userGetAll() async { + Future?> userGetAll() async { final response = await userGetAllWithHttpInfo(); 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; } /// Get a specific user by email @@ -292,46 +235,29 @@ class UserApi { /// /// * [String] email (required): /// user email - Future userGetByEmailWithHttpInfo(String email) async { - // Verify required params are set. - if (email == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: email'); - } - + Future userGetByEmailWithHttpInfo(String email,) async { + // ignore: prefer_const_declarations final path = r'/api/user/email/{email}' - .replaceAll('{' + 'email' + '}', email.toString()); + .replaceAll('{email}', email); - 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, ); } @@ -341,18 +267,19 @@ class UserApi { /// /// * [String] email (required): /// user email - Future userGetByEmail(String email) async { - final response = await userGetByEmailWithHttpInfo(email); + Future userGetByEmail(String email,) async { + final response = await userGetByEmailWithHttpInfo(email,); 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), 'UserInfoDetailDTO') as UserInfoDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserInfoDetailDTO',) as UserInfoDetailDTO; + + } + return null; } /// Update an user @@ -363,45 +290,28 @@ class UserApi { /// /// * [UserInfo] userInfo (required): /// User to update - Future userUpdateUserWithHttpInfo(UserInfo userInfo) async { - // Verify required params are set. - if (userInfo == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: userInfo'); - } - + Future userUpdateUserWithHttpInfo(UserInfo userInfo,) async { + // ignore: prefer_const_declarations final path = r'/api/user'; - Object postBody = userInfo; + // ignore: prefer_final_locals + Object? postBody = userInfo; 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, ); } @@ -411,17 +321,18 @@ class UserApi { /// /// * [UserInfo] userInfo (required): /// User to update - Future userUpdateUser(UserInfo userInfo) async { - final response = await userUpdateUserWithHttpInfo(userInfo); + Future userUpdateUser(UserInfo userInfo,) async { + final response = await userUpdateUserWithHttpInfo(userInfo,); 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), 'UserInfoDetailDTO') as UserInfoDetailDTO; - } - return Future.value(null); + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserInfoDetailDTO',) as UserInfoDetailDTO; + + } + return null; } } diff --git a/mycore_api/lib/api/values_api.dart b/mycore_api/lib/api/values_api.dart index 1a6b1f1..81666f4 100644 --- a/mycore_api/lib/api/values_api.dart +++ b/mycore_api/lib/api/values_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 ValuesApi { - ValuesApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + ValuesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; @@ -19,56 +20,39 @@ class ValuesApi { /// Parameters: /// /// * [int] id (required): - Future valuesDeleteWithHttpInfo(int id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future valuesDeleteWithHttpInfo(int id,) async { + // ignore: prefer_const_declarations final path = r'/api/test/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id.toString()); - 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: /// /// * [int] id (required): - Future valuesDelete(int id) async { - final response = await valuesDeleteWithHttpInfo(id); + Future valuesDelete(int id,) async { + final response = await valuesDeleteWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } @@ -76,176 +60,133 @@ class ValuesApi { /// Parameters: /// /// * [int] id (required): - Future valuesGetWithHttpInfo(int id) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - + Future valuesGetWithHttpInfo(int id,) async { + // ignore: prefer_const_declarations final path = r'/api/test/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id.toString()); - 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: /// /// * [int] id (required): - Future valuesGet(int id) async { - final response = await valuesGetWithHttpInfo(id); + Future valuesGet(int id,) async { + final response = await valuesGetWithHttpInfo(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; } /// It's a test ! :) /// /// Note: This method returns the HTTP [Response]. Future valuesGetAllWithHttpInfo() async { + // ignore: prefer_const_declarations final path = r'/api/test'; - 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, ); } /// It's a test ! :) - Future> valuesGetAll() async { + Future?> valuesGetAll() async { final response = await valuesGetAllWithHttpInfo(); 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 'POST /api/test' operation and returns the [Response]. /// Parameters: /// /// * [String] body (required): - Future valuesPostWithHttpInfo(String body) async { - // Verify required params are set. - if (body == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: body'); - } - + Future valuesPostWithHttpInfo(String body,) async { + // ignore: prefer_const_declarations final path = r'/api/test'; - Object postBody = body; + // ignore: prefer_final_locals + Object? postBody = body; 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: /// /// * [String] body (required): - Future valuesPost(String body) async { - final response = await valuesPostWithHttpInfo(body); + Future valuesPost(String body,) async { + final response = await valuesPostWithHttpInfo(body,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } @@ -255,49 +196,29 @@ class ValuesApi { /// * [int] id (required): /// /// * [String] body (required): - Future valuesPutWithHttpInfo(int id, String body) async { - // Verify required params are set. - if (id == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); - } - if (body == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: body'); - } - + Future valuesPutWithHttpInfo(int id, String body,) async { + // ignore: prefer_const_declarations final path = r'/api/test/{id}' - .replaceAll('{' + 'id' + '}', id.toString()); + .replaceAll('{id}', id.toString()); - Object postBody = body; + // ignore: prefer_final_locals + Object? postBody = body; 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, ); } @@ -306,10 +227,10 @@ class ValuesApi { /// * [int] id (required): /// /// * [String] body (required): - Future valuesPut(int id, String body) async { - final response = await valuesPutWithHttpInfo(id, body); + Future valuesPut(int id, String body,) async { + final response = await valuesPutWithHttpInfo(id, body,); if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } } diff --git a/mycore_api/lib/api_client.dart b/mycore_api/lib/api_client.dart index 584293b..5c1fc59 100644 --- a/mycore_api/lib/api_client.dart +++ b/mycore_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://localhost:5000'}) { - // Setup authentications (key: authentication name, value: authentication). - _authentications[r'bearer'] = OAuth(); - } + ApiClient({this.basePath = 'http://192.168.31.140', 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,55 +88,112 @@ 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 'Action': return Action.fromJson(value); case 'ActionType': return ActionTypeTypeTransformer().decode(value); - case 'AlarmMode': return AlarmMode.fromJson(value); case 'AlarmModeCreateOrUpdateDetailDTO': @@ -173,11 +206,14 @@ class ApiClient { return AlarmModeDetailDTO.fromJson(value); case 'AlarmModeDetailDTOAllOf': return AlarmModeDetailDTOAllOf.fromJson(value); + case 'AlarmModeGeolocalizedMode': + return AlarmModeGeolocalizedMode.fromJson(value); + case 'AlarmModeProgrammedMode': + return AlarmModeProgrammedMode.fromJson(value); case 'AlarmTriggered': return AlarmTriggered.fromJson(value); case 'AlarmType': return AlarmTypeTypeTransformer().decode(value); - case 'AutomationDTO': return AutomationDTO.fromJson(value); case 'AutomationDetailDTO': @@ -194,15 +230,14 @@ class ApiClient { return Book.fromJson(value); case 'Condition': return Condition.fromJson(value); + case 'ConditionState': + return ConditionState.fromJson(value); case 'ConditionType': return ConditionTypeTypeTransformer().decode(value); - case 'ConditionValue': return ConditionValueTypeTransformer().decode(value); - case 'ConnectionStatus': return ConnectionStatusTypeTransformer().decode(value); - case 'CreateOrUpdateHomeDTO': return CreateOrUpdateHomeDTO.fromJson(value); case 'CreateOrUpdateHomeDTOAllOf': @@ -217,7 +252,6 @@ class ApiClient { return DeviceSummaryDTO.fromJson(value); case 'DeviceType': return DeviceTypeTypeTransformer().decode(value); - case 'ElectricityProduction': return ElectricityProduction.fromJson(value); case 'EventDTO': @@ -234,7 +268,6 @@ class ApiClient { return EventHomeFilterAllOf.fromJson(value); case 'EventType': return EventTypeTypeTransformer().decode(value); - case 'FacebookAuthModel': return FacebookAuthModel.fromJson(value); case 'GeolocalizedMode': @@ -263,11 +296,12 @@ class ApiClient { return LoginDTO.fromJson(value); case 'MeansOfCommunication': return MeansOfCommunicationTypeTransformer().decode(value); - case 'MqttMessageDTO': return MqttMessageDTO.fromJson(value); case 'OddNice': return OddNice.fromJson(value); + case 'OddNiceOdds': + return OddNiceOdds.fromJson(value); case 'OddObject': return OddObject.fromJson(value); case 'PanelMenuItem': @@ -280,7 +314,6 @@ class ApiClient { return ProviderDTO.fromJson(value); case 'ProviderType': return ProviderTypeTypeTransformer().decode(value); - case 'RoomCreateOrUpdateDetailDTO': return RoomCreateOrUpdateDetailDTO.fromJson(value); case 'RoomDetailDTO': @@ -305,7 +338,6 @@ class ApiClient { return Trigger.fromJson(value); case 'TriggerType': return TriggerTypeTypeTransformer().decode(value); - case 'TwitterAuthModel': return TwitterAuthModel.fromJson(value); case 'User': @@ -316,60 +348,64 @@ class ApiClient { return UserInfoDetailDTO.fromJson(value); case 'ViewBy': return ViewByTypeTransformer().decode(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/mycore_api/lib/api_exception.dart b/mycore_api/lib/api_exception.dart index 1537c97..796f7f7 100644 --- a/mycore_api/lib/api_exception.dart +++ b/mycore_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/mycore_api/lib/api_helper.dart b/mycore_api/lib/api_helper.dart index 54c52a6..1bea1af 100644 --- a/mycore_api/lib/api_helper.dart +++ b/mycore_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; @@ -96,9 +93,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/mycore_api/lib/auth/api_key_auth.dart b/mycore_api/lib/auth/api_key_auth.dart index 41a4afd..e304eda 100644 --- a/mycore_api/lib/auth/api_key_auth.dart +++ b/mycore_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/mycore_api/lib/auth/authentication.dart b/mycore_api/lib/auth/authentication.dart index 5ca198d..49baf7c 100644 --- a/mycore_api/lib/auth/authentication.dart +++ b/mycore_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/mycore_api/lib/auth/http_basic_auth.dart b/mycore_api/lib/auth/http_basic_auth.dart index 6dc36a1..81abd71 100644 --- a/mycore_api/lib/auth/http_basic_auth.dart +++ b/mycore_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/mycore_api/lib/auth/http_bearer_auth.dart b/mycore_api/lib/auth/http_bearer_auth.dart index a23b65f..213f348 100644 --- a/mycore_api/lib/auth/http_bearer_auth.dart +++ b/mycore_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/mycore_api/lib/auth/oauth.dart b/mycore_api/lib/auth/oauth.dart index c0463ad..e9b87cf 100644 --- a/mycore_api/lib/auth/oauth.dart +++ b/mycore_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/mycore_api/lib/model/action.dart b/mycore_api/lib/model/action.dart index 57dff7c..4a10f5d 100644 --- a/mycore_api/lib/model/action.dart +++ b/mycore_api/lib/model/action.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,26 +15,38 @@ class Action { Action({ this.groupId, this.deviceId, - this.states, + this.states = const [], this.rawRequest, this.providerId, this.type, this.isForce, }); - String groupId; + String? groupId; - String deviceId; + String? deviceId; - List states; + List? states; - String rawRequest; + String? rawRequest; - String providerId; + String? providerId; - ActionType 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. + /// + ActionType? type; - bool isForce; + /// + /// 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? isForce; @override bool operator ==(Object other) => identical(this, other) || other is Action && @@ -47,79 +60,119 @@ class Action { @override int get hashCode => - (groupId == null ? 0 : groupId.hashCode) + - (deviceId == null ? 0 : deviceId.hashCode) + - (states == null ? 0 : states.hashCode) + - (rawRequest == null ? 0 : rawRequest.hashCode) + - (providerId == null ? 0 : providerId.hashCode) + - (type == null ? 0 : type.hashCode) + - (isForce == null ? 0 : isForce.hashCode); + // ignore: unnecessary_parenthesis + (groupId == null ? 0 : groupId!.hashCode) + + (deviceId == null ? 0 : deviceId!.hashCode) + + (states == null ? 0 : states!.hashCode) + + (rawRequest == null ? 0 : rawRequest!.hashCode) + + (providerId == null ? 0 : providerId!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (isForce == null ? 0 : isForce!.hashCode); @override String toString() => 'Action[groupId=$groupId, deviceId=$deviceId, states=$states, rawRequest=$rawRequest, providerId=$providerId, type=$type, isForce=$isForce]'; Map toJson() { - final json = {}; + final _json = {}; if (groupId != null) { - json[r'groupId'] = groupId; + _json[r'groupId'] = groupId; } if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (states != null) { - json[r'states'] = states; + _json[r'states'] = states; } if (rawRequest != null) { - json[r'rawRequest'] = rawRequest; + _json[r'rawRequest'] = rawRequest; } if (providerId != null) { - json[r'providerId'] = providerId; + _json[r'providerId'] = providerId; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (isForce != null) { - json[r'isForce'] = isForce; + _json[r'isForce'] = isForce; } - return json; + return _json; } /// Returns a new [Action] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static Action fromJson(Map json) => json == null - ? null - : Action( - groupId: json[r'groupId'], - deviceId: json[r'deviceId'], - states: AutomationState.listFromJson(json[r'states']), - rawRequest: json[r'rawRequest'], - providerId: json[r'providerId'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Action? 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 "Action[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Action[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Action( + groupId: mapValueOfType(json, r'groupId'), + deviceId: mapValueOfType(json, r'deviceId'), + states: AutomationState.listFromJson(json[r'states']) ?? const [], + rawRequest: mapValueOfType(json, r'rawRequest'), + providerId: mapValueOfType(json, r'providerId'), type: ActionType.fromJson(json[r'type']), - isForce: json[r'isForce'], - ); + isForce: mapValueOfType(json, r'isForce'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => Action.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 = Action.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] = Action.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Action.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of Action-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] = Action.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 = Action.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/mycore_api/lib/model/action_type.dart b/mycore_api/lib/model/action_type.dart index 33387c8..4a90299 100644 --- a/mycore_api/lib/model/action_type.dart +++ b/mycore_api/lib/model/action_type.dart @@ -1,15 +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; - +/// class ActionType { /// Instantiate a new enum with the provided [value]. const ActionType._(this.value); @@ -39,23 +40,28 @@ class ActionType { GROUP, ]; - static ActionType fromJson(dynamic value) => - ActionTypeTypeTransformer().decode(value); + static ActionType? fromJson(dynamic value) => ActionTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ActionType.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 = ActionType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [ActionType] to String, /// and [decode] dynamic data back to [ActionType]. class ActionTypeTypeTransformer { - const ActionTypeTypeTransformer._(); + factory ActionTypeTypeTransformer() => _instance ??= const ActionTypeTypeTransformer._(); - factory ActionTypeTypeTransformer() => _instance ??= ActionTypeTypeTransformer._(); + const ActionTypeTypeTransformer._(); String encode(ActionType data) => data.value; @@ -67,22 +73,25 @@ class ActionTypeTypeTransformer { /// /// 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. - ActionType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'DELAY': return ActionType.DELAY; - case r'DEVICE': return ActionType.DEVICE; - case r'HTTP': return ActionType.HTTP; - case r'ZIGBEE2MQTT': return ActionType.zIGBEE2MQTT; - case r'MQTT': return ActionType.MQTT; - case r'GROUP': return ActionType.GROUP; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ActionType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'DELAY': return ActionType.DELAY; + case r'DEVICE': return ActionType.DEVICE; + case r'HTTP': return ActionType.HTTP; + case r'ZIGBEE2MQTT': return ActionType.zIGBEE2MQTT; + case r'MQTT': return ActionType.MQTT; + case r'GROUP': return ActionType.GROUP; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ActionTypeTypeTransformer] instance. - static ActionTypeTypeTransformer _instance; + static ActionTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/alarm_mode.dart b/mycore_api/lib/model/alarm_mode.dart index 381cade..977a959 100644 --- a/mycore_api/lib/model/alarm_mode.dart +++ b/mycore_api/lib/model/alarm_mode.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; @@ -23,38 +24,74 @@ class AlarmMode { this.type, this.programmedMode, this.geolocalizedMode, - this.triggers, - this.actions, - this.devicesIds, + this.triggers = const [], + this.actions = const [], + this.devicesIds = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - bool activated; + /// + /// 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? activated; - bool isDefault; + /// + /// 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? isDefault; - bool notification; + /// + /// 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? notification; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - AlarmType 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. + /// + AlarmType? type; - ProgrammedMode programmedMode; + AlarmModeProgrammedMode? programmedMode; - GeolocalizedMode geolocalizedMode; + AlarmModeGeolocalizedMode? geolocalizedMode; - List triggers; + List? triggers; - List actions; + List? actions; - List devicesIds; + List? devicesIds; @override bool operator ==(Object other) => identical(this, other) || other is AlarmMode && @@ -75,120 +112,156 @@ class AlarmMode { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (activated == null ? 0 : activated.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (notification == null ? 0 : notification.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (type == null ? 0 : type.hashCode) + - (programmedMode == null ? 0 : programmedMode.hashCode) + - (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode) + - (triggers == null ? 0 : triggers.hashCode) + - (actions == null ? 0 : actions.hashCode) + - (devicesIds == null ? 0 : devicesIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (activated == null ? 0 : activated!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (notification == null ? 0 : notification!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (programmedMode == null ? 0 : programmedMode!.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode!.hashCode) + + (triggers == null ? 0 : triggers!.hashCode) + + (actions == null ? 0 : actions!.hashCode) + + (devicesIds == null ? 0 : devicesIds!.hashCode); @override String toString() => 'AlarmMode[id=$id, homeId=$homeId, name=$name, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, type=$type, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode, triggers=$triggers, actions=$actions, devicesIds=$devicesIds]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (activated != null) { - json[r'activated'] = activated; + _json[r'activated'] = activated; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (notification != null) { - json[r'notification'] = notification; + _json[r'notification'] = notification; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (programmedMode != null) { - json[r'programmedMode'] = programmedMode; + _json[r'programmedMode'] = programmedMode; } if (geolocalizedMode != null) { - json[r'geolocalizedMode'] = geolocalizedMode; + _json[r'geolocalizedMode'] = geolocalizedMode; } if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (actions != null) { - json[r'actions'] = actions; + _json[r'actions'] = actions; } if (devicesIds != null) { - json[r'devicesIds'] = devicesIds; + _json[r'devicesIds'] = devicesIds; } - return json; + return _json; } /// Returns a new [AlarmMode] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmMode fromJson(Map json) => json == null - ? null - : AlarmMode( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - activated: json[r'activated'], - isDefault: json[r'isDefault'], - notification: json[r'notification'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmMode? 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 "AlarmMode[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmMode[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmMode( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + activated: mapValueOfType(json, r'activated'), + isDefault: mapValueOfType(json, r'isDefault'), + notification: mapValueOfType(json, r'notification'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), type: AlarmType.fromJson(json[r'type']), - programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), - geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), - triggers: Trigger.listFromJson(json[r'triggers']), - actions: Action.listFromJson(json[r'actions']), - devicesIds: json[r'devicesIds'] == null - ? null - : (json[r'devicesIds'] as List).cast(), - ); + programmedMode: AlarmModeProgrammedMode.fromJson(json[r'programmedMode']), + geolocalizedMode: AlarmModeGeolocalizedMode.fromJson(json[r'geolocalizedMode']), + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + actions: Action.listFromJson(json[r'actions']) ?? const [], + devicesIds: json[r'devicesIds'] is List + ? (json[r'devicesIds'] as List).cast() + : const [], + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmMode.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 = AlarmMode.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] = AlarmMode.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmMode.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmMode-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] = AlarmMode.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 = AlarmMode.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/mycore_api/lib/model/alarm_mode_create_or_update_detail_dto.dart b/mycore_api/lib/model/alarm_mode_create_or_update_detail_dto.dart index 1fea333..2d34f74 100644 --- a/mycore_api/lib/model/alarm_mode_create_or_update_detail_dto.dart +++ b/mycore_api/lib/model/alarm_mode_create_or_update_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; @@ -21,37 +22,73 @@ class AlarmModeCreateOrUpdateDetailDTO { this.notification, this.createdDate, this.updatedDate, - this.triggers, - this.actions, + this.triggers = const [], + this.actions = const [], this.programmedMode, this.geolocalizedMode, }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - AlarmType 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. + /// + AlarmType? type; - bool activated; + /// + /// 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? activated; - bool isDefault; + /// + /// 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? isDefault; - bool notification; + /// + /// 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? notification; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List triggers; + List? triggers; - List actions; + List? actions; - ProgrammedMode programmedMode; + ProgrammedMode? programmedMode; - GeolocalizedMode geolocalizedMode; + GeolocalizedMode? geolocalizedMode; @override bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTO && @@ -71,113 +108,149 @@ class AlarmModeCreateOrUpdateDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (activated == null ? 0 : activated.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (notification == null ? 0 : notification.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (triggers == null ? 0 : triggers.hashCode) + - (actions == null ? 0 : actions.hashCode) + - (programmedMode == null ? 0 : programmedMode.hashCode) + - (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (activated == null ? 0 : activated!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (notification == null ? 0 : notification!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (triggers == null ? 0 : triggers!.hashCode) + + (actions == null ? 0 : actions!.hashCode) + + (programmedMode == null ? 0 : programmedMode!.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode!.hashCode); @override String toString() => 'AlarmModeCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (activated != null) { - json[r'activated'] = activated; + _json[r'activated'] = activated; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (notification != null) { - json[r'notification'] = notification; + _json[r'notification'] = notification; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (actions != null) { - json[r'actions'] = actions; + _json[r'actions'] = actions; } if (programmedMode != null) { - json[r'programmedMode'] = programmedMode; + _json[r'programmedMode'] = programmedMode; } if (geolocalizedMode != null) { - json[r'geolocalizedMode'] = geolocalizedMode; + _json[r'geolocalizedMode'] = geolocalizedMode; } - return json; + return _json; } /// Returns a new [AlarmModeCreateOrUpdateDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmModeCreateOrUpdateDetailDTO fromJson(Map json) => json == null - ? null - : AlarmModeCreateOrUpdateDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeCreateOrUpdateDetailDTO? 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 "AlarmModeCreateOrUpdateDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeCreateOrUpdateDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeCreateOrUpdateDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), type: AlarmType.fromJson(json[r'type']), - activated: json[r'activated'], - isDefault: json[r'isDefault'], - notification: json[r'notification'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - triggers: Trigger.listFromJson(json[r'triggers']), - actions: Action.listFromJson(json[r'actions']), + activated: mapValueOfType(json, r'activated'), + isDefault: mapValueOfType(json, r'isDefault'), + notification: mapValueOfType(json, r'notification'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + actions: Action.listFromJson(json[r'actions']) ?? const [], programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmModeCreateOrUpdateDetailDTO.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 = AlarmModeCreateOrUpdateDetailDTO.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] = AlarmModeCreateOrUpdateDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmModeCreateOrUpdateDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmModeCreateOrUpdateDetailDTO-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] = AlarmModeCreateOrUpdateDetailDTO.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 = AlarmModeCreateOrUpdateDetailDTO.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/mycore_api/lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart b/mycore_api/lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart index e04b206..8b6d8d3 100644 --- a/mycore_api/lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart +++ b/mycore_api/lib/model/alarm_mode_create_or_update_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; @@ -12,19 +13,19 @@ part of openapi.api; class AlarmModeCreateOrUpdateDetailDTOAllOf { /// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance. AlarmModeCreateOrUpdateDetailDTOAllOf({ - this.triggers, - this.actions, + this.triggers = const [], + this.actions = const [], this.programmedMode, this.geolocalizedMode, }); - List triggers; + List? triggers; - List actions; + List? actions; - ProgrammedMode programmedMode; + ProgrammedMode? programmedMode; - GeolocalizedMode geolocalizedMode; + GeolocalizedMode? geolocalizedMode; @override bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTOAllOf && @@ -35,64 +36,104 @@ class AlarmModeCreateOrUpdateDetailDTOAllOf { @override int get hashCode => - (triggers == null ? 0 : triggers.hashCode) + - (actions == null ? 0 : actions.hashCode) + - (programmedMode == null ? 0 : programmedMode.hashCode) + - (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + // ignore: unnecessary_parenthesis + (triggers == null ? 0 : triggers!.hashCode) + + (actions == null ? 0 : actions!.hashCode) + + (programmedMode == null ? 0 : programmedMode!.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode!.hashCode); @override String toString() => 'AlarmModeCreateOrUpdateDetailDTOAllOf[triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; Map toJson() { - final json = {}; + final _json = {}; if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (actions != null) { - json[r'actions'] = actions; + _json[r'actions'] = actions; } if (programmedMode != null) { - json[r'programmedMode'] = programmedMode; + _json[r'programmedMode'] = programmedMode; } if (geolocalizedMode != null) { - json[r'geolocalizedMode'] = geolocalizedMode; + _json[r'geolocalizedMode'] = geolocalizedMode; } - return json; + return _json; } /// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmModeCreateOrUpdateDetailDTOAllOf fromJson(Map json) => json == null - ? null - : AlarmModeCreateOrUpdateDetailDTOAllOf( - triggers: Trigger.listFromJson(json[r'triggers']), - actions: Action.listFromJson(json[r'actions']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeCreateOrUpdateDetailDTOAllOf? 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 "AlarmModeCreateOrUpdateDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeCreateOrUpdateDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeCreateOrUpdateDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + actions: Action.listFromJson(json[r'actions']) ?? const [], programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmModeCreateOrUpdateDetailDTOAllOf.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 = AlarmModeCreateOrUpdateDetailDTOAllOf.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] = AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmModeCreateOrUpdateDetailDTOAllOf-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] = AlarmModeCreateOrUpdateDetailDTOAllOf.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 = AlarmModeCreateOrUpdateDetailDTOAllOf.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/mycore_api/lib/model/alarm_mode_detail_dto.dart b/mycore_api/lib/model/alarm_mode_detail_dto.dart index 4f15d1b..fee886f 100644 --- a/mycore_api/lib/model/alarm_mode_detail_dto.dart +++ b/mycore_api/lib/model/alarm_mode_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; @@ -21,37 +22,73 @@ class AlarmModeDetailDTO { this.notification, this.createdDate, this.updatedDate, - this.triggers, - this.devices, + this.triggers = const [], + this.devices = const [], this.programmedMode, this.geolocalizedMode, }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - AlarmType 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. + /// + AlarmType? type; - bool activated; + /// + /// 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? activated; - bool isDefault; + /// + /// 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? isDefault; - bool notification; + /// + /// 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? notification; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List triggers; + List? triggers; - List devices; + List? devices; - ProgrammedMode programmedMode; + ProgrammedMode? programmedMode; - GeolocalizedMode geolocalizedMode; + GeolocalizedMode? geolocalizedMode; @override bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTO && @@ -71,113 +108,149 @@ class AlarmModeDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (activated == null ? 0 : activated.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (notification == null ? 0 : notification.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (triggers == null ? 0 : triggers.hashCode) + - (devices == null ? 0 : devices.hashCode) + - (programmedMode == null ? 0 : programmedMode.hashCode) + - (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (activated == null ? 0 : activated!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (notification == null ? 0 : notification!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (triggers == null ? 0 : triggers!.hashCode) + + (devices == null ? 0 : devices!.hashCode) + + (programmedMode == null ? 0 : programmedMode!.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode!.hashCode); @override String toString() => 'AlarmModeDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (activated != null) { - json[r'activated'] = activated; + _json[r'activated'] = activated; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (notification != null) { - json[r'notification'] = notification; + _json[r'notification'] = notification; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } if (programmedMode != null) { - json[r'programmedMode'] = programmedMode; + _json[r'programmedMode'] = programmedMode; } if (geolocalizedMode != null) { - json[r'geolocalizedMode'] = geolocalizedMode; + _json[r'geolocalizedMode'] = geolocalizedMode; } - return json; + return _json; } /// Returns a new [AlarmModeDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmModeDetailDTO fromJson(Map json) => json == null - ? null - : AlarmModeDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeDetailDTO? 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 "AlarmModeDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), type: AlarmType.fromJson(json[r'type']), - activated: json[r'activated'], - isDefault: json[r'isDefault'], - notification: json[r'notification'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - triggers: Trigger.listFromJson(json[r'triggers']), - devices: DeviceDetailDTO.listFromJson(json[r'devices']), + activated: mapValueOfType(json, r'activated'), + isDefault: mapValueOfType(json, r'isDefault'), + notification: mapValueOfType(json, r'notification'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? const [], programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmModeDetailDTO.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 = AlarmModeDetailDTO.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] = AlarmModeDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmModeDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmModeDetailDTO-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] = AlarmModeDetailDTO.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 = AlarmModeDetailDTO.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/mycore_api/lib/model/alarm_mode_detail_dto_all_of.dart b/mycore_api/lib/model/alarm_mode_detail_dto_all_of.dart index 860a99e..cbd7d7f 100644 --- a/mycore_api/lib/model/alarm_mode_detail_dto_all_of.dart +++ b/mycore_api/lib/model/alarm_mode_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; @@ -12,19 +13,19 @@ part of openapi.api; class AlarmModeDetailDTOAllOf { /// Returns a new [AlarmModeDetailDTOAllOf] instance. AlarmModeDetailDTOAllOf({ - this.triggers, - this.devices, + this.triggers = const [], + this.devices = const [], this.programmedMode, this.geolocalizedMode, }); - List triggers; + List? triggers; - List devices; + List? devices; - ProgrammedMode programmedMode; + ProgrammedMode? programmedMode; - GeolocalizedMode geolocalizedMode; + GeolocalizedMode? geolocalizedMode; @override bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTOAllOf && @@ -35,64 +36,104 @@ class AlarmModeDetailDTOAllOf { @override int get hashCode => - (triggers == null ? 0 : triggers.hashCode) + - (devices == null ? 0 : devices.hashCode) + - (programmedMode == null ? 0 : programmedMode.hashCode) + - (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + // ignore: unnecessary_parenthesis + (triggers == null ? 0 : triggers!.hashCode) + + (devices == null ? 0 : devices!.hashCode) + + (programmedMode == null ? 0 : programmedMode!.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode!.hashCode); @override String toString() => 'AlarmModeDetailDTOAllOf[triggers=$triggers, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; Map toJson() { - final json = {}; + final _json = {}; if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } if (programmedMode != null) { - json[r'programmedMode'] = programmedMode; + _json[r'programmedMode'] = programmedMode; } if (geolocalizedMode != null) { - json[r'geolocalizedMode'] = geolocalizedMode; + _json[r'geolocalizedMode'] = geolocalizedMode; } - return json; + return _json; } /// Returns a new [AlarmModeDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmModeDetailDTOAllOf fromJson(Map json) => json == null - ? null - : AlarmModeDetailDTOAllOf( - triggers: Trigger.listFromJson(json[r'triggers']), - devices: DeviceDetailDTO.listFromJson(json[r'devices']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeDetailDTOAllOf? 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 "AlarmModeDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? const [], programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmModeDetailDTOAllOf.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 = AlarmModeDetailDTOAllOf.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] = AlarmModeDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmModeDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmModeDetailDTOAllOf-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] = AlarmModeDetailDTOAllOf.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 = AlarmModeDetailDTOAllOf.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/mycore_api/lib/model/alarm_mode_dto.dart b/mycore_api/lib/model/alarm_mode_dto.dart index 86f85cf..6c609af 100644 --- a/mycore_api/lib/model/alarm_mode_dto.dart +++ b/mycore_api/lib/model/alarm_mode_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; @@ -23,23 +24,59 @@ class AlarmModeDTO { this.updatedDate, }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - AlarmType 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. + /// + AlarmType? type; - bool activated; + /// + /// 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? activated; - bool isDefault; + /// + /// 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? isDefault; - bool notification; + /// + /// 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? notification; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; @override bool operator ==(Object other) => identical(this, other) || other is AlarmModeDTO && @@ -55,93 +92,129 @@ class AlarmModeDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (activated == null ? 0 : activated.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (notification == null ? 0 : notification.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (activated == null ? 0 : activated!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (notification == null ? 0 : notification!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode); @override String toString() => 'AlarmModeDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (activated != null) { - json[r'activated'] = activated; + _json[r'activated'] = activated; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (notification != null) { - json[r'notification'] = notification; + _json[r'notification'] = notification; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } - return json; + return _json; } /// Returns a new [AlarmModeDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmModeDTO fromJson(Map json) => json == null - ? null - : AlarmModeDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeDTO? 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 "AlarmModeDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), type: AlarmType.fromJson(json[r'type']), - activated: json[r'activated'], - isDefault: json[r'isDefault'], - notification: json[r'notification'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - ); + activated: mapValueOfType(json, r'activated'), + isDefault: mapValueOfType(json, r'isDefault'), + notification: mapValueOfType(json, r'notification'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmModeDTO.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 = AlarmModeDTO.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] = AlarmModeDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmModeDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmModeDTO-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] = AlarmModeDTO.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 = AlarmModeDTO.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/mycore_api/lib/model/alarm_mode_geolocalized_mode.dart b/mycore_api/lib/model/alarm_mode_geolocalized_mode.dart new file mode 100644 index 0000000..ffab3bf --- /dev/null +++ b/mycore_api/lib/model/alarm_mode_geolocalized_mode.dart @@ -0,0 +1,139 @@ +// +// 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 AlarmModeGeolocalizedMode { + /// Returns a new [AlarmModeGeolocalizedMode] instance. + AlarmModeGeolocalizedMode({ + this.latitude, + this.longitude, + this.homeMode, + this.absentMode, + }); + + String? latitude; + + String? longitude; + + AlarmMode? homeMode; + + AlarmMode? absentMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeGeolocalizedMode && + other.latitude == latitude && + other.longitude == longitude && + other.homeMode == homeMode && + other.absentMode == absentMode; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (homeMode == null ? 0 : homeMode!.hashCode) + + (absentMode == null ? 0 : absentMode!.hashCode); + + @override + String toString() => 'AlarmModeGeolocalizedMode[latitude=$latitude, longitude=$longitude, homeMode=$homeMode, absentMode=$absentMode]'; + + Map toJson() { + final _json = {}; + if (latitude != null) { + _json[r'latitude'] = latitude; + } + if (longitude != null) { + _json[r'longitude'] = longitude; + } + if (homeMode != null) { + _json[r'homeMode'] = homeMode; + } + if (absentMode != null) { + _json[r'absentMode'] = absentMode; + } + return _json; + } + + /// Returns a new [AlarmModeGeolocalizedMode] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeGeolocalizedMode? 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 "AlarmModeGeolocalizedMode[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeGeolocalizedMode[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeGeolocalizedMode( + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + homeMode: AlarmMode.fromJson(json[r'homeMode']), + absentMode: AlarmMode.fromJson(json[r'absentMode']), + ); + } + 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 = AlarmModeGeolocalizedMode.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 = AlarmModeGeolocalizedMode.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AlarmModeGeolocalizedMode-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 = AlarmModeGeolocalizedMode.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/mycore_api/lib/model/alarm_mode_programmed_mode.dart b/mycore_api/lib/model/alarm_mode_programmed_mode.dart new file mode 100644 index 0000000..7949f66 --- /dev/null +++ b/mycore_api/lib/model/alarm_mode_programmed_mode.dart @@ -0,0 +1,166 @@ +// +// 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 AlarmModeProgrammedMode { + /// Returns a new [AlarmModeProgrammedMode] instance. + AlarmModeProgrammedMode({ + this.monday = const [], + this.tuesday = const [], + this.wednesday = const [], + this.thursday = const [], + this.friday = const [], + this.saturday = const [], + this.sunday = const [], + }); + + List? monday; + + List? tuesday; + + List? wednesday; + + List? thursday; + + List? friday; + + List? saturday; + + List? sunday; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeProgrammedMode && + other.monday == monday && + other.tuesday == tuesday && + other.wednesday == wednesday && + other.thursday == thursday && + other.friday == friday && + other.saturday == saturday && + other.sunday == sunday; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (monday == null ? 0 : monday!.hashCode) + + (tuesday == null ? 0 : tuesday!.hashCode) + + (wednesday == null ? 0 : wednesday!.hashCode) + + (thursday == null ? 0 : thursday!.hashCode) + + (friday == null ? 0 : friday!.hashCode) + + (saturday == null ? 0 : saturday!.hashCode) + + (sunday == null ? 0 : sunday!.hashCode); + + @override + String toString() => 'AlarmModeProgrammedMode[monday=$monday, tuesday=$tuesday, wednesday=$wednesday, thursday=$thursday, friday=$friday, saturday=$saturday, sunday=$sunday]'; + + Map toJson() { + final _json = {}; + if (monday != null) { + _json[r'monday'] = monday; + } + if (tuesday != null) { + _json[r'tuesday'] = tuesday; + } + if (wednesday != null) { + _json[r'wednesday'] = wednesday; + } + if (thursday != null) { + _json[r'thursday'] = thursday; + } + if (friday != null) { + _json[r'friday'] = friday; + } + if (saturday != null) { + _json[r'saturday'] = saturday; + } + if (sunday != null) { + _json[r'sunday'] = sunday; + } + return _json; + } + + /// Returns a new [AlarmModeProgrammedMode] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmModeProgrammedMode? 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 "AlarmModeProgrammedMode[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmModeProgrammedMode[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmModeProgrammedMode( + monday: TimePeriodAlarm.listFromJson(json[r'monday']) ?? const [], + tuesday: TimePeriodAlarm.listFromJson(json[r'tuesday']) ?? const [], + wednesday: TimePeriodAlarm.listFromJson(json[r'wednesday']) ?? const [], + thursday: TimePeriodAlarm.listFromJson(json[r'thursday']) ?? const [], + friday: TimePeriodAlarm.listFromJson(json[r'friday']) ?? const [], + saturday: TimePeriodAlarm.listFromJson(json[r'saturday']) ?? const [], + sunday: TimePeriodAlarm.listFromJson(json[r'sunday']) ?? 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 = AlarmModeProgrammedMode.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 = AlarmModeProgrammedMode.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AlarmModeProgrammedMode-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 = AlarmModeProgrammedMode.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/mycore_api/lib/model/alarm_triggered.dart b/mycore_api/lib/model/alarm_triggered.dart index 04e52c8..71c5fa5 100644 --- a/mycore_api/lib/model/alarm_triggered.dart +++ b/mycore_api/lib/model/alarm_triggered.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; @@ -17,11 +18,17 @@ class AlarmTriggered { this.type, }); - String alarmModeId; + String? alarmModeId; - String alarmModeName; + String? alarmModeName; - AlarmType 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. + /// + AlarmType? type; @override bool operator ==(Object other) => identical(this, other) || other is AlarmTriggered && @@ -31,59 +38,99 @@ class AlarmTriggered { @override int get hashCode => - (alarmModeId == null ? 0 : alarmModeId.hashCode) + - (alarmModeName == null ? 0 : alarmModeName.hashCode) + - (type == null ? 0 : type.hashCode); + // ignore: unnecessary_parenthesis + (alarmModeId == null ? 0 : alarmModeId!.hashCode) + + (alarmModeName == null ? 0 : alarmModeName!.hashCode) + + (type == null ? 0 : type!.hashCode); @override String toString() => 'AlarmTriggered[alarmModeId=$alarmModeId, alarmModeName=$alarmModeName, type=$type]'; Map toJson() { - final json = {}; + final _json = {}; if (alarmModeId != null) { - json[r'alarmModeId'] = alarmModeId; + _json[r'alarmModeId'] = alarmModeId; } if (alarmModeName != null) { - json[r'alarmModeName'] = alarmModeName; + _json[r'alarmModeName'] = alarmModeName; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } - return json; + return _json; } /// Returns a new [AlarmTriggered] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AlarmTriggered fromJson(Map json) => json == null - ? null - : AlarmTriggered( - alarmModeId: json[r'alarmModeId'], - alarmModeName: json[r'alarmModeName'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AlarmTriggered? 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 "AlarmTriggered[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AlarmTriggered[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AlarmTriggered( + alarmModeId: mapValueOfType(json, r'alarmModeId'), + alarmModeName: mapValueOfType(json, r'alarmModeName'), type: AlarmType.fromJson(json[r'type']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => AlarmTriggered.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 = AlarmTriggered.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] = AlarmTriggered.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AlarmTriggered.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AlarmTriggered-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] = AlarmTriggered.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 = AlarmTriggered.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/mycore_api/lib/model/alarm_type.dart b/mycore_api/lib/model/alarm_type.dart index 3cbbc37..3d929b1 100644 --- a/mycore_api/lib/model/alarm_type.dart +++ b/mycore_api/lib/model/alarm_type.dart @@ -1,15 +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; - +/// class AlarmType { /// Instantiate a new enum with the provided [value]. const AlarmType._(this.value); @@ -39,23 +40,28 @@ class AlarmType { custom, ]; - static AlarmType fromJson(dynamic value) => - AlarmTypeTypeTransformer().decode(value); + static AlarmType? fromJson(dynamic value) => AlarmTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => AlarmType.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 = AlarmType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [AlarmType] to String, /// and [decode] dynamic data back to [AlarmType]. class AlarmTypeTypeTransformer { - const AlarmTypeTypeTransformer._(); + factory AlarmTypeTypeTransformer() => _instance ??= const AlarmTypeTypeTransformer._(); - factory AlarmTypeTypeTransformer() => _instance ??= AlarmTypeTypeTransformer._(); + const AlarmTypeTypeTransformer._(); String encode(AlarmType data) => data.value; @@ -67,22 +73,25 @@ class AlarmTypeTypeTransformer { /// /// 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. - AlarmType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Home': return AlarmType.home; - case r'Absent': return AlarmType.absent; - case r'Geolocalized': return AlarmType.geolocalized; - case r'Programmed': return AlarmType.programmed; - case r'Desarmed': return AlarmType.desarmed; - case r'Custom': return AlarmType.custom; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + AlarmType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'Home': return AlarmType.home; + case r'Absent': return AlarmType.absent; + case r'Geolocalized': return AlarmType.geolocalized; + case r'Programmed': return AlarmType.programmed; + case r'Desarmed': return AlarmType.desarmed; + case r'Custom': return AlarmType.custom; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [AlarmTypeTypeTransformer] instance. - static AlarmTypeTypeTransformer _instance; + static AlarmTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/automation_detail_dto.dart b/mycore_api/lib/model/automation_detail_dto.dart index 1e3d4cf..08f5bd1 100644 --- a/mycore_api/lib/model/automation_detail_dto.dart +++ b/mycore_api/lib/model/automation_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,31 +19,49 @@ class AutomationDetailDTO { this.homeId, this.createdDate, this.updatedDate, - this.triggers, - this.conditions, - this.actions, - this.devicesIds, + this.triggers = const [], + this.conditions = const [], + this.actions = const [], + this.devicesIds = const [], }); - String id; + String? id; - String name; + String? name; - bool active; + /// + /// 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? active; - String homeId; + String? homeId; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List triggers; + List? triggers; - List conditions; + List? conditions; - List actions; + List? actions; - List devicesIds; + List? devicesIds; @override bool operator ==(Object other) => identical(this, other) || other is AutomationDetailDTO && @@ -59,100 +78,136 @@ class AutomationDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (active == null ? 0 : active.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (triggers == null ? 0 : triggers.hashCode) + - (conditions == null ? 0 : conditions.hashCode) + - (actions == null ? 0 : actions.hashCode) + - (devicesIds == null ? 0 : devicesIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (active == null ? 0 : active!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (triggers == null ? 0 : triggers!.hashCode) + + (conditions == null ? 0 : conditions!.hashCode) + + (actions == null ? 0 : actions!.hashCode) + + (devicesIds == null ? 0 : devicesIds!.hashCode); @override String toString() => 'AutomationDetailDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (active != null) { - json[r'active'] = active; + _json[r'active'] = active; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (conditions != null) { - json[r'conditions'] = conditions; + _json[r'conditions'] = conditions; } if (actions != null) { - json[r'actions'] = actions; + _json[r'actions'] = actions; } if (devicesIds != null) { - json[r'devicesIds'] = devicesIds; + _json[r'devicesIds'] = devicesIds; } - return json; + return _json; } /// Returns a new [AutomationDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AutomationDetailDTO fromJson(Map json) => json == null - ? null - : AutomationDetailDTO( - id: json[r'id'], - name: json[r'name'], - active: json[r'active'], - homeId: json[r'homeId'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - triggers: Trigger.listFromJson(json[r'triggers']), - conditions: Condition.listFromJson(json[r'conditions']), - actions: Action.listFromJson(json[r'actions']), - devicesIds: json[r'devicesIds'] == null - ? null - : (json[r'devicesIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AutomationDetailDTO? 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) => AutomationDetailDTO.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 "AutomationDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AutomationDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return AutomationDetailDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + active: mapValueOfType(json, r'active'), + homeId: mapValueOfType(json, r'homeId'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + conditions: Condition.listFromJson(json[r'conditions']) ?? const [], + actions: Action.listFromJson(json[r'actions']) ?? const [], + devicesIds: json[r'devicesIds'] is List + ? (json[r'devicesIds'] as List).cast() + : 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 = AutomationDetailDTO.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] = AutomationDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AutomationDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AutomationDetailDTO-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] = AutomationDetailDTO.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 = AutomationDetailDTO.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/mycore_api/lib/model/automation_detail_dto_all_of.dart b/mycore_api/lib/model/automation_detail_dto_all_of.dart index 155dea7..50fad0f 100644 --- a/mycore_api/lib/model/automation_detail_dto_all_of.dart +++ b/mycore_api/lib/model/automation_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; @@ -12,19 +13,19 @@ part of openapi.api; class AutomationDetailDTOAllOf { /// Returns a new [AutomationDetailDTOAllOf] instance. AutomationDetailDTOAllOf({ - this.triggers, - this.conditions, - this.actions, - this.devicesIds, + this.triggers = const [], + this.conditions = const [], + this.actions = const [], + this.devicesIds = const [], }); - List triggers; + List? triggers; - List conditions; + List? conditions; - List actions; + List? actions; - List devicesIds; + List? devicesIds; @override bool operator ==(Object other) => identical(this, other) || other is AutomationDetailDTOAllOf && @@ -35,66 +36,106 @@ class AutomationDetailDTOAllOf { @override int get hashCode => - (triggers == null ? 0 : triggers.hashCode) + - (conditions == null ? 0 : conditions.hashCode) + - (actions == null ? 0 : actions.hashCode) + - (devicesIds == null ? 0 : devicesIds.hashCode); + // ignore: unnecessary_parenthesis + (triggers == null ? 0 : triggers!.hashCode) + + (conditions == null ? 0 : conditions!.hashCode) + + (actions == null ? 0 : actions!.hashCode) + + (devicesIds == null ? 0 : devicesIds!.hashCode); @override String toString() => 'AutomationDetailDTOAllOf[triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; Map toJson() { - final json = {}; + final _json = {}; if (triggers != null) { - json[r'triggers'] = triggers; + _json[r'triggers'] = triggers; } if (conditions != null) { - json[r'conditions'] = conditions; + _json[r'conditions'] = conditions; } if (actions != null) { - json[r'actions'] = actions; + _json[r'actions'] = actions; } if (devicesIds != null) { - json[r'devicesIds'] = devicesIds; + _json[r'devicesIds'] = devicesIds; } - return json; + return _json; } /// Returns a new [AutomationDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AutomationDetailDTOAllOf fromJson(Map json) => json == null - ? null - : AutomationDetailDTOAllOf( - triggers: Trigger.listFromJson(json[r'triggers']), - conditions: Condition.listFromJson(json[r'conditions']), - actions: Action.listFromJson(json[r'actions']), - devicesIds: json[r'devicesIds'] == null - ? null - : (json[r'devicesIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AutomationDetailDTOAllOf? 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) => AutomationDetailDTOAllOf.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 "AutomationDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AutomationDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return AutomationDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']) ?? const [], + conditions: Condition.listFromJson(json[r'conditions']) ?? const [], + actions: Action.listFromJson(json[r'actions']) ?? const [], + devicesIds: json[r'devicesIds'] is List + ? (json[r'devicesIds'] as List).cast() + : 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 = AutomationDetailDTOAllOf.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] = AutomationDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AutomationDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AutomationDetailDTOAllOf-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] = AutomationDetailDTOAllOf.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 = AutomationDetailDTOAllOf.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/mycore_api/lib/model/automation_dto.dart b/mycore_api/lib/model/automation_dto.dart index 1a94deb..0e7f510 100644 --- a/mycore_api/lib/model/automation_dto.dart +++ b/mycore_api/lib/model/automation_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; @@ -20,17 +21,35 @@ class AutomationDTO { this.updatedDate, }); - String id; + String? id; - String name; + String? name; - bool active; + /// + /// 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? active; - String homeId; + String? homeId; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; @override bool operator ==(Object other) => identical(this, other) || other is AutomationDTO && @@ -43,78 +62,114 @@ class AutomationDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (active == null ? 0 : active.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (active == null ? 0 : active!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode); @override String toString() => 'AutomationDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (active != null) { - json[r'active'] = active; + _json[r'active'] = active; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } - return json; + return _json; } /// Returns a new [AutomationDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AutomationDTO fromJson(Map json) => json == null - ? null - : AutomationDTO( - id: json[r'id'], - name: json[r'name'], - active: json[r'active'], - homeId: json[r'homeId'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AutomationDTO? 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) => AutomationDTO.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 "AutomationDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AutomationDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return AutomationDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + active: mapValueOfType(json, r'active'), + homeId: mapValueOfType(json, r'homeId'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + ); + } + 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 = AutomationDTO.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] = AutomationDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AutomationDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AutomationDTO-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] = AutomationDTO.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 = AutomationDTO.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/mycore_api/lib/model/automation_state.dart b/mycore_api/lib/model/automation_state.dart index 7c55189..fc72ac6 100644 --- a/mycore_api/lib/model/automation_state.dart +++ b/mycore_api/lib/model/automation_state.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 AutomationState { this.value, }); - String name; + String? name; - String value; + String? value; @override bool operator ==(Object other) => identical(this, other) || other is AutomationState && @@ -27,54 +28,94 @@ class AutomationState { @override int get hashCode => - (name == null ? 0 : name.hashCode) + - (value == null ? 0 : value.hashCode); + // ignore: unnecessary_parenthesis + (name == null ? 0 : name!.hashCode) + + (value == null ? 0 : value!.hashCode); @override String toString() => 'AutomationState[name=$name, value=$value]'; Map toJson() { - final json = {}; + final _json = {}; if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (value != null) { - json[r'value'] = value; + _json[r'value'] = value; } - return json; + return _json; } /// Returns a new [AutomationState] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AutomationState fromJson(Map json) => json == null - ? null - : AutomationState( - name: json[r'name'], - value: json[r'value'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AutomationState? 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) => AutomationState.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 "AutomationState[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AutomationState[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return AutomationState( + name: mapValueOfType(json, r'name'), + 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 = AutomationState.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] = AutomationState.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AutomationState.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AutomationState-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] = AutomationState.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 = AutomationState.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/mycore_api/lib/model/automation_triggered.dart b/mycore_api/lib/model/automation_triggered.dart index 8fcecbc..a3a5319 100644 --- a/mycore_api/lib/model/automation_triggered.dart +++ b/mycore_api/lib/model/automation_triggered.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 AutomationTriggered { this.automationName, }); - String automationId; + String? automationId; - String automationName; + String? automationName; @override bool operator ==(Object other) => identical(this, other) || other is AutomationTriggered && @@ -27,54 +28,94 @@ class AutomationTriggered { @override int get hashCode => - (automationId == null ? 0 : automationId.hashCode) + - (automationName == null ? 0 : automationName.hashCode); + // ignore: unnecessary_parenthesis + (automationId == null ? 0 : automationId!.hashCode) + + (automationName == null ? 0 : automationName!.hashCode); @override String toString() => 'AutomationTriggered[automationId=$automationId, automationName=$automationName]'; Map toJson() { - final json = {}; + final _json = {}; if (automationId != null) { - json[r'automationId'] = automationId; + _json[r'automationId'] = automationId; } if (automationName != null) { - json[r'automationName'] = automationName; + _json[r'automationName'] = automationName; } - return json; + return _json; } /// Returns a new [AutomationTriggered] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AutomationTriggered fromJson(Map json) => json == null - ? null - : AutomationTriggered( - automationId: json[r'automationId'], - automationName: json[r'automationName'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AutomationTriggered? 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) => AutomationTriggered.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 "AutomationTriggered[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AutomationTriggered[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return AutomationTriggered( + automationId: mapValueOfType(json, r'automationId'), + automationName: mapValueOfType(json, r'automationName'), + ); + } + 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 = AutomationTriggered.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] = AutomationTriggered.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AutomationTriggered.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AutomationTriggered-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] = AutomationTriggered.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 = AutomationTriggered.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/mycore_api/lib/model/azure_ad_auth_model.dart b/mycore_api/lib/model/azure_ad_auth_model.dart index 718d9cb..e3f9eee 100644 --- a/mycore_api/lib/model/azure_ad_auth_model.dart +++ b/mycore_api/lib/model/azure_ad_auth_model.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 AzureADAuthModel { this.apiKey, }); - String apiKey; + String? apiKey; @override bool operator ==(Object other) => identical(this, other) || other is AzureADAuthModel && @@ -23,49 +24,89 @@ class AzureADAuthModel { @override int get hashCode => - (apiKey == null ? 0 : apiKey.hashCode); + // ignore: unnecessary_parenthesis + (apiKey == null ? 0 : apiKey!.hashCode); @override String toString() => 'AzureADAuthModel[apiKey=$apiKey]'; Map toJson() { - final json = {}; + final _json = {}; if (apiKey != null) { - json[r'apiKey'] = apiKey; + _json[r'apiKey'] = apiKey; } - return json; + return _json; } /// Returns a new [AzureADAuthModel] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static AzureADAuthModel fromJson(Map json) => json == null - ? null - : AzureADAuthModel( - apiKey: json[r'apiKey'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AzureADAuthModel? 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) => AzureADAuthModel.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 "AzureADAuthModel[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AzureADAuthModel[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return AzureADAuthModel( + apiKey: mapValueOfType(json, r'apiKey'), + ); + } + 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 = AzureADAuthModel.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] = AzureADAuthModel.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AzureADAuthModel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of AzureADAuthModel-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] = AzureADAuthModel.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 = AzureADAuthModel.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/mycore_api/lib/model/book.dart b/mycore_api/lib/model/book.dart index a36138b..fc45aab 100644 --- a/mycore_api/lib/model/book.dart +++ b/mycore_api/lib/model/book.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,15 +20,21 @@ class Book { this.author, }); - String id; + String? id; - String bookName; + String? bookName; - num price; + /// + /// 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. + /// + num? price; - String category; + String? category; - String author; + String? author; @override bool operator ==(Object other) => identical(this, other) || other is Book && @@ -39,71 +46,111 @@ class Book { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (bookName == null ? 0 : bookName.hashCode) + - (price == null ? 0 : price.hashCode) + - (category == null ? 0 : category.hashCode) + - (author == null ? 0 : author.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (bookName == null ? 0 : bookName!.hashCode) + + (price == null ? 0 : price!.hashCode) + + (category == null ? 0 : category!.hashCode) + + (author == null ? 0 : author!.hashCode); @override String toString() => 'Book[id=$id, bookName=$bookName, price=$price, category=$category, author=$author]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (bookName != null) { - json[r'bookName'] = bookName; + _json[r'bookName'] = bookName; } if (price != null) { - json[r'price'] = price; + _json[r'price'] = price; } if (category != null) { - json[r'category'] = category; + _json[r'category'] = category; } if (author != null) { - json[r'author'] = author; + _json[r'author'] = author; } - return json; + return _json; } /// Returns a new [Book] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static Book fromJson(Map json) => json == null - ? null - : Book( - id: json[r'id'], - bookName: json[r'bookName'], - price: json[r'price'] == null ? - null : - json[r'price'].toDouble(), - category: json[r'category'], - author: json[r'author'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Book? 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) => Book.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 "Book[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Book[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return Book( + id: mapValueOfType(json, r'id'), + bookName: mapValueOfType(json, r'bookName'), + price: json[r'price'] == null + ? null + : num.parse(json[r'price'].toString()), + category: mapValueOfType(json, r'category'), + author: mapValueOfType(json, r'author'), + ); + } + 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 = Book.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] = Book.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Book.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of Book-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] = Book.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 = Book.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/mycore_api/lib/model/condition.dart b/mycore_api/lib/model/condition.dart index 390b350..5e3a0ef 100644 --- a/mycore_api/lib/model/condition.dart +++ b/mycore_api/lib/model/condition.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,17 +21,29 @@ class Condition { this.value, }); - String deviceId; + String? deviceId; - AutomationState state; + ConditionState? state; - String startTime; + String? startTime; - String endTime; + String? endTime; - ConditionType 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. + /// + ConditionType? type; - ConditionValue value; + /// + /// 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. + /// + ConditionValue? value; @override bool operator ==(Object other) => identical(this, other) || other is Condition && @@ -43,74 +56,114 @@ class Condition { @override int get hashCode => - (deviceId == null ? 0 : deviceId.hashCode) + - (state == null ? 0 : state.hashCode) + - (startTime == null ? 0 : startTime.hashCode) + - (endTime == null ? 0 : endTime.hashCode) + - (type == null ? 0 : type.hashCode) + - (value == null ? 0 : value.hashCode); + // ignore: unnecessary_parenthesis + (deviceId == null ? 0 : deviceId!.hashCode) + + (state == null ? 0 : state!.hashCode) + + (startTime == null ? 0 : startTime!.hashCode) + + (endTime == null ? 0 : endTime!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (value == null ? 0 : value!.hashCode); @override String toString() => 'Condition[deviceId=$deviceId, state=$state, startTime=$startTime, endTime=$endTime, type=$type, value=$value]'; Map toJson() { - final json = {}; + final _json = {}; if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (state != null) { - json[r'state'] = state; + _json[r'state'] = state; } if (startTime != null) { - json[r'startTime'] = startTime; + _json[r'startTime'] = startTime; } if (endTime != null) { - json[r'endTime'] = endTime; + _json[r'endTime'] = endTime; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (value != null) { - json[r'value'] = value; + _json[r'value'] = value; } - return json; + return _json; } /// Returns a new [Condition] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static Condition fromJson(Map json) => json == null - ? null - : Condition( - deviceId: json[r'deviceId'], - state: AutomationState.fromJson(json[r'state']), - startTime: json[r'startTime'], - endTime: json[r'endTime'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Condition? 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 "Condition[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Condition[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Condition( + deviceId: mapValueOfType(json, r'deviceId'), + state: ConditionState.fromJson(json[r'state']), + startTime: mapValueOfType(json, r'startTime'), + endTime: mapValueOfType(json, r'endTime'), type: ConditionType.fromJson(json[r'type']), value: ConditionValue.fromJson(json[r'value']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => Condition.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 = Condition.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] = Condition.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Condition.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of Condition-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] = Condition.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 = Condition.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/mycore_api/lib/model/condition_state.dart b/mycore_api/lib/model/condition_state.dart new file mode 100644 index 0000000..ef6fde5 --- /dev/null +++ b/mycore_api/lib/model/condition_state.dart @@ -0,0 +1,121 @@ +// +// 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 ConditionState { + /// Returns a new [ConditionState] instance. + ConditionState({ + this.name, + this.value, + }); + + String? name; + + String? value; + + @override + bool operator ==(Object other) => identical(this, other) || other is ConditionState && + other.name == name && + other.value == value; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (name == null ? 0 : name!.hashCode) + + (value == null ? 0 : value!.hashCode); + + @override + String toString() => 'ConditionState[name=$name, value=$value]'; + + Map toJson() { + final _json = {}; + if (name != null) { + _json[r'name'] = name; + } + if (value != null) { + _json[r'value'] = value; + } + return _json; + } + + /// Returns a new [ConditionState] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ConditionState? 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 "ConditionState[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ConditionState[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ConditionState( + name: mapValueOfType(json, r'name'), + 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 = ConditionState.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 = ConditionState.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ConditionState-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 = ConditionState.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/mycore_api/lib/model/condition_type.dart b/mycore_api/lib/model/condition_type.dart index f95d569..cd39ab6 100644 --- a/mycore_api/lib/model/condition_type.dart +++ b/mycore_api/lib/model/condition_type.dart @@ -1,15 +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; - +/// class ConditionType { /// Instantiate a new enum with the provided [value]. const ConditionType._(this.value); @@ -31,23 +32,28 @@ class ConditionType { TIME, ]; - static ConditionType fromJson(dynamic value) => - ConditionTypeTypeTransformer().decode(value); + static ConditionType? fromJson(dynamic value) => ConditionTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ConditionType.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 = ConditionType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [ConditionType] to String, /// and [decode] dynamic data back to [ConditionType]. class ConditionTypeTypeTransformer { - const ConditionTypeTypeTransformer._(); + factory ConditionTypeTypeTransformer() => _instance ??= const ConditionTypeTypeTransformer._(); - factory ConditionTypeTypeTransformer() => _instance ??= ConditionTypeTypeTransformer._(); + const ConditionTypeTypeTransformer._(); String encode(ConditionType data) => data.value; @@ -59,18 +65,21 @@ class ConditionTypeTypeTransformer { /// /// 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. - ConditionType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'STATE': return ConditionType.STATE; - case r'TIME': return ConditionType.TIME; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ConditionType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'STATE': return ConditionType.STATE; + case r'TIME': return ConditionType.TIME; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ConditionTypeTypeTransformer] instance. - static ConditionTypeTypeTransformer _instance; + static ConditionTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/condition_value.dart b/mycore_api/lib/model/condition_value.dart index aa7d9d2..bea1294 100644 --- a/mycore_api/lib/model/condition_value.dart +++ b/mycore_api/lib/model/condition_value.dart @@ -1,15 +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; - +/// class ConditionValue { /// Instantiate a new enum with the provided [value]. const ConditionValue._(this.value); @@ -39,23 +40,28 @@ class ConditionValue { SMALLEST, ]; - static ConditionValue fromJson(dynamic value) => - ConditionValueTypeTransformer().decode(value); + static ConditionValue? fromJson(dynamic value) => ConditionValueTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ConditionValue.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 = ConditionValue.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [ConditionValue] to String, /// and [decode] dynamic data back to [ConditionValue]. class ConditionValueTypeTransformer { - const ConditionValueTypeTransformer._(); + factory ConditionValueTypeTransformer() => _instance ??= const ConditionValueTypeTransformer._(); - factory ConditionValueTypeTransformer() => _instance ??= ConditionValueTypeTransformer._(); + const ConditionValueTypeTransformer._(); String encode(ConditionValue data) => data.value; @@ -67,22 +73,25 @@ class ConditionValueTypeTransformer { /// /// 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. - ConditionValue decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'EQUAL': return ConditionValue.EQUAL; - case r'NOT_EQUAL': return ConditionValue.NOT_EQUAL; - case r'BIGGER': return ConditionValue.BIGGER; - case r'BIGGEST': return ConditionValue.BIGGEST; - case r'SMALLER': return ConditionValue.SMALLER; - case r'SMALLEST': return ConditionValue.SMALLEST; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ConditionValue? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'EQUAL': return ConditionValue.EQUAL; + case r'NOT_EQUAL': return ConditionValue.NOT_EQUAL; + case r'BIGGER': return ConditionValue.BIGGER; + case r'BIGGEST': return ConditionValue.BIGGEST; + case r'SMALLER': return ConditionValue.SMALLER; + case r'SMALLEST': return ConditionValue.SMALLEST; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ConditionValueTypeTransformer] instance. - static ConditionValueTypeTransformer _instance; + static ConditionValueTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/connection_status.dart b/mycore_api/lib/model/connection_status.dart index b690d09..35642bb 100644 --- a/mycore_api/lib/model/connection_status.dart +++ b/mycore_api/lib/model/connection_status.dart @@ -1,15 +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; - +/// class ConnectionStatus { /// Instantiate a new enum with the provided [value]. const ConnectionStatus._(this.value); @@ -33,23 +34,28 @@ class ConnectionStatus { unknown, ]; - static ConnectionStatus fromJson(dynamic value) => - ConnectionStatusTypeTransformer().decode(value); + static ConnectionStatus? fromJson(dynamic value) => ConnectionStatusTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ConnectionStatus.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 = ConnectionStatus.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [ConnectionStatus] to String, /// and [decode] dynamic data back to [ConnectionStatus]. class ConnectionStatusTypeTransformer { - const ConnectionStatusTypeTransformer._(); + factory ConnectionStatusTypeTransformer() => _instance ??= const ConnectionStatusTypeTransformer._(); - factory ConnectionStatusTypeTransformer() => _instance ??= ConnectionStatusTypeTransformer._(); + const ConnectionStatusTypeTransformer._(); String encode(ConnectionStatus data) => data.value; @@ -61,19 +67,22 @@ class ConnectionStatusTypeTransformer { /// /// 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. - ConnectionStatus decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Connected': return ConnectionStatus.connected; - case r'Disconnected': return ConnectionStatus.disconnected; - case r'Unknown': return ConnectionStatus.unknown; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ConnectionStatus? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'Connected': return ConnectionStatus.connected; + case r'Disconnected': return ConnectionStatus.disconnected; + case r'Unknown': return ConnectionStatus.unknown; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ConnectionStatusTypeTransformer] instance. - static ConnectionStatusTypeTransformer _instance; + static ConnectionStatusTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/create_or_update_home_dto.dart b/mycore_api/lib/model/create_or_update_home_dto.dart index 8bc499e..cee5952 100644 --- a/mycore_api/lib/model/create_or_update_home_dto.dart +++ b/mycore_api/lib/model/create_or_update_home_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; @@ -19,24 +20,48 @@ class CreateOrUpdateHomeDTO { this.currentAlarmMode, this.createdDate, this.updatedDate, - this.usersIds, + this.usersIds = const [], }); - String id; + String? id; - String name; + String? name; - bool isAlarm; + /// + /// 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? isAlarm; - bool isDefault; + /// + /// 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? isDefault; - AlarmModeDTO currentAlarmMode; + AlarmMode? currentAlarmMode; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List usersIds; + List? usersIds; @override bool operator ==(Object other) => identical(this, other) || other is CreateOrUpdateHomeDTO && @@ -51,90 +76,126 @@ class CreateOrUpdateHomeDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (isAlarm == null ? 0 : isAlarm.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (currentAlarmMode == null ? 0 : currentAlarmMode.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (usersIds == null ? 0 : usersIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (isAlarm == null ? 0 : isAlarm!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (currentAlarmMode == null ? 0 : currentAlarmMode!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (usersIds == null ? 0 : usersIds!.hashCode); @override String toString() => 'CreateOrUpdateHomeDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (isAlarm != null) { - json[r'isAlarm'] = isAlarm; + _json[r'isAlarm'] = isAlarm; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (currentAlarmMode != null) { - json[r'currentAlarmMode'] = currentAlarmMode; + _json[r'currentAlarmMode'] = currentAlarmMode; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (usersIds != null) { - json[r'usersIds'] = usersIds; + _json[r'usersIds'] = usersIds; } - return json; + return _json; } /// Returns a new [CreateOrUpdateHomeDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static CreateOrUpdateHomeDTO fromJson(Map json) => json == null - ? null - : CreateOrUpdateHomeDTO( - id: json[r'id'], - name: json[r'name'], - isAlarm: json[r'isAlarm'], - isDefault: json[r'isDefault'], - currentAlarmMode: AlarmModeDTO.fromJson(json[r'currentAlarmMode']), - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - usersIds: json[r'usersIds'] == null - ? null - : (json[r'usersIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateOrUpdateHomeDTO? 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) => CreateOrUpdateHomeDTO.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 "CreateOrUpdateHomeDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateOrUpdateHomeDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return CreateOrUpdateHomeDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + isAlarm: mapValueOfType(json, r'isAlarm'), + isDefault: mapValueOfType(json, r'isDefault'), + currentAlarmMode: AlarmMode.fromJson(json[r'currentAlarmMode']), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + usersIds: json[r'usersIds'] is List + ? (json[r'usersIds'] as List).cast() + : 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 = CreateOrUpdateHomeDTO.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] = CreateOrUpdateHomeDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateOrUpdateHomeDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of CreateOrUpdateHomeDTO-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] = CreateOrUpdateHomeDTO.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 = CreateOrUpdateHomeDTO.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/mycore_api/lib/model/create_or_update_home_dto_all_of.dart b/mycore_api/lib/model/create_or_update_home_dto_all_of.dart index fb66ebf..e1d3425 100644 --- a/mycore_api/lib/model/create_or_update_home_dto_all_of.dart +++ b/mycore_api/lib/model/create_or_update_home_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,10 +13,10 @@ part of openapi.api; class CreateOrUpdateHomeDTOAllOf { /// Returns a new [CreateOrUpdateHomeDTOAllOf] instance. CreateOrUpdateHomeDTOAllOf({ - this.usersIds, + this.usersIds = const [], }); - List usersIds; + List? usersIds; @override bool operator ==(Object other) => identical(this, other) || other is CreateOrUpdateHomeDTOAllOf && @@ -23,51 +24,91 @@ class CreateOrUpdateHomeDTOAllOf { @override int get hashCode => - (usersIds == null ? 0 : usersIds.hashCode); + // ignore: unnecessary_parenthesis + (usersIds == null ? 0 : usersIds!.hashCode); @override String toString() => 'CreateOrUpdateHomeDTOAllOf[usersIds=$usersIds]'; Map toJson() { - final json = {}; + final _json = {}; if (usersIds != null) { - json[r'usersIds'] = usersIds; + _json[r'usersIds'] = usersIds; } - return json; + return _json; } /// Returns a new [CreateOrUpdateHomeDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static CreateOrUpdateHomeDTOAllOf fromJson(Map json) => json == null - ? null - : CreateOrUpdateHomeDTOAllOf( - usersIds: json[r'usersIds'] == null - ? null - : (json[r'usersIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateOrUpdateHomeDTOAllOf? 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) => CreateOrUpdateHomeDTOAllOf.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 "CreateOrUpdateHomeDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateOrUpdateHomeDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return CreateOrUpdateHomeDTOAllOf( + usersIds: json[r'usersIds'] is List + ? (json[r'usersIds'] as List).cast() + : 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 = CreateOrUpdateHomeDTOAllOf.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] = CreateOrUpdateHomeDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateOrUpdateHomeDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of CreateOrUpdateHomeDTOAllOf-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] = CreateOrUpdateHomeDTOAllOf.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 = CreateOrUpdateHomeDTOAllOf.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/mycore_api/lib/model/device_detail_dto.dart b/mycore_api/lib/model/device_detail_dto.dart index 3f24293..c1931a3 100644 --- a/mycore_api/lib/model/device_detail_dto.dart +++ b/mycore_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; @@ -29,71 +30,125 @@ class DeviceDetailDTO { this.firmwareVersion, this.hardwareVersion, this.port, - this.meansOfCommunications, + this.meansOfCommunications = const [], this.createdDate, this.updatedDate, this.lastState, this.ipAddress, this.serviceIdentification, this.manufacturerName, - this.groupIds, + this.groupIds = const [], this.properties, - this.supportedOperations, + this.supportedOperations = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String description; + String? description; - String name; + String? name; - String model; + String? model; - DeviceType 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. + /// + DeviceType? type; - bool status; + /// + /// 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? status; - ConnectionStatus connectionStatus; + /// + /// 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. + /// + ConnectionStatus? connectionStatus; - String roomId; + String? roomId; - String providerId; + String? providerId; - String providerName; + String? providerName; - DateTime lastStateDate; + /// + /// 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? lastStateDate; - bool battery; + /// + /// 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? battery; - int batteryStatus; + /// + /// 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? batteryStatus; - String firmwareVersion; + String? firmwareVersion; - String hardwareVersion; + String? hardwareVersion; - int port; + /// + /// 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? port; - List meansOfCommunications; + List? meansOfCommunications; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - String lastState; + String? lastState; - String ipAddress; + String? ipAddress; - String serviceIdentification; + String? serviceIdentification; - String manufacturerName; + String? manufacturerName; - List groupIds; + List? groupIds; - String properties; + String? properties; - List supportedOperations; + List? supportedOperations; @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && @@ -127,189 +182,223 @@ class DeviceDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (description == null ? 0 : description.hashCode) + - (name == null ? 0 : name.hashCode) + - (model == null ? 0 : model.hashCode) + - (type == null ? 0 : type.hashCode) + - (status == null ? 0 : status.hashCode) + - (connectionStatus == null ? 0 : connectionStatus.hashCode) + - (roomId == null ? 0 : roomId.hashCode) + - (providerId == null ? 0 : providerId.hashCode) + - (providerName == null ? 0 : providerName.hashCode) + - (lastStateDate == null ? 0 : lastStateDate.hashCode) + - (battery == null ? 0 : battery.hashCode) + - (batteryStatus == null ? 0 : batteryStatus.hashCode) + - (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + - (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + - (port == null ? 0 : port.hashCode) + - (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (lastState == null ? 0 : lastState.hashCode) + - (ipAddress == null ? 0 : ipAddress.hashCode) + - (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + - (manufacturerName == null ? 0 : manufacturerName.hashCode) + - (groupIds == null ? 0 : groupIds.hashCode) + - (properties == null ? 0 : properties.hashCode) + - (supportedOperations == null ? 0 : supportedOperations.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (model == null ? 0 : model!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (connectionStatus == null ? 0 : connectionStatus!.hashCode) + + (roomId == null ? 0 : roomId!.hashCode) + + (providerId == null ? 0 : providerId!.hashCode) + + (providerName == null ? 0 : providerName!.hashCode) + + (lastStateDate == null ? 0 : lastStateDate!.hashCode) + + (battery == null ? 0 : battery!.hashCode) + + (batteryStatus == null ? 0 : batteryStatus!.hashCode) + + (firmwareVersion == null ? 0 : firmwareVersion!.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion!.hashCode) + + (port == null ? 0 : port!.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (lastState == null ? 0 : lastState!.hashCode) + + (ipAddress == null ? 0 : ipAddress!.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification!.hashCode) + + (manufacturerName == null ? 0 : manufacturerName!.hashCode) + + (groupIds == null ? 0 : groupIds!.hashCode) + + (properties == null ? 0 : properties!.hashCode) + + (supportedOperations == null ? 0 : supportedOperations!.hashCode); @override String toString() => 'DeviceDetailDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (description != null) { - json[r'description'] = description; + _json[r'description'] = description; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (model != null) { - json[r'model'] = model; + _json[r'model'] = model; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (status != null) { - json[r'status'] = status; + _json[r'status'] = status; } if (connectionStatus != null) { - json[r'connectionStatus'] = connectionStatus; + _json[r'connectionStatus'] = connectionStatus; } if (roomId != null) { - json[r'roomId'] = roomId; + _json[r'roomId'] = roomId; } if (providerId != null) { - json[r'providerId'] = providerId; + _json[r'providerId'] = providerId; } if (providerName != null) { - json[r'providerName'] = providerName; + _json[r'providerName'] = providerName; } if (lastStateDate != null) { - json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + _json[r'lastStateDate'] = lastStateDate!.toUtc().toIso8601String(); } if (battery != null) { - json[r'battery'] = battery; + _json[r'battery'] = battery; } if (batteryStatus != null) { - json[r'batteryStatus'] = batteryStatus; + _json[r'batteryStatus'] = batteryStatus; } if (firmwareVersion != null) { - json[r'firmwareVersion'] = firmwareVersion; + _json[r'firmwareVersion'] = firmwareVersion; } if (hardwareVersion != null) { - json[r'hardwareVersion'] = hardwareVersion; + _json[r'hardwareVersion'] = hardwareVersion; } if (port != null) { - json[r'port'] = port; + _json[r'port'] = port; } if (meansOfCommunications != null) { - json[r'meansOfCommunications'] = meansOfCommunications; + _json[r'meansOfCommunications'] = meansOfCommunications; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (lastState != null) { - json[r'lastState'] = lastState; + _json[r'lastState'] = lastState; } if (ipAddress != null) { - json[r'ipAddress'] = ipAddress; + _json[r'ipAddress'] = ipAddress; } if (serviceIdentification != null) { - json[r'serviceIdentification'] = serviceIdentification; + _json[r'serviceIdentification'] = serviceIdentification; } if (manufacturerName != null) { - json[r'manufacturerName'] = manufacturerName; + _json[r'manufacturerName'] = manufacturerName; } if (groupIds != null) { - json[r'groupIds'] = groupIds; + _json[r'groupIds'] = groupIds; } if (properties != null) { - json[r'properties'] = properties; + _json[r'properties'] = properties; } if (supportedOperations != null) { - json[r'supportedOperations'] = supportedOperations; + _json[r'supportedOperations'] = supportedOperations; } - 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'], - homeId: json[r'homeId'], - description: json[r'description'], - name: json[r'name'], - model: json[r'model'], + /// [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(); + + // 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; + }()); + + return DeviceDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + description: mapValueOfType(json, r'description'), + name: mapValueOfType(json, r'name'), + model: mapValueOfType(json, r'model'), type: DeviceType.fromJson(json[r'type']), - status: json[r'status'], + status: mapValueOfType(json, r'status'), connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), - roomId: json[r'roomId'], - providerId: json[r'providerId'], - providerName: json[r'providerName'], - lastStateDate: json[r'lastStateDate'] == null - ? null - : DateTime.parse(json[r'lastStateDate']), - battery: json[r'battery'], - batteryStatus: json[r'batteryStatus'], - firmwareVersion: json[r'firmwareVersion'], - hardwareVersion: json[r'hardwareVersion'], - port: json[r'port'], - meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - lastState: json[r'lastState'], - ipAddress: json[r'ipAddress'], - serviceIdentification: json[r'serviceIdentification'], - manufacturerName: json[r'manufacturerName'], - groupIds: json[r'groupIds'] == null - ? null - : (json[r'groupIds'] as List).cast(), - properties: json[r'properties'], - supportedOperations: json[r'supportedOperations'] == null - ? null - : (json[r'supportedOperations'] as List).cast(), - ); + roomId: mapValueOfType(json, r'roomId'), + providerId: mapValueOfType(json, r'providerId'), + providerName: mapValueOfType(json, r'providerName'), + lastStateDate: mapDateTime(json, r'lastStateDate', ''), + battery: mapValueOfType(json, r'battery'), + batteryStatus: mapValueOfType(json, r'batteryStatus'), + firmwareVersion: mapValueOfType(json, r'firmwareVersion'), + hardwareVersion: mapValueOfType(json, r'hardwareVersion'), + port: mapValueOfType(json, r'port'), + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']) ?? const [], + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + lastState: mapValueOfType(json, r'lastState'), + ipAddress: mapValueOfType(json, r'ipAddress'), + serviceIdentification: mapValueOfType(json, r'serviceIdentification'), + manufacturerName: mapValueOfType(json, r'manufacturerName'), + groupIds: json[r'groupIds'] is List + ? (json[r'groupIds'] as List).cast() + : const [], + properties: mapValueOfType(json, r'properties'), + supportedOperations: json[r'supportedOperations'] is List + ? (json[r'supportedOperations'] as List).cast() + : const [], + ); + } + return null; + } - 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 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(Map json) { + 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/mycore_api/lib/model/device_detail_dto_all_of.dart b/mycore_api/lib/model/device_detail_dto_all_of.dart index 62a285f..a671cf3 100644 --- a/mycore_api/lib/model/device_detail_dto_all_of.dart +++ b/mycore_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; @@ -15,43 +16,61 @@ class DeviceDetailDTOAllOf { this.firmwareVersion, this.hardwareVersion, this.port, - this.meansOfCommunications, + this.meansOfCommunications = const [], this.createdDate, this.updatedDate, this.lastState, this.ipAddress, this.serviceIdentification, this.manufacturerName, - this.groupIds, + this.groupIds = const [], this.properties, - this.supportedOperations, + this.supportedOperations = const [], }); - String firmwareVersion; + String? firmwareVersion; - String hardwareVersion; + String? hardwareVersion; - int port; + /// + /// 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? port; - List meansOfCommunications; + List? meansOfCommunications; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - String lastState; + String? lastState; - String ipAddress; + String? ipAddress; - String serviceIdentification; + String? serviceIdentification; - String manufacturerName; + String? manufacturerName; - List groupIds; + List? groupIds; - String properties; + String? properties; - List supportedOperations; + List? supportedOperations; @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && @@ -71,117 +90,153 @@ class DeviceDetailDTOAllOf { @override int get hashCode => - (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + - (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + - (port == null ? 0 : port.hashCode) + - (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (lastState == null ? 0 : lastState.hashCode) + - (ipAddress == null ? 0 : ipAddress.hashCode) + - (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + - (manufacturerName == null ? 0 : manufacturerName.hashCode) + - (groupIds == null ? 0 : groupIds.hashCode) + - (properties == null ? 0 : properties.hashCode) + - (supportedOperations == null ? 0 : supportedOperations.hashCode); + // ignore: unnecessary_parenthesis + (firmwareVersion == null ? 0 : firmwareVersion!.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion!.hashCode) + + (port == null ? 0 : port!.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (lastState == null ? 0 : lastState!.hashCode) + + (ipAddress == null ? 0 : ipAddress!.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification!.hashCode) + + (manufacturerName == null ? 0 : manufacturerName!.hashCode) + + (groupIds == null ? 0 : groupIds!.hashCode) + + (properties == null ? 0 : properties!.hashCode) + + (supportedOperations == null ? 0 : supportedOperations!.hashCode); @override String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; Map toJson() { - final json = {}; + final _json = {}; if (firmwareVersion != null) { - json[r'firmwareVersion'] = firmwareVersion; + _json[r'firmwareVersion'] = firmwareVersion; } if (hardwareVersion != null) { - json[r'hardwareVersion'] = hardwareVersion; + _json[r'hardwareVersion'] = hardwareVersion; } if (port != null) { - json[r'port'] = port; + _json[r'port'] = port; } if (meansOfCommunications != null) { - json[r'meansOfCommunications'] = meansOfCommunications; + _json[r'meansOfCommunications'] = meansOfCommunications; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (lastState != null) { - json[r'lastState'] = lastState; + _json[r'lastState'] = lastState; } if (ipAddress != null) { - json[r'ipAddress'] = ipAddress; + _json[r'ipAddress'] = ipAddress; } if (serviceIdentification != null) { - json[r'serviceIdentification'] = serviceIdentification; + _json[r'serviceIdentification'] = serviceIdentification; } if (manufacturerName != null) { - json[r'manufacturerName'] = manufacturerName; + _json[r'manufacturerName'] = manufacturerName; } if (groupIds != null) { - json[r'groupIds'] = groupIds; + _json[r'groupIds'] = groupIds; } if (properties != null) { - json[r'properties'] = properties; + _json[r'properties'] = properties; } if (supportedOperations != null) { - json[r'supportedOperations'] = supportedOperations; + _json[r'supportedOperations'] = supportedOperations; } - 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( - firmwareVersion: json[r'firmwareVersion'], - hardwareVersion: json[r'hardwareVersion'], - port: json[r'port'], - meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - lastState: json[r'lastState'], - ipAddress: json[r'ipAddress'], - serviceIdentification: json[r'serviceIdentification'], - manufacturerName: json[r'manufacturerName'], - groupIds: json[r'groupIds'] == null - ? null - : (json[r'groupIds'] as List).cast(), - properties: json[r'properties'], - supportedOperations: json[r'supportedOperations'] == null - ? null - : (json[r'supportedOperations'] as List).cast(), - ); + /// [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( + firmwareVersion: mapValueOfType(json, r'firmwareVersion'), + hardwareVersion: mapValueOfType(json, r'hardwareVersion'), + port: mapValueOfType(json, r'port'), + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']) ?? const [], + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + lastState: mapValueOfType(json, r'lastState'), + ipAddress: mapValueOfType(json, r'ipAddress'), + serviceIdentification: mapValueOfType(json, r'serviceIdentification'), + manufacturerName: mapValueOfType(json, r'manufacturerName'), + groupIds: json[r'groupIds'] is List + ? (json[r'groupIds'] as List).cast() + : const [], + properties: mapValueOfType(json, r'properties'), + supportedOperations: json[r'supportedOperations'] is List + ? (json[r'supportedOperations'] as List).cast() + : 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 = 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/mycore_api/lib/model/device_state.dart b/mycore_api/lib/model/device_state.dart index f5b19a0..4713a2d 100644 --- a/mycore_api/lib/model/device_state.dart +++ b/mycore_api/lib/model/device_state.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,19 @@ class DeviceState { this.deviceType, }); - String deviceId; + String? deviceId; - String deviceName; + String? deviceName; - String message; + String? message; - DeviceType deviceType; + /// + /// 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. + /// + DeviceType? deviceType; @override bool operator ==(Object other) => identical(this, other) || other is DeviceState && @@ -35,64 +42,104 @@ class DeviceState { @override int get hashCode => - (deviceId == null ? 0 : deviceId.hashCode) + - (deviceName == null ? 0 : deviceName.hashCode) + - (message == null ? 0 : message.hashCode) + - (deviceType == null ? 0 : deviceType.hashCode); + // ignore: unnecessary_parenthesis + (deviceId == null ? 0 : deviceId!.hashCode) + + (deviceName == null ? 0 : deviceName!.hashCode) + + (message == null ? 0 : message!.hashCode) + + (deviceType == null ? 0 : deviceType!.hashCode); @override String toString() => 'DeviceState[deviceId=$deviceId, deviceName=$deviceName, message=$message, deviceType=$deviceType]'; Map toJson() { - final json = {}; + final _json = {}; if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (deviceName != null) { - json[r'deviceName'] = deviceName; + _json[r'deviceName'] = deviceName; } if (message != null) { - json[r'message'] = message; + _json[r'message'] = message; } if (deviceType != null) { - json[r'deviceType'] = deviceType; + _json[r'deviceType'] = deviceType; } - return json; + return _json; } /// Returns a new [DeviceState] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static DeviceState fromJson(Map json) => json == null - ? null - : DeviceState( - deviceId: json[r'deviceId'], - deviceName: json[r'deviceName'], - message: json[r'message'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static DeviceState? 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 "DeviceState[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "DeviceState[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return DeviceState( + deviceId: mapValueOfType(json, r'deviceId'), + deviceName: mapValueOfType(json, r'deviceName'), + message: mapValueOfType(json, r'message'), deviceType: DeviceType.fromJson(json[r'deviceType']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => DeviceState.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 = DeviceState.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] = DeviceState.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceState.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of DeviceState-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] = DeviceState.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 = DeviceState.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/mycore_api/lib/model/device_summary_dto.dart b/mycore_api/lib/model/device_summary_dto.dart index c4c1806..643e2a7 100644 --- a/mycore_api/lib/model/device_summary_dto.dart +++ b/mycore_api/lib/model/device_summary_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; @@ -28,33 +29,69 @@ class DeviceSummaryDTO { this.batteryStatus, }); - String id; + String? id; - String homeId; + String? homeId; - String description; + String? description; - String name; + String? name; - String model; + String? model; - DeviceType 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. + /// + DeviceType? type; - bool status; + /// + /// 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? status; - ConnectionStatus connectionStatus; + /// + /// 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. + /// + ConnectionStatus? connectionStatus; - String roomId; + String? roomId; - String providerId; + String? providerId; - String providerName; + String? providerName; - DateTime lastStateDate; + /// + /// 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? lastStateDate; - bool battery; + /// + /// 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? battery; - int batteryStatus; + /// + /// 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? batteryStatus; @override bool operator ==(Object other) => identical(this, other) || other is DeviceSummaryDTO && @@ -75,116 +112,154 @@ class DeviceSummaryDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (description == null ? 0 : description.hashCode) + - (name == null ? 0 : name.hashCode) + - (model == null ? 0 : model.hashCode) + - (type == null ? 0 : type.hashCode) + - (status == null ? 0 : status.hashCode) + - (connectionStatus == null ? 0 : connectionStatus.hashCode) + - (roomId == null ? 0 : roomId.hashCode) + - (providerId == null ? 0 : providerId.hashCode) + - (providerName == null ? 0 : providerName.hashCode) + - (lastStateDate == null ? 0 : lastStateDate.hashCode) + - (battery == null ? 0 : battery.hashCode) + - (batteryStatus == null ? 0 : batteryStatus.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (model == null ? 0 : model!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (connectionStatus == null ? 0 : connectionStatus!.hashCode) + + (roomId == null ? 0 : roomId!.hashCode) + + (providerId == null ? 0 : providerId!.hashCode) + + (providerName == null ? 0 : providerName!.hashCode) + + (lastStateDate == null ? 0 : lastStateDate!.hashCode) + + (battery == null ? 0 : battery!.hashCode) + + (batteryStatus == null ? 0 : batteryStatus!.hashCode); @override String toString() => 'DeviceSummaryDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (description != null) { - json[r'description'] = description; + _json[r'description'] = description; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (model != null) { - json[r'model'] = model; + _json[r'model'] = model; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (status != null) { - json[r'status'] = status; + _json[r'status'] = status; } if (connectionStatus != null) { - json[r'connectionStatus'] = connectionStatus; + _json[r'connectionStatus'] = connectionStatus; } if (roomId != null) { - json[r'roomId'] = roomId; + _json[r'roomId'] = roomId; } if (providerId != null) { - json[r'providerId'] = providerId; + _json[r'providerId'] = providerId; } if (providerName != null) { - json[r'providerName'] = providerName; + _json[r'providerName'] = providerName; } if (lastStateDate != null) { - json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + _json[r'lastStateDate'] = lastStateDate!.toUtc().toIso8601String(); } if (battery != null) { - json[r'battery'] = battery; + _json[r'battery'] = battery; } if (batteryStatus != null) { - json[r'batteryStatus'] = batteryStatus; + _json[r'batteryStatus'] = batteryStatus; } - return json; + return _json; } /// Returns a new [DeviceSummaryDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static DeviceSummaryDTO fromJson(Map json) => json == null - ? null - : DeviceSummaryDTO( - id: json[r'id'], - homeId: json[r'homeId'], - description: json[r'description'], - name: json[r'name'], - model: json[r'model'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static DeviceSummaryDTO? 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 "DeviceSummaryDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "DeviceSummaryDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return DeviceSummaryDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + description: mapValueOfType(json, r'description'), + name: mapValueOfType(json, r'name'), + model: mapValueOfType(json, r'model'), type: DeviceType.fromJson(json[r'type']), - status: json[r'status'], + status: mapValueOfType(json, r'status'), connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), - roomId: json[r'roomId'], - providerId: json[r'providerId'], - providerName: json[r'providerName'], - lastStateDate: json[r'lastStateDate'] == null - ? null - : DateTime.parse(json[r'lastStateDate']), - battery: json[r'battery'], - batteryStatus: json[r'batteryStatus'], - ); + roomId: mapValueOfType(json, r'roomId'), + providerId: mapValueOfType(json, r'providerId'), + providerName: mapValueOfType(json, r'providerName'), + lastStateDate: mapDateTime(json, r'lastStateDate', ''), + battery: mapValueOfType(json, r'battery'), + batteryStatus: mapValueOfType(json, r'batteryStatus'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => DeviceSummaryDTO.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 = DeviceSummaryDTO.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] = DeviceSummaryDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = DeviceSummaryDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of DeviceSummaryDTO-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] = DeviceSummaryDTO.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 = DeviceSummaryDTO.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/mycore_api/lib/model/device_type.dart b/mycore_api/lib/model/device_type.dart index 46c5ca9..3dcdae2 100644 --- a/mycore_api/lib/model/device_type.dart +++ b/mycore_api/lib/model/device_type.dart @@ -1,15 +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; - +/// class DeviceType { /// Instantiate a new enum with the provided [value]. const DeviceType._(this.value); @@ -57,23 +58,28 @@ class DeviceType { unknown, ]; - static DeviceType fromJson(dynamic value) => - DeviceTypeTypeTransformer().decode(value); + static DeviceType? fromJson(dynamic value) => DeviceTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => DeviceType.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 = DeviceType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [DeviceType] to String, /// and [decode] dynamic data back to [DeviceType]. class DeviceTypeTypeTransformer { - const DeviceTypeTypeTransformer._(); + factory DeviceTypeTypeTransformer() => _instance ??= const DeviceTypeTypeTransformer._(); - factory DeviceTypeTypeTransformer() => _instance ??= DeviceTypeTypeTransformer._(); + const DeviceTypeTypeTransformer._(); String encode(DeviceType data) => data.value; @@ -85,31 +91,34 @@ class DeviceTypeTypeTransformer { /// /// 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. - DeviceType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Sensor': return DeviceType.sensor; - case r'Actuator': return DeviceType.actuator; - case r'Camera': return DeviceType.camera; - case r'Switch': return DeviceType.switch_; - case r'Light': return DeviceType.light; - case r'Sound': return DeviceType.sound; - case r'Plug': return DeviceType.plug; - case r'Multiplug': return DeviceType.multiplug; - case r'Thermostat': return DeviceType.thermostat; - case r'Valve': return DeviceType.valve; - case r'Door': return DeviceType.door; - case r'Environment': return DeviceType.environment; - case r'Motion': return DeviceType.motion; - case r'Gateway': return DeviceType.gateway; - case r'Unknown': return DeviceType.unknown; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + DeviceType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'Sensor': return DeviceType.sensor; + case r'Actuator': return DeviceType.actuator; + case r'Camera': return DeviceType.camera; + case r'Switch': return DeviceType.switch_; + case r'Light': return DeviceType.light; + case r'Sound': return DeviceType.sound; + case r'Plug': return DeviceType.plug; + case r'Multiplug': return DeviceType.multiplug; + case r'Thermostat': return DeviceType.thermostat; + case r'Valve': return DeviceType.valve; + case r'Door': return DeviceType.door; + case r'Environment': return DeviceType.environment; + case r'Motion': return DeviceType.motion; + case r'Gateway': return DeviceType.gateway; + case r'Unknown': return DeviceType.unknown; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [DeviceTypeTypeTransformer] instance. - static DeviceTypeTypeTransformer _instance; + static DeviceTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/electricity_production.dart b/mycore_api/lib/model/electricity_production.dart index 372673c..8cd5381 100644 --- a/mycore_api/lib/model/electricity_production.dart +++ b/mycore_api/lib/model/electricity_production.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,17 +21,35 @@ class ElectricityProduction { this.timestamp, }); - String id; + String? id; - String deviceId; + String? deviceId; - String homeId; + String? homeId; - double watt; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? watt; - double ampere; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? ampere; - DateTime timestamp; + /// + /// 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? timestamp; @override bool operator ==(Object other) => identical(this, other) || other is ElectricityProduction && @@ -43,76 +62,114 @@ class ElectricityProduction { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (deviceId == null ? 0 : deviceId.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (watt == null ? 0 : watt.hashCode) + - (ampere == null ? 0 : ampere.hashCode) + - (timestamp == null ? 0 : timestamp.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (deviceId == null ? 0 : deviceId!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (watt == null ? 0 : watt!.hashCode) + + (ampere == null ? 0 : ampere!.hashCode) + + (timestamp == null ? 0 : timestamp!.hashCode); @override String toString() => 'ElectricityProduction[id=$id, deviceId=$deviceId, homeId=$homeId, watt=$watt, ampere=$ampere, timestamp=$timestamp]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (watt != null) { - json[r'watt'] = watt; + _json[r'watt'] = watt; } if (ampere != null) { - json[r'ampere'] = ampere; + _json[r'ampere'] = ampere; } if (timestamp != null) { - json[r'timestamp'] = timestamp.toUtc().toIso8601String(); + _json[r'timestamp'] = timestamp!.toUtc().toIso8601String(); } - return json; + return _json; } /// Returns a new [ElectricityProduction] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ElectricityProduction fromJson(Map json) => json == null - ? null - : ElectricityProduction( - id: json[r'id'], - deviceId: json[r'deviceId'], - homeId: json[r'homeId'], - watt: json[r'watt'], - ampere: json[r'ampere'], - timestamp: json[r'timestamp'] == null - ? null - : DateTime.parse(json[r'timestamp']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ElectricityProduction? 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) => ElectricityProduction.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 "ElectricityProduction[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ElectricityProduction[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ElectricityProduction( + id: mapValueOfType(json, r'id'), + deviceId: mapValueOfType(json, r'deviceId'), + homeId: mapValueOfType(json, r'homeId'), + watt: mapValueOfType(json, r'watt'), + ampere: mapValueOfType(json, r'ampere'), + timestamp: mapDateTime(json, r'timestamp', ''), + ); + } + 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 = ElectricityProduction.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] = ElectricityProduction.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ElectricityProduction.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ElectricityProduction-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] = ElectricityProduction.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 = ElectricityProduction.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/mycore_api/lib/model/event_detail_dto.dart b/mycore_api/lib/model/event_detail_dto.dart index 23d7689..061dcb3 100644 --- a/mycore_api/lib/model/event_detail_dto.dart +++ b/mycore_api/lib/model/event_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,21 +23,33 @@ class EventDetailDTO { this.alarmTriggered, }); - String id; + String? id; - String homeId; + String? homeId; - DateTime date; + /// + /// 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? date; - EventType 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. + /// + EventType? type; - String roomId; + String? roomId; - DeviceState deviceState; + DeviceState? deviceState; - AutomationTriggered automationTriggered; + AutomationTriggered? automationTriggered; - AlarmTriggered alarmTriggered; + AlarmTriggered? alarmTriggered; @override bool operator ==(Object other) => identical(this, other) || other is EventDetailDTO && @@ -51,86 +64,124 @@ class EventDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (date == null ? 0 : date.hashCode) + - (type == null ? 0 : type.hashCode) + - (roomId == null ? 0 : roomId.hashCode) + - (deviceState == null ? 0 : deviceState.hashCode) + - (automationTriggered == null ? 0 : automationTriggered.hashCode) + - (alarmTriggered == null ? 0 : alarmTriggered.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (date == null ? 0 : date!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (roomId == null ? 0 : roomId!.hashCode) + + (deviceState == null ? 0 : deviceState!.hashCode) + + (automationTriggered == null ? 0 : automationTriggered!.hashCode) + + (alarmTriggered == null ? 0 : alarmTriggered!.hashCode); @override String toString() => 'EventDetailDTO[id=$id, homeId=$homeId, date=$date, type=$type, roomId=$roomId, deviceState=$deviceState, automationTriggered=$automationTriggered, alarmTriggered=$alarmTriggered]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (date != null) { - json[r'date'] = date.toUtc().toIso8601String(); + _json[r'date'] = date!.toUtc().toIso8601String(); } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (roomId != null) { - json[r'roomId'] = roomId; + _json[r'roomId'] = roomId; } if (deviceState != null) { - json[r'deviceState'] = deviceState; + _json[r'deviceState'] = deviceState; } if (automationTriggered != null) { - json[r'automationTriggered'] = automationTriggered; + _json[r'automationTriggered'] = automationTriggered; } if (alarmTriggered != null) { - json[r'alarmTriggered'] = alarmTriggered; + _json[r'alarmTriggered'] = alarmTriggered; } - return json; + return _json; } /// Returns a new [EventDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static EventDetailDTO fromJson(Map json) => json == null - ? null - : EventDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - date: json[r'date'] == null - ? null - : DateTime.parse(json[r'date']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static EventDetailDTO? 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 "EventDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "EventDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return EventDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + date: mapDateTime(json, r'date', ''), type: EventType.fromJson(json[r'type']), - roomId: json[r'roomId'], + roomId: mapValueOfType(json, r'roomId'), deviceState: DeviceState.fromJson(json[r'deviceState']), automationTriggered: AutomationTriggered.fromJson(json[r'automationTriggered']), alarmTriggered: AlarmTriggered.fromJson(json[r'alarmTriggered']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => EventDetailDTO.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 = EventDetailDTO.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] = EventDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = EventDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of EventDetailDTO-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] = EventDetailDTO.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 = EventDetailDTO.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/mycore_api/lib/model/event_detail_dto_all_of.dart b/mycore_api/lib/model/event_detail_dto_all_of.dart index ce7227d..8ddd7ef 100644 --- a/mycore_api/lib/model/event_detail_dto_all_of.dart +++ b/mycore_api/lib/model/event_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; @@ -17,11 +18,11 @@ class EventDetailDTOAllOf { this.alarmTriggered, }); - DeviceState deviceState; + DeviceState? deviceState; - AutomationTriggered automationTriggered; + AutomationTriggered? automationTriggered; - AlarmTriggered alarmTriggered; + AlarmTriggered? alarmTriggered; @override bool operator ==(Object other) => identical(this, other) || other is EventDetailDTOAllOf && @@ -31,59 +32,99 @@ class EventDetailDTOAllOf { @override int get hashCode => - (deviceState == null ? 0 : deviceState.hashCode) + - (automationTriggered == null ? 0 : automationTriggered.hashCode) + - (alarmTriggered == null ? 0 : alarmTriggered.hashCode); + // ignore: unnecessary_parenthesis + (deviceState == null ? 0 : deviceState!.hashCode) + + (automationTriggered == null ? 0 : automationTriggered!.hashCode) + + (alarmTriggered == null ? 0 : alarmTriggered!.hashCode); @override String toString() => 'EventDetailDTOAllOf[deviceState=$deviceState, automationTriggered=$automationTriggered, alarmTriggered=$alarmTriggered]'; Map toJson() { - final json = {}; + final _json = {}; if (deviceState != null) { - json[r'deviceState'] = deviceState; + _json[r'deviceState'] = deviceState; } if (automationTriggered != null) { - json[r'automationTriggered'] = automationTriggered; + _json[r'automationTriggered'] = automationTriggered; } if (alarmTriggered != null) { - json[r'alarmTriggered'] = alarmTriggered; + _json[r'alarmTriggered'] = alarmTriggered; } - return json; + return _json; } /// Returns a new [EventDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static EventDetailDTOAllOf fromJson(Map json) => json == null - ? null - : EventDetailDTOAllOf( + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static EventDetailDTOAllOf? 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 "EventDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "EventDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return EventDetailDTOAllOf( deviceState: DeviceState.fromJson(json[r'deviceState']), automationTriggered: AutomationTriggered.fromJson(json[r'automationTriggered']), alarmTriggered: AlarmTriggered.fromJson(json[r'alarmTriggered']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => EventDetailDTOAllOf.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 = EventDetailDTOAllOf.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] = EventDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = EventDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of EventDetailDTOAllOf-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] = EventDetailDTOAllOf.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 = EventDetailDTOAllOf.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/mycore_api/lib/model/event_dto.dart b/mycore_api/lib/model/event_dto.dart index 5b946e8..cce1b1e 100644 --- a/mycore_api/lib/model/event_dto.dart +++ b/mycore_api/lib/model/event_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; @@ -19,15 +20,27 @@ class EventDTO { this.roomId, }); - String id; + String? id; - String homeId; + String? homeId; - DateTime date; + /// + /// 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? date; - EventType 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. + /// + EventType? type; - String roomId; + String? roomId; @override bool operator ==(Object other) => identical(this, other) || other is EventDTO && @@ -39,71 +52,109 @@ class EventDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (date == null ? 0 : date.hashCode) + - (type == null ? 0 : type.hashCode) + - (roomId == null ? 0 : roomId.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (date == null ? 0 : date!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (roomId == null ? 0 : roomId!.hashCode); @override String toString() => 'EventDTO[id=$id, homeId=$homeId, date=$date, type=$type, roomId=$roomId]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (date != null) { - json[r'date'] = date.toUtc().toIso8601String(); + _json[r'date'] = date!.toUtc().toIso8601String(); } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (roomId != null) { - json[r'roomId'] = roomId; + _json[r'roomId'] = roomId; } - return json; + return _json; } /// Returns a new [EventDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static EventDTO fromJson(Map json) => json == null - ? null - : EventDTO( - id: json[r'id'], - homeId: json[r'homeId'], - date: json[r'date'] == null - ? null - : DateTime.parse(json[r'date']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static EventDTO? 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 "EventDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "EventDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return EventDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + date: mapDateTime(json, r'date', ''), type: EventType.fromJson(json[r'type']), - roomId: json[r'roomId'], - ); + roomId: mapValueOfType(json, r'roomId'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => EventDTO.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 = EventDTO.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] = EventDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = EventDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of EventDTO-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] = EventDTO.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 = EventDTO.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/mycore_api/lib/model/event_filter.dart b/mycore_api/lib/model/event_filter.dart index 5e383ae..e348e4e 100644 --- a/mycore_api/lib/model/event_filter.dart +++ b/mycore_api/lib/model/event_filter.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,17 +21,29 @@ class EventFilter { this.deviceType, }); - int startIndex; + /// + /// 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? startIndex; - int count; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? count; - DateTime dateStart; + DateTime? dateStart; - DateTime dateEnd; + DateTime? dateEnd; - EventType eventType; + EventType? eventType; - DeviceType deviceType; + DeviceType? deviceType; @override bool operator ==(Object other) => identical(this, other) || other is EventFilter && @@ -43,78 +56,114 @@ class EventFilter { @override int get hashCode => - (startIndex == null ? 0 : startIndex.hashCode) + - (count == null ? 0 : count.hashCode) + - (dateStart == null ? 0 : dateStart.hashCode) + - (dateEnd == null ? 0 : dateEnd.hashCode) + - (eventType == null ? 0 : eventType.hashCode) + - (deviceType == null ? 0 : deviceType.hashCode); + // ignore: unnecessary_parenthesis + (startIndex == null ? 0 : startIndex!.hashCode) + + (count == null ? 0 : count!.hashCode) + + (dateStart == null ? 0 : dateStart!.hashCode) + + (dateEnd == null ? 0 : dateEnd!.hashCode) + + (eventType == null ? 0 : eventType!.hashCode) + + (deviceType == null ? 0 : deviceType!.hashCode); @override String toString() => 'EventFilter[startIndex=$startIndex, count=$count, dateStart=$dateStart, dateEnd=$dateEnd, eventType=$eventType, deviceType=$deviceType]'; Map toJson() { - final json = {}; + final _json = {}; if (startIndex != null) { - json[r'startIndex'] = startIndex; + _json[r'startIndex'] = startIndex; } if (count != null) { - json[r'count'] = count; + _json[r'count'] = count; } if (dateStart != null) { - json[r'dateStart'] = dateStart.toUtc().toIso8601String(); + _json[r'dateStart'] = dateStart!.toUtc().toIso8601String(); } if (dateEnd != null) { - json[r'dateEnd'] = dateEnd.toUtc().toIso8601String(); + _json[r'dateEnd'] = dateEnd!.toUtc().toIso8601String(); } if (eventType != null) { - json[r'eventType'] = eventType; + _json[r'eventType'] = eventType; } if (deviceType != null) { - json[r'deviceType'] = deviceType; + _json[r'deviceType'] = deviceType; } - return json; + return _json; } /// Returns a new [EventFilter] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static EventFilter fromJson(Map json) => json == null - ? null - : EventFilter( - startIndex: json[r'startIndex'], - count: json[r'count'], - dateStart: json[r'dateStart'] == null - ? null - : DateTime.parse(json[r'dateStart']), - dateEnd: json[r'dateEnd'] == null - ? null - : DateTime.parse(json[r'dateEnd']), - eventType: EventType.fromJson(json[r'eventType']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static EventFilter? 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 "EventFilter[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "EventFilter[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return EventFilter( + startIndex: mapValueOfType(json, r'startIndex'), + count: mapValueOfType(json, r'count'), + dateStart: mapDateTime(json, r'dateStart', ''), + dateEnd: mapDateTime(json, r'dateEnd', ''), + eventType:EventType.fromJson(json[r'eventType']), deviceType: DeviceType.fromJson(json[r'deviceType']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => EventFilter.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 = EventFilter.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] = EventFilter.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = EventFilter.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of EventFilter-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] = EventFilter.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 = EventFilter.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/mycore_api/lib/model/event_home_filter.dart b/mycore_api/lib/model/event_home_filter.dart index 6b135dd..5f4d4a2 100644 --- a/mycore_api/lib/model/event_home_filter.dart +++ b/mycore_api/lib/model/event_home_filter.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,21 +23,33 @@ class EventHomeFilter { this.roomId, }); - int startIndex; + /// + /// 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? startIndex; - int count; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? count; - DateTime dateStart; + DateTime? dateStart; - DateTime dateEnd; + DateTime? dateEnd; - EventType eventType; + EventType? eventType; - DeviceType deviceType; + DeviceType? deviceType; - String deviceId; + String? deviceId; - String roomId; + String? roomId; @override bool operator ==(Object other) => identical(this, other) || other is EventHomeFilter && @@ -51,88 +64,124 @@ class EventHomeFilter { @override int get hashCode => - (startIndex == null ? 0 : startIndex.hashCode) + - (count == null ? 0 : count.hashCode) + - (dateStart == null ? 0 : dateStart.hashCode) + - (dateEnd == null ? 0 : dateEnd.hashCode) + - (eventType == null ? 0 : eventType.hashCode) + - (deviceType == null ? 0 : deviceType.hashCode) + - (deviceId == null ? 0 : deviceId.hashCode) + - (roomId == null ? 0 : roomId.hashCode); + // ignore: unnecessary_parenthesis + (startIndex == null ? 0 : startIndex!.hashCode) + + (count == null ? 0 : count!.hashCode) + + (dateStart == null ? 0 : dateStart!.hashCode) + + (dateEnd == null ? 0 : dateEnd!.hashCode) + + (eventType == null ? 0 : eventType!.hashCode) + + (deviceType == null ? 0 : deviceType!.hashCode) + + (deviceId == null ? 0 : deviceId!.hashCode) + + (roomId == null ? 0 : roomId!.hashCode); @override String toString() => 'EventHomeFilter[startIndex=$startIndex, count=$count, dateStart=$dateStart, dateEnd=$dateEnd, eventType=$eventType, deviceType=$deviceType, deviceId=$deviceId, roomId=$roomId]'; Map toJson() { - final json = {}; + final _json = {}; if (startIndex != null) { - json[r'startIndex'] = startIndex; + _json[r'startIndex'] = startIndex; } if (count != null) { - json[r'count'] = count; + _json[r'count'] = count; } if (dateStart != null) { - json[r'dateStart'] = dateStart.toUtc().toIso8601String(); + _json[r'dateStart'] = dateStart!.toUtc().toIso8601String(); } if (dateEnd != null) { - json[r'dateEnd'] = dateEnd.toUtc().toIso8601String(); + _json[r'dateEnd'] = dateEnd!.toUtc().toIso8601String(); } if (eventType != null) { - json[r'eventType'] = eventType; + _json[r'eventType'] = eventType; } if (deviceType != null) { - json[r'deviceType'] = deviceType; + _json[r'deviceType'] = deviceType; } if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (roomId != null) { - json[r'roomId'] = roomId; + _json[r'roomId'] = roomId; } - return json; + return _json; } /// Returns a new [EventHomeFilter] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static EventHomeFilter fromJson(Map json) => json == null - ? null - : EventHomeFilter( - startIndex: json[r'startIndex'], - count: json[r'count'], - dateStart: json[r'dateStart'] == null - ? null - : DateTime.parse(json[r'dateStart']), - dateEnd: json[r'dateEnd'] == null - ? null - : DateTime.parse(json[r'dateEnd']), + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static EventHomeFilter? 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 "EventHomeFilter[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "EventHomeFilter[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return EventHomeFilter( + startIndex: mapValueOfType(json, r'startIndex'), + count: mapValueOfType(json, r'count'), + dateStart: mapDateTime(json, r'dateStart', ''), + dateEnd: mapDateTime(json, r'dateEnd', ''), eventType: EventType.fromJson(json[r'eventType']), deviceType: DeviceType.fromJson(json[r'deviceType']), - deviceId: json[r'deviceId'], - roomId: json[r'roomId'], - ); + deviceId: mapValueOfType(json, r'deviceId'), + roomId: mapValueOfType(json, r'roomId'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => EventHomeFilter.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 = EventHomeFilter.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] = EventHomeFilter.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = EventHomeFilter.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of EventHomeFilter-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] = EventHomeFilter.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 = EventHomeFilter.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/mycore_api/lib/model/event_home_filter_all_of.dart b/mycore_api/lib/model/event_home_filter_all_of.dart index d38c19f..e3d2e08 100644 --- a/mycore_api/lib/model/event_home_filter_all_of.dart +++ b/mycore_api/lib/model/event_home_filter_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; @@ -16,9 +17,9 @@ class EventHomeFilterAllOf { this.roomId, }); - String deviceId; + String? deviceId; - String roomId; + String? roomId; @override bool operator ==(Object other) => identical(this, other) || other is EventHomeFilterAllOf && @@ -27,54 +28,94 @@ class EventHomeFilterAllOf { @override int get hashCode => - (deviceId == null ? 0 : deviceId.hashCode) + - (roomId == null ? 0 : roomId.hashCode); + // ignore: unnecessary_parenthesis + (deviceId == null ? 0 : deviceId!.hashCode) + + (roomId == null ? 0 : roomId!.hashCode); @override String toString() => 'EventHomeFilterAllOf[deviceId=$deviceId, roomId=$roomId]'; Map toJson() { - final json = {}; + final _json = {}; if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (roomId != null) { - json[r'roomId'] = roomId; + _json[r'roomId'] = roomId; } - return json; + return _json; } /// Returns a new [EventHomeFilterAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static EventHomeFilterAllOf fromJson(Map json) => json == null - ? null - : EventHomeFilterAllOf( - deviceId: json[r'deviceId'], - roomId: json[r'roomId'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static EventHomeFilterAllOf? 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) => EventHomeFilterAllOf.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 "EventHomeFilterAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "EventHomeFilterAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return EventHomeFilterAllOf( + deviceId: mapValueOfType(json, r'deviceId'), + roomId: mapValueOfType(json, r'roomId'), + ); + } + 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 = EventHomeFilterAllOf.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] = EventHomeFilterAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = EventHomeFilterAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of EventHomeFilterAllOf-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] = EventHomeFilterAllOf.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 = EventHomeFilterAllOf.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/mycore_api/lib/model/event_type.dart b/mycore_api/lib/model/event_type.dart index 40bbe60..c0951f9 100644 --- a/mycore_api/lib/model/event_type.dart +++ b/mycore_api/lib/model/event_type.dart @@ -1,15 +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; - +/// class EventType { /// Instantiate a new enum with the provided [value]. const EventType._(this.value); @@ -33,23 +34,28 @@ class EventType { alarmTriggered, ]; - static EventType fromJson(dynamic value) => - EventTypeTypeTransformer().decode(value); + static EventType? fromJson(dynamic value) => EventTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => EventType.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 = EventType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [EventType] to String, /// and [decode] dynamic data back to [EventType]. class EventTypeTypeTransformer { - const EventTypeTypeTransformer._(); + factory EventTypeTypeTransformer() => _instance ??= const EventTypeTypeTransformer._(); - factory EventTypeTypeTransformer() => _instance ??= EventTypeTypeTransformer._(); + const EventTypeTypeTransformer._(); String encode(EventType data) => data.value; @@ -61,19 +67,22 @@ class EventTypeTypeTransformer { /// /// 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. - EventType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'DeviceState': return EventType.deviceState; - case r'AutomationTriggered': return EventType.automationTriggered; - case r'AlarmTriggered': return EventType.alarmTriggered; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + EventType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'DeviceState': return EventType.deviceState; + case r'AutomationTriggered': return EventType.automationTriggered; + case r'AlarmTriggered': return EventType.alarmTriggered; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [EventTypeTypeTransformer] instance. - static EventTypeTypeTransformer _instance; + static EventTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/facebook_auth_model.dart b/mycore_api/lib/model/facebook_auth_model.dart index f4b35f2..6143f7c 100644 --- a/mycore_api/lib/model/facebook_auth_model.dart +++ b/mycore_api/lib/model/facebook_auth_model.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 FacebookAuthModel { this.userAccessToken, }); - String userAccessToken; + String? userAccessToken; @override bool operator ==(Object other) => identical(this, other) || other is FacebookAuthModel && @@ -23,49 +24,89 @@ class FacebookAuthModel { @override int get hashCode => - (userAccessToken == null ? 0 : userAccessToken.hashCode); + // ignore: unnecessary_parenthesis + (userAccessToken == null ? 0 : userAccessToken!.hashCode); @override String toString() => 'FacebookAuthModel[userAccessToken=$userAccessToken]'; Map toJson() { - final json = {}; + final _json = {}; if (userAccessToken != null) { - json[r'userAccessToken'] = userAccessToken; + _json[r'userAccessToken'] = userAccessToken; } - return json; + return _json; } /// Returns a new [FacebookAuthModel] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static FacebookAuthModel fromJson(Map json) => json == null - ? null - : FacebookAuthModel( - userAccessToken: json[r'userAccessToken'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static FacebookAuthModel? 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) => FacebookAuthModel.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 "FacebookAuthModel[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "FacebookAuthModel[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return FacebookAuthModel( + userAccessToken: mapValueOfType(json, r'userAccessToken'), + ); + } + 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 = FacebookAuthModel.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] = FacebookAuthModel.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = FacebookAuthModel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of FacebookAuthModel-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] = FacebookAuthModel.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 = FacebookAuthModel.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/mycore_api/lib/model/geolocalized_mode.dart b/mycore_api/lib/model/geolocalized_mode.dart index e67fc94..ff1dbbc 100644 --- a/mycore_api/lib/model/geolocalized_mode.dart +++ b/mycore_api/lib/model/geolocalized_mode.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 GeolocalizedMode { this.absentMode, }); - String latitude; + String? latitude; - String longitude; + String? longitude; - AlarmMode homeMode; + AlarmMode? homeMode; - AlarmMode absentMode; + AlarmMode? absentMode; @override bool operator ==(Object other) => identical(this, other) || other is GeolocalizedMode && @@ -35,64 +36,104 @@ class GeolocalizedMode { @override int get hashCode => - (latitude == null ? 0 : latitude.hashCode) + - (longitude == null ? 0 : longitude.hashCode) + - (homeMode == null ? 0 : homeMode.hashCode) + - (absentMode == null ? 0 : absentMode.hashCode); + // ignore: unnecessary_parenthesis + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (homeMode == null ? 0 : homeMode!.hashCode) + + (absentMode == null ? 0 : absentMode!.hashCode); @override String toString() => 'GeolocalizedMode[latitude=$latitude, longitude=$longitude, homeMode=$homeMode, absentMode=$absentMode]'; Map toJson() { - final json = {}; + final _json = {}; if (latitude != null) { - json[r'latitude'] = latitude; + _json[r'latitude'] = latitude; } if (longitude != null) { - json[r'longitude'] = longitude; + _json[r'longitude'] = longitude; } if (homeMode != null) { - json[r'homeMode'] = homeMode; + _json[r'homeMode'] = homeMode; } if (absentMode != null) { - json[r'absentMode'] = absentMode; + _json[r'absentMode'] = absentMode; } - return json; + return _json; } /// Returns a new [GeolocalizedMode] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GeolocalizedMode fromJson(Map json) => json == null - ? null - : GeolocalizedMode( - latitude: json[r'latitude'], - longitude: json[r'longitude'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeolocalizedMode? 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 "GeolocalizedMode[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GeolocalizedMode[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeolocalizedMode( + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), homeMode: AlarmMode.fromJson(json[r'homeMode']), absentMode: AlarmMode.fromJson(json[r'absentMode']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => GeolocalizedMode.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 = GeolocalizedMode.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] = GeolocalizedMode.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GeolocalizedMode.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GeolocalizedMode-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] = GeolocalizedMode.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 = GeolocalizedMode.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/mycore_api/lib/model/google_auth_model.dart b/mycore_api/lib/model/google_auth_model.dart index 3f55cfa..c676821 100644 --- a/mycore_api/lib/model/google_auth_model.dart +++ b/mycore_api/lib/model/google_auth_model.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 GoogleAuthModel { this.apiKey, }); - String authorizationCode; + String? authorizationCode; - String apiKey; + String? apiKey; @override bool operator ==(Object other) => identical(this, other) || other is GoogleAuthModel && @@ -27,54 +28,94 @@ class GoogleAuthModel { @override int get hashCode => - (authorizationCode == null ? 0 : authorizationCode.hashCode) + - (apiKey == null ? 0 : apiKey.hashCode); + // ignore: unnecessary_parenthesis + (authorizationCode == null ? 0 : authorizationCode!.hashCode) + + (apiKey == null ? 0 : apiKey!.hashCode); @override String toString() => 'GoogleAuthModel[authorizationCode=$authorizationCode, apiKey=$apiKey]'; Map toJson() { - final json = {}; + final _json = {}; if (authorizationCode != null) { - json[r'authorizationCode'] = authorizationCode; + _json[r'authorizationCode'] = authorizationCode; } if (apiKey != null) { - json[r'apiKey'] = apiKey; + _json[r'apiKey'] = apiKey; } - return json; + return _json; } /// Returns a new [GoogleAuthModel] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GoogleAuthModel fromJson(Map json) => json == null - ? null - : GoogleAuthModel( - authorizationCode: json[r'authorizationCode'], - apiKey: json[r'apiKey'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GoogleAuthModel? 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) => GoogleAuthModel.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 "GoogleAuthModel[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GoogleAuthModel[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GoogleAuthModel( + authorizationCode: mapValueOfType(json, r'authorizationCode'), + apiKey: mapValueOfType(json, r'apiKey'), + ); + } + 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 = GoogleAuthModel.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] = GoogleAuthModel.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GoogleAuthModel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GoogleAuthModel-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] = GoogleAuthModel.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 = GoogleAuthModel.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/mycore_api/lib/model/group_create_or_update_detail_dto.dart b/mycore_api/lib/model/group_create_or_update_detail_dto.dart index fd468a0..8b49502 100644 --- a/mycore_api/lib/model/group_create_or_update_detail_dto.dart +++ b/mycore_api/lib/model/group_create_or_update_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; @@ -17,20 +18,26 @@ class GroupCreateOrUpdateDetailDTO { this.name, this.type, this.isAlarm, - this.deviceIds, + this.deviceIds = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - String type; + String? type; - bool isAlarm; + /// + /// 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? isAlarm; - List deviceIds; + List? deviceIds; @override bool operator ==(Object other) => identical(this, other) || other is GroupCreateOrUpdateDetailDTO && @@ -43,76 +50,116 @@ class GroupCreateOrUpdateDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (isAlarm == null ? 0 : isAlarm.hashCode) + - (deviceIds == null ? 0 : deviceIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (isAlarm == null ? 0 : isAlarm!.hashCode) + + (deviceIds == null ? 0 : deviceIds!.hashCode); @override String toString() => 'GroupCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, isAlarm=$isAlarm, deviceIds=$deviceIds]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (isAlarm != null) { - json[r'isAlarm'] = isAlarm; + _json[r'isAlarm'] = isAlarm; } if (deviceIds != null) { - json[r'deviceIds'] = deviceIds; + _json[r'deviceIds'] = deviceIds; } - return json; + return _json; } /// Returns a new [GroupCreateOrUpdateDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GroupCreateOrUpdateDetailDTO fromJson(Map json) => json == null - ? null - : GroupCreateOrUpdateDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - type: json[r'type'], - isAlarm: json[r'isAlarm'], - deviceIds: json[r'deviceIds'] == null - ? null - : (json[r'deviceIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GroupCreateOrUpdateDetailDTO? 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) => GroupCreateOrUpdateDetailDTO.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 "GroupCreateOrUpdateDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GroupCreateOrUpdateDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GroupCreateOrUpdateDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + type: mapValueOfType(json, r'type'), + isAlarm: mapValueOfType(json, r'isAlarm'), + deviceIds: json[r'deviceIds'] is List + ? (json[r'deviceIds'] as List).cast() + : 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 = GroupCreateOrUpdateDetailDTO.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] = GroupCreateOrUpdateDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GroupCreateOrUpdateDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GroupCreateOrUpdateDetailDTO-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] = GroupCreateOrUpdateDetailDTO.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 = GroupCreateOrUpdateDetailDTO.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/mycore_api/lib/model/group_create_or_update_detail_dto_all_of.dart b/mycore_api/lib/model/group_create_or_update_detail_dto_all_of.dart index e1cf089..2e7befe 100644 --- a/mycore_api/lib/model/group_create_or_update_detail_dto_all_of.dart +++ b/mycore_api/lib/model/group_create_or_update_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; @@ -12,10 +13,10 @@ part of openapi.api; class GroupCreateOrUpdateDetailDTOAllOf { /// Returns a new [GroupCreateOrUpdateDetailDTOAllOf] instance. GroupCreateOrUpdateDetailDTOAllOf({ - this.deviceIds, + this.deviceIds = const [], }); - List deviceIds; + List? deviceIds; @override bool operator ==(Object other) => identical(this, other) || other is GroupCreateOrUpdateDetailDTOAllOf && @@ -23,51 +24,91 @@ class GroupCreateOrUpdateDetailDTOAllOf { @override int get hashCode => - (deviceIds == null ? 0 : deviceIds.hashCode); + // ignore: unnecessary_parenthesis + (deviceIds == null ? 0 : deviceIds!.hashCode); @override String toString() => 'GroupCreateOrUpdateDetailDTOAllOf[deviceIds=$deviceIds]'; Map toJson() { - final json = {}; + final _json = {}; if (deviceIds != null) { - json[r'deviceIds'] = deviceIds; + _json[r'deviceIds'] = deviceIds; } - return json; + return _json; } /// Returns a new [GroupCreateOrUpdateDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GroupCreateOrUpdateDetailDTOAllOf fromJson(Map json) => json == null - ? null - : GroupCreateOrUpdateDetailDTOAllOf( - deviceIds: json[r'deviceIds'] == null - ? null - : (json[r'deviceIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GroupCreateOrUpdateDetailDTOAllOf? 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) => GroupCreateOrUpdateDetailDTOAllOf.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 "GroupCreateOrUpdateDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GroupCreateOrUpdateDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GroupCreateOrUpdateDetailDTOAllOf( + deviceIds: json[r'deviceIds'] is List + ? (json[r'deviceIds'] as List).cast() + : 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 = GroupCreateOrUpdateDetailDTOAllOf.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] = GroupCreateOrUpdateDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GroupCreateOrUpdateDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GroupCreateOrUpdateDetailDTOAllOf-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] = GroupCreateOrUpdateDetailDTOAllOf.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 = GroupCreateOrUpdateDetailDTOAllOf.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/mycore_api/lib/model/group_detail_dto.dart b/mycore_api/lib/model/group_detail_dto.dart index af908d0..8359fe8 100644 --- a/mycore_api/lib/model/group_detail_dto.dart +++ b/mycore_api/lib/model/group_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; @@ -19,24 +20,42 @@ class GroupDetailDTO { this.isAlarm, this.createdDate, this.updatedDate, - this.devices, + this.devices = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - String type; + String? type; - bool isAlarm; + /// + /// 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? isAlarm; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List devices; + List? devices; @override bool operator ==(Object other) => identical(this, other) || other is GroupDetailDTO && @@ -51,88 +70,124 @@ class GroupDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (isAlarm == null ? 0 : isAlarm.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (devices == null ? 0 : devices.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (isAlarm == null ? 0 : isAlarm!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (devices == null ? 0 : devices!.hashCode); @override String toString() => 'GroupDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, isAlarm=$isAlarm, createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (isAlarm != null) { - json[r'isAlarm'] = isAlarm; + _json[r'isAlarm'] = isAlarm; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } - return json; + return _json; } /// Returns a new [GroupDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GroupDetailDTO fromJson(Map json) => json == null - ? null - : GroupDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - type: json[r'type'], - isAlarm: json[r'isAlarm'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - devices: DeviceDetailDTO.listFromJson(json[r'devices']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GroupDetailDTO? 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) => GroupDetailDTO.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 "GroupDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GroupDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GroupDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + type: mapValueOfType(json, r'type'), + isAlarm: mapValueOfType(json, r'isAlarm'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? 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 = GroupDetailDTO.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] = GroupDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GroupDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GroupDetailDTO-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] = GroupDetailDTO.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 = GroupDetailDTO.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/mycore_api/lib/model/group_detail_dto_all_of.dart b/mycore_api/lib/model/group_detail_dto_all_of.dart index 1b10d52..d32a441 100644 --- a/mycore_api/lib/model/group_detail_dto_all_of.dart +++ b/mycore_api/lib/model/group_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; @@ -14,14 +15,26 @@ class GroupDetailDTOAllOf { GroupDetailDTOAllOf({ this.createdDate, this.updatedDate, - this.devices, + this.devices = const [], }); - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List devices; + List? devices; @override bool operator ==(Object other) => identical(this, other) || other is GroupDetailDTOAllOf && @@ -31,63 +44,99 @@ class GroupDetailDTOAllOf { @override int get hashCode => - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (devices == null ? 0 : devices.hashCode); + // ignore: unnecessary_parenthesis + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (devices == null ? 0 : devices!.hashCode); @override String toString() => 'GroupDetailDTOAllOf[createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; Map toJson() { - final json = {}; + final _json = {}; if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } - return json; + return _json; } /// Returns a new [GroupDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GroupDetailDTOAllOf fromJson(Map json) => json == null - ? null - : GroupDetailDTOAllOf( - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - devices: DeviceDetailDTO.listFromJson(json[r'devices']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GroupDetailDTOAllOf? 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) => GroupDetailDTOAllOf.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 "GroupDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GroupDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GroupDetailDTOAllOf( + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? 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 = GroupDetailDTOAllOf.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] = GroupDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GroupDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GroupDetailDTOAllOf-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] = GroupDetailDTOAllOf.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 = GroupDetailDTOAllOf.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/mycore_api/lib/model/group_summary_dto.dart b/mycore_api/lib/model/group_summary_dto.dart index 9cd29b8..e465c02 100644 --- a/mycore_api/lib/model/group_summary_dto.dart +++ b/mycore_api/lib/model/group_summary_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; @@ -19,15 +20,21 @@ class GroupSummaryDTO { this.isAlarm, }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - String type; + String? type; - bool isAlarm; + /// + /// 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? isAlarm; @override bool operator ==(Object other) => identical(this, other) || other is GroupSummaryDTO && @@ -39,69 +46,109 @@ class GroupSummaryDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (isAlarm == null ? 0 : isAlarm.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (isAlarm == null ? 0 : isAlarm!.hashCode); @override String toString() => 'GroupSummaryDTO[id=$id, homeId=$homeId, name=$name, type=$type, isAlarm=$isAlarm]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (isAlarm != null) { - json[r'isAlarm'] = isAlarm; + _json[r'isAlarm'] = isAlarm; } - return json; + return _json; } /// Returns a new [GroupSummaryDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static GroupSummaryDTO fromJson(Map json) => json == null - ? null - : GroupSummaryDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - type: json[r'type'], - isAlarm: json[r'isAlarm'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GroupSummaryDTO? 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) => GroupSummaryDTO.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 "GroupSummaryDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GroupSummaryDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return GroupSummaryDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + type: mapValueOfType(json, r'type'), + isAlarm: mapValueOfType(json, r'isAlarm'), + ); + } + 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 = GroupSummaryDTO.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] = GroupSummaryDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GroupSummaryDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of GroupSummaryDTO-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] = GroupSummaryDTO.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 = GroupSummaryDTO.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/mycore_api/lib/model/home_detail_dto.dart b/mycore_api/lib/model/home_detail_dto.dart index 0c99b6c..6c8c2f8 100644 --- a/mycore_api/lib/model/home_detail_dto.dart +++ b/mycore_api/lib/model/home_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; @@ -19,39 +20,63 @@ class HomeDetailDTO { this.currentAlarmMode, this.createdDate, this.updatedDate, - this.usersIds, - this.users, - this.devices, - this.automations, - this.providers, - this.groups, + this.usersIds = const [], + this.users = const [], + this.devices = const [], + this.automations = const [], + this.providers = const [], + this.groups = const [], }); - String id; + String? id; - String name; + String? name; - bool isAlarm; + /// + /// 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? isAlarm; - bool isDefault; + /// + /// 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? isDefault; - AlarmModeDTO currentAlarmMode; + AlarmMode? currentAlarmMode; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List usersIds; + List? usersIds; - List users; + List? users; - List devices; + List? devices; - List automations; + List? automations; - List providers; + List? providers; - List groups; + List? groups; @override bool operator ==(Object other) => identical(this, other) || other is HomeDetailDTO && @@ -71,115 +96,151 @@ class HomeDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (isAlarm == null ? 0 : isAlarm.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (currentAlarmMode == null ? 0 : currentAlarmMode.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (usersIds == null ? 0 : usersIds.hashCode) + - (users == null ? 0 : users.hashCode) + - (devices == null ? 0 : devices.hashCode) + - (automations == null ? 0 : automations.hashCode) + - (providers == null ? 0 : providers.hashCode) + - (groups == null ? 0 : groups.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (isAlarm == null ? 0 : isAlarm!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (currentAlarmMode == null ? 0 : currentAlarmMode!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (usersIds == null ? 0 : usersIds!.hashCode) + + (users == null ? 0 : users!.hashCode) + + (devices == null ? 0 : devices!.hashCode) + + (automations == null ? 0 : automations!.hashCode) + + (providers == null ? 0 : providers!.hashCode) + + (groups == null ? 0 : groups!.hashCode); @override String toString() => 'HomeDetailDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds, users=$users, devices=$devices, automations=$automations, providers=$providers, groups=$groups]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (isAlarm != null) { - json[r'isAlarm'] = isAlarm; + _json[r'isAlarm'] = isAlarm; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (currentAlarmMode != null) { - json[r'currentAlarmMode'] = currentAlarmMode; + _json[r'currentAlarmMode'] = currentAlarmMode; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (usersIds != null) { - json[r'usersIds'] = usersIds; + _json[r'usersIds'] = usersIds; } if (users != null) { - json[r'users'] = users; + _json[r'users'] = users; } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } if (automations != null) { - json[r'automations'] = automations; + _json[r'automations'] = automations; } if (providers != null) { - json[r'providers'] = providers; + _json[r'providers'] = providers; } if (groups != null) { - json[r'groups'] = groups; + _json[r'groups'] = groups; } - return json; + return _json; } /// Returns a new [HomeDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static HomeDetailDTO fromJson(Map json) => json == null - ? null - : HomeDetailDTO( - id: json[r'id'], - name: json[r'name'], - isAlarm: json[r'isAlarm'], - isDefault: json[r'isDefault'], - currentAlarmMode: AlarmModeDTO.fromJson(json[r'currentAlarmMode']), - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - usersIds: json[r'usersIds'] == null - ? null - : (json[r'usersIds'] as List).cast(), - users: UserInfoDetailDTO.listFromJson(json[r'users']), - devices: DeviceSummaryDTO.listFromJson(json[r'devices']), - automations: AutomationDTO.listFromJson(json[r'automations']), - providers: ProviderDTO.listFromJson(json[r'providers']), - groups: GroupSummaryDTO.listFromJson(json[r'groups']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static HomeDetailDTO? 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) => HomeDetailDTO.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 "HomeDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "HomeDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return HomeDetailDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + isAlarm: mapValueOfType(json, r'isAlarm'), + isDefault: mapValueOfType(json, r'isDefault'), + currentAlarmMode: AlarmMode.fromJson(json[r'currentAlarmMode']), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + usersIds: json[r'usersIds'] is List + ? (json[r'usersIds'] as List).cast() + : const [], + users: UserInfoDetailDTO.listFromJson(json[r'users']) ?? const [], + devices: DeviceSummaryDTO.listFromJson(json[r'devices']) ?? const [], + automations: AutomationDTO.listFromJson(json[r'automations']) ?? const [], + providers: ProviderDTO.listFromJson(json[r'providers']) ?? const [], + groups: GroupSummaryDTO.listFromJson(json[r'groups']) ?? 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 = HomeDetailDTO.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] = HomeDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = HomeDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of HomeDetailDTO-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] = HomeDetailDTO.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 = HomeDetailDTO.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/mycore_api/lib/model/home_detail_dto_all_of.dart b/mycore_api/lib/model/home_detail_dto_all_of.dart index 206bc6b..624b156 100644 --- a/mycore_api/lib/model/home_detail_dto_all_of.dart +++ b/mycore_api/lib/model/home_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; @@ -12,22 +13,22 @@ part of openapi.api; class HomeDetailDTOAllOf { /// Returns a new [HomeDetailDTOAllOf] instance. HomeDetailDTOAllOf({ - this.users, - this.devices, - this.automations, - this.providers, - this.groups, + this.users = const [], + this.devices = const [], + this.automations = const [], + this.providers = const [], + this.groups = const [], }); - List users; + List? users; - List devices; + List? devices; - List automations; + List? automations; - List providers; + List? providers; - List groups; + List? groups; @override bool operator ==(Object other) => identical(this, other) || other is HomeDetailDTOAllOf && @@ -39,69 +40,109 @@ class HomeDetailDTOAllOf { @override int get hashCode => - (users == null ? 0 : users.hashCode) + - (devices == null ? 0 : devices.hashCode) + - (automations == null ? 0 : automations.hashCode) + - (providers == null ? 0 : providers.hashCode) + - (groups == null ? 0 : groups.hashCode); + // ignore: unnecessary_parenthesis + (users == null ? 0 : users!.hashCode) + + (devices == null ? 0 : devices!.hashCode) + + (automations == null ? 0 : automations!.hashCode) + + (providers == null ? 0 : providers!.hashCode) + + (groups == null ? 0 : groups!.hashCode); @override String toString() => 'HomeDetailDTOAllOf[users=$users, devices=$devices, automations=$automations, providers=$providers, groups=$groups]'; Map toJson() { - final json = {}; + final _json = {}; if (users != null) { - json[r'users'] = users; + _json[r'users'] = users; } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } if (automations != null) { - json[r'automations'] = automations; + _json[r'automations'] = automations; } if (providers != null) { - json[r'providers'] = providers; + _json[r'providers'] = providers; } if (groups != null) { - json[r'groups'] = groups; + _json[r'groups'] = groups; } - return json; + return _json; } /// Returns a new [HomeDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static HomeDetailDTOAllOf fromJson(Map json) => json == null - ? null - : HomeDetailDTOAllOf( - users: UserInfoDetailDTO.listFromJson(json[r'users']), - devices: DeviceSummaryDTO.listFromJson(json[r'devices']), - automations: AutomationDTO.listFromJson(json[r'automations']), - providers: ProviderDTO.listFromJson(json[r'providers']), - groups: GroupSummaryDTO.listFromJson(json[r'groups']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static HomeDetailDTOAllOf? 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) => HomeDetailDTOAllOf.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 "HomeDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "HomeDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return HomeDetailDTOAllOf( + users: UserInfoDetailDTO.listFromJson(json[r'users']) ?? const [], + devices: DeviceSummaryDTO.listFromJson(json[r'devices']) ?? const [], + automations: AutomationDTO.listFromJson(json[r'automations']) ?? const [], + providers: ProviderDTO.listFromJson(json[r'providers']) ?? const [], + groups: GroupSummaryDTO.listFromJson(json[r'groups']) ?? 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 = HomeDetailDTOAllOf.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] = HomeDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = HomeDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of HomeDetailDTOAllOf-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] = HomeDetailDTOAllOf.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 = HomeDetailDTOAllOf.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/mycore_api/lib/model/home_dto.dart b/mycore_api/lib/model/home_dto.dart index 3c25def..bc20a0e 100644 --- a/mycore_api/lib/model/home_dto.dart +++ b/mycore_api/lib/model/home_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; @@ -19,24 +20,48 @@ class HomeDTO { this.currentAlarmMode, this.createdDate, this.updatedDate, - this.usersIds, + this.usersIds = const [], }); - String id; + String? id; - String name; + String? name; - bool isAlarm; + /// + /// 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? isAlarm; - bool isDefault; + /// + /// 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? isDefault; - AlarmModeDTO currentAlarmMode; + AlarmMode? currentAlarmMode; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List usersIds; + List? usersIds; @override bool operator ==(Object other) => identical(this, other) || other is HomeDTO && @@ -51,90 +76,126 @@ class HomeDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (isAlarm == null ? 0 : isAlarm.hashCode) + - (isDefault == null ? 0 : isDefault.hashCode) + - (currentAlarmMode == null ? 0 : currentAlarmMode.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (usersIds == null ? 0 : usersIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (isAlarm == null ? 0 : isAlarm!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (currentAlarmMode == null ? 0 : currentAlarmMode!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (usersIds == null ? 0 : usersIds!.hashCode); @override String toString() => 'HomeDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (isAlarm != null) { - json[r'isAlarm'] = isAlarm; + _json[r'isAlarm'] = isAlarm; } if (isDefault != null) { - json[r'isDefault'] = isDefault; + _json[r'isDefault'] = isDefault; } if (currentAlarmMode != null) { - json[r'currentAlarmMode'] = currentAlarmMode; + _json[r'currentAlarmMode'] = currentAlarmMode; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (usersIds != null) { - json[r'usersIds'] = usersIds; + _json[r'usersIds'] = usersIds; } - return json; + return _json; } /// Returns a new [HomeDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static HomeDTO fromJson(Map json) => json == null - ? null - : HomeDTO( - id: json[r'id'], - name: json[r'name'], - isAlarm: json[r'isAlarm'], - isDefault: json[r'isDefault'], - currentAlarmMode: AlarmModeDTO.fromJson(json[r'currentAlarmMode']), - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - usersIds: json[r'usersIds'] == null - ? null - : (json[r'usersIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static HomeDTO? 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) => HomeDTO.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 "HomeDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "HomeDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return HomeDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + isAlarm: mapValueOfType(json, r'isAlarm'), + isDefault: mapValueOfType(json, r'isDefault'), + currentAlarmMode: AlarmMode.fromJson(json[r'currentAlarmMode']), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + usersIds: json[r'usersIds'] is List + ? (json[r'usersIds'] as List).cast() + : 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 = HomeDTO.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] = HomeDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = HomeDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of HomeDTO-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] = HomeDTO.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 = HomeDTO.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/mycore_api/lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart b/mycore_api/lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart index 9beee20..96c35af 100644 --- a/mycore_api/lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart +++ b/mycore_api/lib/model/list_response_of_event_detail_dto_and_event_home_filter.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,19 +13,31 @@ part of openapi.api; class ListResponseOfEventDetailDTOAndEventHomeFilter { /// Returns a new [ListResponseOfEventDetailDTOAndEventHomeFilter] instance. ListResponseOfEventDetailDTOAndEventHomeFilter({ - this.values, + this.values = const [], this.requestParameters, this.totalCount, this.actualCount, }); - List values; + List? values; - EventHomeFilter requestParameters; + ListResponseOfEventDetailDTOAndEventHomeFilter? requestParameters; - int totalCount; + /// + /// 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? totalCount; - int actualCount; + /// + /// 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? actualCount; @override bool operator ==(Object other) => identical(this, other) || other is ListResponseOfEventDetailDTOAndEventHomeFilter && @@ -35,64 +48,104 @@ class ListResponseOfEventDetailDTOAndEventHomeFilter { @override int get hashCode => - (values == null ? 0 : values.hashCode) + - (requestParameters == null ? 0 : requestParameters.hashCode) + - (totalCount == null ? 0 : totalCount.hashCode) + - (actualCount == null ? 0 : actualCount.hashCode); + // ignore: unnecessary_parenthesis + (values == null ? 0 : values!.hashCode) + + (requestParameters == null ? 0 : requestParameters!.hashCode) + + (totalCount == null ? 0 : totalCount!.hashCode) + + (actualCount == null ? 0 : actualCount!.hashCode); @override String toString() => 'ListResponseOfEventDetailDTOAndEventHomeFilter[values=$values, requestParameters=$requestParameters, totalCount=$totalCount, actualCount=$actualCount]'; Map toJson() { - final json = {}; + final _json = {}; if (values != null) { - json[r'values'] = values; + _json[r'values'] = values; } if (requestParameters != null) { - json[r'requestParameters'] = requestParameters; + _json[r'requestParameters'] = requestParameters; } if (totalCount != null) { - json[r'totalCount'] = totalCount; + _json[r'totalCount'] = totalCount; } if (actualCount != null) { - json[r'actualCount'] = actualCount; + _json[r'actualCount'] = actualCount; } - return json; + return _json; } /// Returns a new [ListResponseOfEventDetailDTOAndEventHomeFilter] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ListResponseOfEventDetailDTOAndEventHomeFilter fromJson(Map json) => json == null - ? null - : ListResponseOfEventDetailDTOAndEventHomeFilter( - values: EventDetailDTO.listFromJson(json[r'values']), - requestParameters: EventHomeFilter.fromJson(json[r'requestParameters']), - totalCount: json[r'totalCount'], - actualCount: json[r'actualCount'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ListResponseOfEventDetailDTOAndEventHomeFilter? 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) => ListResponseOfEventDetailDTOAndEventHomeFilter.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 "ListResponseOfEventDetailDTOAndEventHomeFilter[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ListResponseOfEventDetailDTOAndEventHomeFilter[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ListResponseOfEventDetailDTOAndEventHomeFilter( + values: EventDetailDTO.listFromJson(json[r'values']) ?? const [], + requestParameters: ListResponseOfEventDetailDTOAndEventHomeFilter.fromJson(json[r'requestParameters']), + totalCount: mapValueOfType(json, r'totalCount'), + actualCount: mapValueOfType(json, r'actualCount'), + ); + } + 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 = ListResponseOfEventDetailDTOAndEventHomeFilter.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] = ListResponseOfEventDetailDTOAndEventHomeFilter.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ListResponseOfEventDetailDTOAndEventHomeFilter.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ListResponseOfEventDetailDTOAndEventHomeFilter-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] = ListResponseOfEventDetailDTOAndEventHomeFilter.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 = ListResponseOfEventDetailDTOAndEventHomeFilter.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/mycore_api/lib/model/login_dto.dart b/mycore_api/lib/model/login_dto.dart index ff0bed5..e5543ec 100644 --- a/mycore_api/lib/model/login_dto.dart +++ b/mycore_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/mycore_api/lib/model/means_of_communication.dart b/mycore_api/lib/model/means_of_communication.dart index b5ea770..da157b8 100644 --- a/mycore_api/lib/model/means_of_communication.dart +++ b/mycore_api/lib/model/means_of_communication.dart @@ -1,15 +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; - +/// class MeansOfCommunication { /// Instantiate a new enum with the provided [value]. const MeansOfCommunication._(this.value); @@ -35,23 +36,28 @@ class MeansOfCommunication { zwave, ]; - static MeansOfCommunication fromJson(dynamic value) => - MeansOfCommunicationTypeTransformer().decode(value); + static MeansOfCommunication? fromJson(dynamic value) => MeansOfCommunicationTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => MeansOfCommunication.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 = MeansOfCommunication.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [MeansOfCommunication] to String, /// and [decode] dynamic data back to [MeansOfCommunication]. class MeansOfCommunicationTypeTransformer { - const MeansOfCommunicationTypeTransformer._(); + factory MeansOfCommunicationTypeTransformer() => _instance ??= const MeansOfCommunicationTypeTransformer._(); - factory MeansOfCommunicationTypeTransformer() => _instance ??= MeansOfCommunicationTypeTransformer._(); + const MeansOfCommunicationTypeTransformer._(); String encode(MeansOfCommunication data) => data.value; @@ -63,20 +69,23 @@ class MeansOfCommunicationTypeTransformer { /// /// 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. - MeansOfCommunication decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Wifi': return MeansOfCommunication.wifi; - case r'Bluetooth': return MeansOfCommunication.bluetooth; - case r'Zigbee': return MeansOfCommunication.zigbee; - case r'Zwave': return MeansOfCommunication.zwave; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + MeansOfCommunication? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'Wifi': return MeansOfCommunication.wifi; + case r'Bluetooth': return MeansOfCommunication.bluetooth; + case r'Zigbee': return MeansOfCommunication.zigbee; + case r'Zwave': return MeansOfCommunication.zwave; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [MeansOfCommunicationTypeTransformer] instance. - static MeansOfCommunicationTypeTransformer _instance; + static MeansOfCommunicationTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/mqtt_message_dto.dart b/mycore_api/lib/model/mqtt_message_dto.dart index e76235d..750157f 100644 --- a/mycore_api/lib/model/mqtt_message_dto.dart +++ b/mycore_api/lib/model/mqtt_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; @@ -17,11 +18,17 @@ class MqttMessageDTO { this.online, }); - String topic; + String? topic; - String message; + String? message; - bool online; + /// + /// 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? online; @override bool operator ==(Object other) => identical(this, other) || other is MqttMessageDTO && @@ -31,59 +38,99 @@ class MqttMessageDTO { @override int get hashCode => - (topic == null ? 0 : topic.hashCode) + - (message == null ? 0 : message.hashCode) + - (online == null ? 0 : online.hashCode); + // ignore: unnecessary_parenthesis + (topic == null ? 0 : topic!.hashCode) + + (message == null ? 0 : message!.hashCode) + + (online == null ? 0 : online!.hashCode); @override String toString() => 'MqttMessageDTO[topic=$topic, message=$message, online=$online]'; Map toJson() { - final json = {}; + final _json = {}; if (topic != null) { - json[r'topic'] = topic; + _json[r'topic'] = topic; } if (message != null) { - json[r'message'] = message; + _json[r'message'] = message; } if (online != null) { - json[r'online'] = online; + _json[r'online'] = online; } - return json; + return _json; } /// Returns a new [MqttMessageDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static MqttMessageDTO fromJson(Map json) => json == null - ? null - : MqttMessageDTO( - topic: json[r'topic'], - message: json[r'message'], - online: json[r'online'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MqttMessageDTO? 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) => MqttMessageDTO.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 "MqttMessageDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "MqttMessageDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return MqttMessageDTO( + topic: mapValueOfType(json, r'topic'), + message: mapValueOfType(json, r'message'), + online: mapValueOfType(json, r'online'), + ); + } + 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 = MqttMessageDTO.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] = MqttMessageDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MqttMessageDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of MqttMessageDTO-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] = MqttMessageDTO.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 = MqttMessageDTO.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/mycore_api/lib/model/odd_nice.dart b/mycore_api/lib/model/odd_nice.dart index 71390a4..8b5774d 100644 --- a/mycore_api/lib/model/odd_nice.dart +++ b/mycore_api/lib/model/odd_nice.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,19 +13,25 @@ part of openapi.api; class OddNice { /// Returns a new [OddNice] instance. OddNice({ - this.teams, + this.teams = const [], this.commenceTime, this.homeTeam, this.odds, }); - List teams; + List? teams; - int commenceTime; + /// + /// 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? commenceTime; - String homeTeam; + String? homeTeam; - OddObject odds; + OddNiceOdds? odds; @override bool operator ==(Object other) => identical(this, other) || other is OddNice && @@ -35,66 +42,106 @@ class OddNice { @override int get hashCode => - (teams == null ? 0 : teams.hashCode) + - (commenceTime == null ? 0 : commenceTime.hashCode) + - (homeTeam == null ? 0 : homeTeam.hashCode) + - (odds == null ? 0 : odds.hashCode); + // ignore: unnecessary_parenthesis + (teams == null ? 0 : teams!.hashCode) + + (commenceTime == null ? 0 : commenceTime!.hashCode) + + (homeTeam == null ? 0 : homeTeam!.hashCode) + + (odds == null ? 0 : odds!.hashCode); @override String toString() => 'OddNice[teams=$teams, commenceTime=$commenceTime, homeTeam=$homeTeam, odds=$odds]'; Map toJson() { - final json = {}; + final _json = {}; if (teams != null) { - json[r'teams'] = teams; + _json[r'teams'] = teams; } if (commenceTime != null) { - json[r'commence_time'] = commenceTime; + _json[r'commence_time'] = commenceTime; } if (homeTeam != null) { - json[r'home_team'] = homeTeam; + _json[r'home_team'] = homeTeam; } if (odds != null) { - json[r'odds'] = odds; + _json[r'odds'] = odds; } - return json; + return _json; } /// Returns a new [OddNice] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static OddNice fromJson(Map json) => json == null - ? null - : OddNice( - teams: json[r'teams'] == null - ? null - : (json[r'teams'] as List).cast(), - commenceTime: json[r'commence_time'], - homeTeam: json[r'home_team'], - odds: OddObject.fromJson(json[r'odds']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static OddNice? 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) => OddNice.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 "OddNice[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "OddNice[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return OddNice( + teams: json[r'teams'] is List + ? (json[r'teams'] as List).cast() + : const [], + commenceTime: mapValueOfType(json, r'commence_time'), + homeTeam: mapValueOfType(json, r'home_team'), + odds: OddNiceOdds.fromJson(json[r'odds']), + ); + } + 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 = OddNice.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] = OddNice.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = OddNice.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of OddNice-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] = OddNice.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 = OddNice.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/mycore_api/lib/model/odd_nice_odds.dart b/mycore_api/lib/model/odd_nice_odds.dart new file mode 100644 index 0000000..ecd15c4 --- /dev/null +++ b/mycore_api/lib/model/odd_nice_odds.dart @@ -0,0 +1,148 @@ +// +// 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 OddNiceOdds { + /// Returns a new [OddNiceOdds] instance. + OddNiceOdds({ + this.homeOdd, + this.drawOdd, + this.visitOdd, + }); + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? homeOdd; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? drawOdd; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? visitOdd; + + @override + bool operator ==(Object other) => identical(this, other) || other is OddNiceOdds && + other.homeOdd == homeOdd && + other.drawOdd == drawOdd && + other.visitOdd == visitOdd; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (homeOdd == null ? 0 : homeOdd!.hashCode) + + (drawOdd == null ? 0 : drawOdd!.hashCode) + + (visitOdd == null ? 0 : visitOdd!.hashCode); + + @override + String toString() => 'OddNiceOdds[homeOdd=$homeOdd, drawOdd=$drawOdd, visitOdd=$visitOdd]'; + + Map toJson() { + final _json = {}; + if (homeOdd != null) { + _json[r'homeOdd'] = homeOdd; + } + if (drawOdd != null) { + _json[r'drawOdd'] = drawOdd; + } + if (visitOdd != null) { + _json[r'visitOdd'] = visitOdd; + } + return _json; + } + + /// Returns a new [OddNiceOdds] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static OddNiceOdds? 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 "OddNiceOdds[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "OddNiceOdds[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return OddNiceOdds( + homeOdd: mapValueOfType(json, r'homeOdd'), + drawOdd: mapValueOfType(json, r'drawOdd'), + visitOdd: mapValueOfType(json, r'visitOdd'), + ); + } + 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 = OddNiceOdds.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 = OddNiceOdds.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of OddNiceOdds-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 = OddNiceOdds.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/mycore_api/lib/model/odd_object.dart b/mycore_api/lib/model/odd_object.dart index 72a301d..c8e62ff 100644 --- a/mycore_api/lib/model/odd_object.dart +++ b/mycore_api/lib/model/odd_object.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; @@ -17,11 +18,29 @@ class OddObject { this.visitOdd, }); - double homeOdd; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? homeOdd; - double drawOdd; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? drawOdd; - double visitOdd; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? visitOdd; @override bool operator ==(Object other) => identical(this, other) || other is OddObject && @@ -31,59 +50,99 @@ class OddObject { @override int get hashCode => - (homeOdd == null ? 0 : homeOdd.hashCode) + - (drawOdd == null ? 0 : drawOdd.hashCode) + - (visitOdd == null ? 0 : visitOdd.hashCode); + // ignore: unnecessary_parenthesis + (homeOdd == null ? 0 : homeOdd!.hashCode) + + (drawOdd == null ? 0 : drawOdd!.hashCode) + + (visitOdd == null ? 0 : visitOdd!.hashCode); @override String toString() => 'OddObject[homeOdd=$homeOdd, drawOdd=$drawOdd, visitOdd=$visitOdd]'; Map toJson() { - final json = {}; + final _json = {}; if (homeOdd != null) { - json[r'homeOdd'] = homeOdd; + _json[r'homeOdd'] = homeOdd; } if (drawOdd != null) { - json[r'drawOdd'] = drawOdd; + _json[r'drawOdd'] = drawOdd; } if (visitOdd != null) { - json[r'visitOdd'] = visitOdd; + _json[r'visitOdd'] = visitOdd; } - return json; + return _json; } /// Returns a new [OddObject] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static OddObject fromJson(Map json) => json == null - ? null - : OddObject( - homeOdd: json[r'homeOdd'], - drawOdd: json[r'drawOdd'], - visitOdd: json[r'visitOdd'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static OddObject? 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) => OddObject.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 "OddObject[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "OddObject[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return OddObject( + homeOdd: mapValueOfType(json, r'homeOdd'), + drawOdd: mapValueOfType(json, r'drawOdd'), + visitOdd: mapValueOfType(json, r'visitOdd'), + ); + } + 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 = OddObject.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] = OddObject.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = OddObject.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of OddObject-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] = OddObject.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 = OddObject.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/mycore_api/lib/model/panel_menu_item.dart b/mycore_api/lib/model/panel_menu_item.dart index 83f9c42..9d24e2f 100644 --- a/mycore_api/lib/model/panel_menu_item.dart +++ b/mycore_api/lib/model/panel_menu_item.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,22 +19,28 @@ class PanelMenuItem { this.color, this.badgeValue, this.badgeType, - this.children, + this.children = const [], }); - String label; + String? label; - String route; + String? route; - String icon; + String? icon; - String color; + String? color; - int badgeValue; + /// + /// 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? badgeValue; - String badgeType; + String? badgeType; - List children; + List? children; @override bool operator ==(Object other) => identical(this, other) || other is PanelMenuItem && @@ -47,79 +54,119 @@ class PanelMenuItem { @override int get hashCode => - (label == null ? 0 : label.hashCode) + - (route == null ? 0 : route.hashCode) + - (icon == null ? 0 : icon.hashCode) + - (color == null ? 0 : color.hashCode) + - (badgeValue == null ? 0 : badgeValue.hashCode) + - (badgeType == null ? 0 : badgeType.hashCode) + - (children == null ? 0 : children.hashCode); + // ignore: unnecessary_parenthesis + (label == null ? 0 : label!.hashCode) + + (route == null ? 0 : route!.hashCode) + + (icon == null ? 0 : icon!.hashCode) + + (color == null ? 0 : color!.hashCode) + + (badgeValue == null ? 0 : badgeValue!.hashCode) + + (badgeType == null ? 0 : badgeType!.hashCode) + + (children == null ? 0 : children!.hashCode); @override String toString() => 'PanelMenuItem[label=$label, route=$route, icon=$icon, color=$color, badgeValue=$badgeValue, badgeType=$badgeType, children=$children]'; Map toJson() { - final json = {}; + final _json = {}; if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; } if (route != null) { - json[r'route'] = route; + _json[r'route'] = route; } if (icon != null) { - json[r'icon'] = icon; + _json[r'icon'] = icon; } if (color != null) { - json[r'color'] = color; + _json[r'color'] = color; } if (badgeValue != null) { - json[r'badgeValue'] = badgeValue; + _json[r'badgeValue'] = badgeValue; } if (badgeType != null) { - json[r'badgeType'] = badgeType; + _json[r'badgeType'] = badgeType; } if (children != null) { - json[r'children'] = children; + _json[r'children'] = children; } - return json; + return _json; } /// Returns a new [PanelMenuItem] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static PanelMenuItem fromJson(Map json) => json == null - ? null - : PanelMenuItem( - label: json[r'label'], - route: json[r'route'], - icon: json[r'icon'], - color: json[r'color'], - badgeValue: json[r'badgeValue'], - badgeType: json[r'badgeType'], - children: PanelMenuItem.listFromJson(json[r'children']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PanelMenuItem? 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) => PanelMenuItem.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 "PanelMenuItem[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PanelMenuItem[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return PanelMenuItem( + label: mapValueOfType(json, r'label'), + route: mapValueOfType(json, r'route'), + icon: mapValueOfType(json, r'icon'), + color: mapValueOfType(json, r'color'), + badgeValue: mapValueOfType(json, r'badgeValue'), + badgeType: mapValueOfType(json, r'badgeType'), + children: PanelMenuItem.listFromJson(json[r'children']) ?? 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 = PanelMenuItem.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] = PanelMenuItem.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PanelMenuItem.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of PanelMenuItem-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] = PanelMenuItem.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 = PanelMenuItem.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/mycore_api/lib/model/panel_section.dart b/mycore_api/lib/model/panel_section.dart index e612c49..2989fb2 100644 --- a/mycore_api/lib/model/panel_section.dart +++ b/mycore_api/lib/model/panel_section.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,18 +17,18 @@ class PanelSection { this.icon, this.color, this.defaultRoute, - this.children, + this.children = const [], }); - String label; + String? label; - String icon; + String? icon; - String color; + String? color; - String defaultRoute; + String? defaultRoute; - List children; + List? children; @override bool operator ==(Object other) => identical(this, other) || other is PanelSection && @@ -39,69 +40,109 @@ class PanelSection { @override int get hashCode => - (label == null ? 0 : label.hashCode) + - (icon == null ? 0 : icon.hashCode) + - (color == null ? 0 : color.hashCode) + - (defaultRoute == null ? 0 : defaultRoute.hashCode) + - (children == null ? 0 : children.hashCode); + // ignore: unnecessary_parenthesis + (label == null ? 0 : label!.hashCode) + + (icon == null ? 0 : icon!.hashCode) + + (color == null ? 0 : color!.hashCode) + + (defaultRoute == null ? 0 : defaultRoute!.hashCode) + + (children == null ? 0 : children!.hashCode); @override String toString() => 'PanelSection[label=$label, icon=$icon, color=$color, defaultRoute=$defaultRoute, children=$children]'; Map toJson() { - final json = {}; + final _json = {}; if (label != null) { - json[r'label'] = label; + _json[r'label'] = label; } if (icon != null) { - json[r'icon'] = icon; + _json[r'icon'] = icon; } if (color != null) { - json[r'color'] = color; + _json[r'color'] = color; } if (defaultRoute != null) { - json[r'defaultRoute'] = defaultRoute; + _json[r'defaultRoute'] = defaultRoute; } if (children != null) { - json[r'children'] = children; + _json[r'children'] = children; } - return json; + return _json; } /// Returns a new [PanelSection] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static PanelSection fromJson(Map json) => json == null - ? null - : PanelSection( - label: json[r'label'], - icon: json[r'icon'], - color: json[r'color'], - defaultRoute: json[r'defaultRoute'], - children: PanelMenuItem.listFromJson(json[r'children']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PanelSection? 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) => PanelSection.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 "PanelSection[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PanelSection[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return PanelSection( + label: mapValueOfType(json, r'label'), + icon: mapValueOfType(json, r'icon'), + color: mapValueOfType(json, r'color'), + defaultRoute: mapValueOfType(json, r'defaultRoute'), + children: PanelMenuItem.listFromJson(json[r'children']) ?? 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 = PanelSection.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] = PanelSection.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PanelSection.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of PanelSection-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] = PanelSection.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 = PanelSection.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/mycore_api/lib/model/programmed_mode.dart b/mycore_api/lib/model/programmed_mode.dart index 04796b3..3542ffd 100644 --- a/mycore_api/lib/model/programmed_mode.dart +++ b/mycore_api/lib/model/programmed_mode.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,28 +13,28 @@ part of openapi.api; class ProgrammedMode { /// Returns a new [ProgrammedMode] instance. ProgrammedMode({ - this.monday, - this.tuesday, - this.wednesday, - this.thursday, - this.friday, - this.saturday, - this.sunday, + this.monday = const [], + this.tuesday = const [], + this.wednesday = const [], + this.thursday = const [], + this.friday = const [], + this.saturday = const [], + this.sunday = const [], }); - List monday; + List? monday; - List tuesday; + List? tuesday; - List wednesday; + List? wednesday; - List thursday; + List? thursday; - List friday; + List? friday; - List saturday; + List? saturday; - List sunday; + List? sunday; @override bool operator ==(Object other) => identical(this, other) || other is ProgrammedMode && @@ -47,79 +48,119 @@ class ProgrammedMode { @override int get hashCode => - (monday == null ? 0 : monday.hashCode) + - (tuesday == null ? 0 : tuesday.hashCode) + - (wednesday == null ? 0 : wednesday.hashCode) + - (thursday == null ? 0 : thursday.hashCode) + - (friday == null ? 0 : friday.hashCode) + - (saturday == null ? 0 : saturday.hashCode) + - (sunday == null ? 0 : sunday.hashCode); + // ignore: unnecessary_parenthesis + (monday == null ? 0 : monday!.hashCode) + + (tuesday == null ? 0 : tuesday!.hashCode) + + (wednesday == null ? 0 : wednesday!.hashCode) + + (thursday == null ? 0 : thursday!.hashCode) + + (friday == null ? 0 : friday!.hashCode) + + (saturday == null ? 0 : saturday!.hashCode) + + (sunday == null ? 0 : sunday!.hashCode); @override String toString() => 'ProgrammedMode[monday=$monday, tuesday=$tuesday, wednesday=$wednesday, thursday=$thursday, friday=$friday, saturday=$saturday, sunday=$sunday]'; Map toJson() { - final json = {}; + final _json = {}; if (monday != null) { - json[r'monday'] = monday; + _json[r'monday'] = monday; } if (tuesday != null) { - json[r'tuesday'] = tuesday; + _json[r'tuesday'] = tuesday; } if (wednesday != null) { - json[r'wednesday'] = wednesday; + _json[r'wednesday'] = wednesday; } if (thursday != null) { - json[r'thursday'] = thursday; + _json[r'thursday'] = thursday; } if (friday != null) { - json[r'friday'] = friday; + _json[r'friday'] = friday; } if (saturday != null) { - json[r'saturday'] = saturday; + _json[r'saturday'] = saturday; } if (sunday != null) { - json[r'sunday'] = sunday; + _json[r'sunday'] = sunday; } - return json; + return _json; } /// Returns a new [ProgrammedMode] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ProgrammedMode fromJson(Map json) => json == null - ? null - : ProgrammedMode( - monday: TimePeriodAlarm.listFromJson(json[r'monday']), - tuesday: TimePeriodAlarm.listFromJson(json[r'tuesday']), - wednesday: TimePeriodAlarm.listFromJson(json[r'wednesday']), - thursday: TimePeriodAlarm.listFromJson(json[r'thursday']), - friday: TimePeriodAlarm.listFromJson(json[r'friday']), - saturday: TimePeriodAlarm.listFromJson(json[r'saturday']), - sunday: TimePeriodAlarm.listFromJson(json[r'sunday']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ProgrammedMode? 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) => ProgrammedMode.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 "ProgrammedMode[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ProgrammedMode[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ProgrammedMode( + monday: TimePeriodAlarm.listFromJson(json[r'monday']) ?? const [], + tuesday: TimePeriodAlarm.listFromJson(json[r'tuesday']) ?? const [], + wednesday: TimePeriodAlarm.listFromJson(json[r'wednesday']) ?? const [], + thursday: TimePeriodAlarm.listFromJson(json[r'thursday']) ?? const [], + friday: TimePeriodAlarm.listFromJson(json[r'friday']) ?? const [], + saturday: TimePeriodAlarm.listFromJson(json[r'saturday']) ?? const [], + sunday: TimePeriodAlarm.listFromJson(json[r'sunday']) ?? 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 = ProgrammedMode.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] = ProgrammedMode.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ProgrammedMode.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ProgrammedMode-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] = ProgrammedMode.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 = ProgrammedMode.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/mycore_api/lib/model/provider_dto.dart b/mycore_api/lib/model/provider_dto.dart index 6941fe4..7b9614c 100644 --- a/mycore_api/lib/model/provider_dto.dart +++ b/mycore_api/lib/model/provider_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; @@ -23,23 +24,35 @@ class ProviderDTO { this.active, }); - String id; + String? id; - String name; + String? name; - ProviderType 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. + /// + ProviderType? type; - String homeId; + String? homeId; - String endpoint; + String? endpoint; - String username; + String? username; - String password; + String? password; - String apiKey; + String? apiKey; - bool active; + /// + /// 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? active; @override bool operator ==(Object other) => identical(this, other) || other is ProviderDTO && @@ -55,89 +68,129 @@ class ProviderDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (endpoint == null ? 0 : endpoint.hashCode) + - (username == null ? 0 : username.hashCode) + - (password == null ? 0 : password.hashCode) + - (apiKey == null ? 0 : apiKey.hashCode) + - (active == null ? 0 : active.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (endpoint == null ? 0 : endpoint!.hashCode) + + (username == null ? 0 : username!.hashCode) + + (password == null ? 0 : password!.hashCode) + + (apiKey == null ? 0 : apiKey!.hashCode) + + (active == null ? 0 : active!.hashCode); @override String toString() => 'ProviderDTO[id=$id, name=$name, type=$type, homeId=$homeId, endpoint=$endpoint, username=$username, password=$password, apiKey=$apiKey, active=$active]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (endpoint != null) { - json[r'endpoint'] = endpoint; + _json[r'endpoint'] = endpoint; } if (username != null) { - json[r'username'] = username; + _json[r'username'] = username; } if (password != null) { - json[r'password'] = password; + _json[r'password'] = password; } if (apiKey != null) { - json[r'apiKey'] = apiKey; + _json[r'apiKey'] = apiKey; } if (active != null) { - json[r'active'] = active; + _json[r'active'] = active; } - return json; + return _json; } /// Returns a new [ProviderDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ProviderDTO fromJson(Map json) => json == null - ? null - : ProviderDTO( - id: json[r'id'], - name: json[r'name'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ProviderDTO? 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 "ProviderDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ProviderDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ProviderDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), type: ProviderType.fromJson(json[r'type']), - homeId: json[r'homeId'], - endpoint: json[r'endpoint'], - username: json[r'username'], - password: json[r'password'], - apiKey: json[r'apiKey'], - active: json[r'active'], - ); + homeId: mapValueOfType(json, r'homeId'), + endpoint: mapValueOfType(json, r'endpoint'), + username: mapValueOfType(json, r'username'), + password: mapValueOfType(json, r'password'), + apiKey: mapValueOfType(json, r'apiKey'), + active: mapValueOfType(json, r'active'), + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => ProviderDTO.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 = ProviderDTO.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] = ProviderDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ProviderDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ProviderDTO-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] = ProviderDTO.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 = ProviderDTO.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/mycore_api/lib/model/provider_type.dart b/mycore_api/lib/model/provider_type.dart index 67f806b..afa4266 100644 --- a/mycore_api/lib/model/provider_type.dart +++ b/mycore_api/lib/model/provider_type.dart @@ -1,15 +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; - +/// class ProviderType { /// Instantiate a new enum with the provided [value]. const ProviderType._(this.value); @@ -35,23 +36,28 @@ class ProviderType { zigbee2mqtt, ]; - static ProviderType fromJson(dynamic value) => - ProviderTypeTypeTransformer().decode(value); + static ProviderType? fromJson(dynamic value) => ProviderTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ProviderType.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 = ProviderType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [ProviderType] to String, /// and [decode] dynamic data back to [ProviderType]. class ProviderTypeTypeTransformer { - const ProviderTypeTypeTransformer._(); + factory ProviderTypeTypeTransformer() => _instance ??= const ProviderTypeTypeTransformer._(); - factory ProviderTypeTypeTransformer() => _instance ??= ProviderTypeTypeTransformer._(); + const ProviderTypeTypeTransformer._(); String encode(ProviderType data) => data.value; @@ -63,20 +69,23 @@ class ProviderTypeTypeTransformer { /// /// 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. - ProviderType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'arlo': return ProviderType.arlo; - case r'meross': return ProviderType.meross; - case r'yeelight': return ProviderType.yeelight; - case r'zigbee2mqtt': return ProviderType.zigbee2mqtt; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ProviderType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'arlo': return ProviderType.arlo; + case r'meross': return ProviderType.meross; + case r'yeelight': return ProviderType.yeelight; + case r'zigbee2mqtt': return ProviderType.zigbee2mqtt; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ProviderTypeTypeTransformer] instance. - static ProviderTypeTypeTransformer _instance; + static ProviderTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/room_create_or_update_detail_dto.dart b/mycore_api/lib/model/room_create_or_update_detail_dto.dart index f953861..e1de08a 100644 --- a/mycore_api/lib/model/room_create_or_update_detail_dto.dart +++ b/mycore_api/lib/model/room_create_or_update_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; @@ -15,16 +16,16 @@ class RoomCreateOrUpdateDetailDTO { this.id, this.homeId, this.name, - this.deviceIds, + this.deviceIds = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - List deviceIds; + List? deviceIds; @override bool operator ==(Object other) => identical(this, other) || other is RoomCreateOrUpdateDetailDTO && @@ -35,66 +36,106 @@ class RoomCreateOrUpdateDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (deviceIds == null ? 0 : deviceIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (deviceIds == null ? 0 : deviceIds!.hashCode); @override String toString() => 'RoomCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, deviceIds=$deviceIds]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (deviceIds != null) { - json[r'deviceIds'] = deviceIds; + _json[r'deviceIds'] = deviceIds; } - return json; + return _json; } /// Returns a new [RoomCreateOrUpdateDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static RoomCreateOrUpdateDetailDTO fromJson(Map json) => json == null - ? null - : RoomCreateOrUpdateDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - deviceIds: json[r'deviceIds'] == null - ? null - : (json[r'deviceIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static RoomCreateOrUpdateDetailDTO? 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) => RoomCreateOrUpdateDetailDTO.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 "RoomCreateOrUpdateDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "RoomCreateOrUpdateDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return RoomCreateOrUpdateDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + deviceIds: json[r'deviceIds'] is List + ? (json[r'deviceIds'] as List).cast() + : 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 = RoomCreateOrUpdateDetailDTO.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] = RoomCreateOrUpdateDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = RoomCreateOrUpdateDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of RoomCreateOrUpdateDetailDTO-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] = RoomCreateOrUpdateDetailDTO.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 = RoomCreateOrUpdateDetailDTO.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/mycore_api/lib/model/room_detail_dto.dart b/mycore_api/lib/model/room_detail_dto.dart index cc0b387..ef45078 100644 --- a/mycore_api/lib/model/room_detail_dto.dart +++ b/mycore_api/lib/model/room_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; @@ -17,20 +18,32 @@ class RoomDetailDTO { this.name, this.createdDate, this.updatedDate, - this.devices, + this.devices = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - List devices; + List? devices; @override bool operator ==(Object other) => identical(this, other) || other is RoomDetailDTO && @@ -43,78 +56,114 @@ class RoomDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (devices == null ? 0 : devices.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (devices == null ? 0 : devices!.hashCode); @override String toString() => 'RoomDetailDTO[id=$id, homeId=$homeId, name=$name, createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (devices != null) { - json[r'devices'] = devices; + _json[r'devices'] = devices; } - return json; + return _json; } /// Returns a new [RoomDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static RoomDetailDTO fromJson(Map json) => json == null - ? null - : RoomDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - devices: DeviceDetailDTO.listFromJson(json[r'devices']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static RoomDetailDTO? 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) => RoomDetailDTO.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 "RoomDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "RoomDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return RoomDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? 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 = RoomDetailDTO.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] = RoomDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = RoomDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of RoomDetailDTO-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] = RoomDetailDTO.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 = RoomDetailDTO.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/mycore_api/lib/model/room_main_detail_dto.dart b/mycore_api/lib/model/room_main_detail_dto.dart index 2a98d46..abf1a47 100644 --- a/mycore_api/lib/model/room_main_detail_dto.dart +++ b/mycore_api/lib/model/room_main_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; @@ -25,39 +26,75 @@ class RoomMainDetailDTO { this.motion, this.isDoor, this.door, - this.environmentalDevices, - this.securityDevices, + this.environmentalDevices = const [], + this.securityDevices = const [], }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - bool isTemperature; + /// + /// 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? isTemperature; - String temperature; + String? temperature; - bool isHumidity; + /// + /// 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? isHumidity; - String humidity; + String? humidity; - bool isMotion; + /// + /// 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? isMotion; - bool motion; + bool? motion; - bool isDoor; + /// + /// 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? isDoor; - bool door; + bool? door; - List environmentalDevices; + List? environmentalDevices; - List securityDevices; + List? securityDevices; @override bool operator ==(Object other) => identical(this, other) || other is RoomMainDetailDTO && @@ -79,123 +116,159 @@ class RoomMainDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode) + - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (isTemperature == null ? 0 : isTemperature.hashCode) + - (temperature == null ? 0 : temperature.hashCode) + - (isHumidity == null ? 0 : isHumidity.hashCode) + - (humidity == null ? 0 : humidity.hashCode) + - (isMotion == null ? 0 : isMotion.hashCode) + - (motion == null ? 0 : motion.hashCode) + - (isDoor == null ? 0 : isDoor.hashCode) + - (door == null ? 0 : door.hashCode) + - (environmentalDevices == null ? 0 : environmentalDevices.hashCode) + - (securityDevices == null ? 0 : securityDevices.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (isTemperature == null ? 0 : isTemperature!.hashCode) + + (temperature == null ? 0 : temperature!.hashCode) + + (isHumidity == null ? 0 : isHumidity!.hashCode) + + (humidity == null ? 0 : humidity!.hashCode) + + (isMotion == null ? 0 : isMotion!.hashCode) + + (motion == null ? 0 : motion!.hashCode) + + (isDoor == null ? 0 : isDoor!.hashCode) + + (door == null ? 0 : door!.hashCode) + + (environmentalDevices == null ? 0 : environmentalDevices!.hashCode) + + (securityDevices == null ? 0 : securityDevices!.hashCode); @override String toString() => 'RoomMainDetailDTO[id=$id, homeId=$homeId, name=$name, createdDate=$createdDate, updatedDate=$updatedDate, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isMotion=$isMotion, motion=$motion, isDoor=$isDoor, door=$door, environmentalDevices=$environmentalDevices, securityDevices=$securityDevices]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (isTemperature != null) { - json[r'isTemperature'] = isTemperature; + _json[r'isTemperature'] = isTemperature; } if (temperature != null) { - json[r'temperature'] = temperature; + _json[r'temperature'] = temperature; } if (isHumidity != null) { - json[r'isHumidity'] = isHumidity; + _json[r'isHumidity'] = isHumidity; } if (humidity != null) { - json[r'humidity'] = humidity; + _json[r'humidity'] = humidity; } if (isMotion != null) { - json[r'isMotion'] = isMotion; + _json[r'isMotion'] = isMotion; } if (motion != null) { - json[r'motion'] = motion; + _json[r'motion'] = motion; } if (isDoor != null) { - json[r'isDoor'] = isDoor; + _json[r'isDoor'] = isDoor; } if (door != null) { - json[r'door'] = door; + _json[r'door'] = door; } if (environmentalDevices != null) { - json[r'environmentalDevices'] = environmentalDevices; + _json[r'environmentalDevices'] = environmentalDevices; } if (securityDevices != null) { - json[r'securityDevices'] = securityDevices; + _json[r'securityDevices'] = securityDevices; } - return json; + return _json; } /// Returns a new [RoomMainDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static RoomMainDetailDTO fromJson(Map json) => json == null - ? null - : RoomMainDetailDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - isTemperature: json[r'isTemperature'], - temperature: json[r'temperature'], - isHumidity: json[r'isHumidity'], - humidity: json[r'humidity'], - isMotion: json[r'isMotion'], - motion: json[r'motion'], - isDoor: json[r'isDoor'], - door: json[r'door'], - environmentalDevices: DeviceDetailDTO.listFromJson(json[r'environmentalDevices']), - securityDevices: DeviceDetailDTO.listFromJson(json[r'securityDevices']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static RoomMainDetailDTO? 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) => RoomMainDetailDTO.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 "RoomMainDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "RoomMainDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return RoomMainDetailDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + isTemperature: mapValueOfType(json, r'isTemperature'), + temperature: mapValueOfType(json, r'temperature'), + isHumidity: mapValueOfType(json, r'isHumidity'), + humidity: mapValueOfType(json, r'humidity'), + isMotion: mapValueOfType(json, r'isMotion'), + motion: mapValueOfType(json, r'motion'), + isDoor: mapValueOfType(json, r'isDoor'), + door: mapValueOfType(json, r'door'), + environmentalDevices: DeviceDetailDTO.listFromJson(json[r'environmentalDevices']) ?? const [], + securityDevices: DeviceDetailDTO.listFromJson(json[r'securityDevices']) ?? 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 = RoomMainDetailDTO.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] = RoomMainDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = RoomMainDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of RoomMainDetailDTO-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] = RoomMainDetailDTO.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 = RoomMainDetailDTO.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/mycore_api/lib/model/room_main_detail_dto_all_of.dart b/mycore_api/lib/model/room_main_detail_dto_all_of.dart index 2176246..2d0e170 100644 --- a/mycore_api/lib/model/room_main_detail_dto_all_of.dart +++ b/mycore_api/lib/model/room_main_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; @@ -22,33 +23,69 @@ class RoomMainDetailDTOAllOf { this.motion, this.isDoor, this.door, - this.environmentalDevices, - this.securityDevices, + this.environmentalDevices = const [], + this.securityDevices = const [], }); - DateTime createdDate; + /// + /// 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? createdDate; - DateTime updatedDate; + /// + /// 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? updatedDate; - bool isTemperature; + /// + /// 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? isTemperature; - String temperature; + String? temperature; - bool isHumidity; + /// + /// 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? isHumidity; - String humidity; + String? humidity; - bool isMotion; + /// + /// 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? isMotion; - bool motion; + bool? motion; - bool isDoor; + /// + /// 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? isDoor; - bool door; + bool? door; - List environmentalDevices; + List? environmentalDevices; - List securityDevices; + List? securityDevices; @override bool operator ==(Object other) => identical(this, other) || other is RoomMainDetailDTOAllOf && @@ -67,108 +104,144 @@ class RoomMainDetailDTOAllOf { @override int get hashCode => - (createdDate == null ? 0 : createdDate.hashCode) + - (updatedDate == null ? 0 : updatedDate.hashCode) + - (isTemperature == null ? 0 : isTemperature.hashCode) + - (temperature == null ? 0 : temperature.hashCode) + - (isHumidity == null ? 0 : isHumidity.hashCode) + - (humidity == null ? 0 : humidity.hashCode) + - (isMotion == null ? 0 : isMotion.hashCode) + - (motion == null ? 0 : motion.hashCode) + - (isDoor == null ? 0 : isDoor.hashCode) + - (door == null ? 0 : door.hashCode) + - (environmentalDevices == null ? 0 : environmentalDevices.hashCode) + - (securityDevices == null ? 0 : securityDevices.hashCode); + // ignore: unnecessary_parenthesis + (createdDate == null ? 0 : createdDate!.hashCode) + + (updatedDate == null ? 0 : updatedDate!.hashCode) + + (isTemperature == null ? 0 : isTemperature!.hashCode) + + (temperature == null ? 0 : temperature!.hashCode) + + (isHumidity == null ? 0 : isHumidity!.hashCode) + + (humidity == null ? 0 : humidity!.hashCode) + + (isMotion == null ? 0 : isMotion!.hashCode) + + (motion == null ? 0 : motion!.hashCode) + + (isDoor == null ? 0 : isDoor!.hashCode) + + (door == null ? 0 : door!.hashCode) + + (environmentalDevices == null ? 0 : environmentalDevices!.hashCode) + + (securityDevices == null ? 0 : securityDevices!.hashCode); @override String toString() => 'RoomMainDetailDTOAllOf[createdDate=$createdDate, updatedDate=$updatedDate, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isMotion=$isMotion, motion=$motion, isDoor=$isDoor, door=$door, environmentalDevices=$environmentalDevices, securityDevices=$securityDevices]'; Map toJson() { - final json = {}; + final _json = {}; if (createdDate != null) { - json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + _json[r'createdDate'] = createdDate!.toUtc().toIso8601String(); } if (updatedDate != null) { - json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + _json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String(); } if (isTemperature != null) { - json[r'isTemperature'] = isTemperature; + _json[r'isTemperature'] = isTemperature; } if (temperature != null) { - json[r'temperature'] = temperature; + _json[r'temperature'] = temperature; } if (isHumidity != null) { - json[r'isHumidity'] = isHumidity; + _json[r'isHumidity'] = isHumidity; } if (humidity != null) { - json[r'humidity'] = humidity; + _json[r'humidity'] = humidity; } if (isMotion != null) { - json[r'isMotion'] = isMotion; + _json[r'isMotion'] = isMotion; } if (motion != null) { - json[r'motion'] = motion; + _json[r'motion'] = motion; } if (isDoor != null) { - json[r'isDoor'] = isDoor; + _json[r'isDoor'] = isDoor; } if (door != null) { - json[r'door'] = door; + _json[r'door'] = door; } if (environmentalDevices != null) { - json[r'environmentalDevices'] = environmentalDevices; + _json[r'environmentalDevices'] = environmentalDevices; } if (securityDevices != null) { - json[r'securityDevices'] = securityDevices; + _json[r'securityDevices'] = securityDevices; } - return json; + return _json; } /// Returns a new [RoomMainDetailDTOAllOf] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static RoomMainDetailDTOAllOf fromJson(Map json) => json == null - ? null - : RoomMainDetailDTOAllOf( - createdDate: json[r'createdDate'] == null - ? null - : DateTime.parse(json[r'createdDate']), - updatedDate: json[r'updatedDate'] == null - ? null - : DateTime.parse(json[r'updatedDate']), - isTemperature: json[r'isTemperature'], - temperature: json[r'temperature'], - isHumidity: json[r'isHumidity'], - humidity: json[r'humidity'], - isMotion: json[r'isMotion'], - motion: json[r'motion'], - isDoor: json[r'isDoor'], - door: json[r'door'], - environmentalDevices: DeviceDetailDTO.listFromJson(json[r'environmentalDevices']), - securityDevices: DeviceDetailDTO.listFromJson(json[r'securityDevices']), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static RoomMainDetailDTOAllOf? 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) => RoomMainDetailDTOAllOf.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 "RoomMainDetailDTOAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "RoomMainDetailDTOAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return RoomMainDetailDTOAllOf( + createdDate: mapDateTime(json, r'createdDate', ''), + updatedDate: mapDateTime(json, r'updatedDate', ''), + isTemperature: mapValueOfType(json, r'isTemperature'), + temperature: mapValueOfType(json, r'temperature'), + isHumidity: mapValueOfType(json, r'isHumidity'), + humidity: mapValueOfType(json, r'humidity'), + isMotion: mapValueOfType(json, r'isMotion'), + motion: mapValueOfType(json, r'motion'), + isDoor: mapValueOfType(json, r'isDoor'), + door: mapValueOfType(json, r'door'), + environmentalDevices: DeviceDetailDTO.listFromJson(json[r'environmentalDevices']) ?? const [], + securityDevices: DeviceDetailDTO.listFromJson(json[r'securityDevices']) ?? 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 = RoomMainDetailDTOAllOf.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] = RoomMainDetailDTOAllOf.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = RoomMainDetailDTOAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of RoomMainDetailDTOAllOf-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] = RoomMainDetailDTOAllOf.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 = RoomMainDetailDTOAllOf.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/mycore_api/lib/model/room_summary_dto.dart b/mycore_api/lib/model/room_summary_dto.dart index ea9ca95..97471ec 100644 --- a/mycore_api/lib/model/room_summary_dto.dart +++ b/mycore_api/lib/model/room_summary_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; @@ -17,11 +18,11 @@ class RoomSummaryDTO { this.name, }); - String id; + String? id; - String homeId; + String? homeId; - String name; + String? name; @override bool operator ==(Object other) => identical(this, other) || other is RoomSummaryDTO && @@ -31,59 +32,99 @@ class RoomSummaryDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (homeId == null ? 0 : homeId.hashCode) + - (name == null ? 0 : name.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (homeId == null ? 0 : homeId!.hashCode) + + (name == null ? 0 : name!.hashCode); @override String toString() => 'RoomSummaryDTO[id=$id, homeId=$homeId, name=$name]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (homeId != null) { - json[r'homeId'] = homeId; + _json[r'homeId'] = homeId; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } - return json; + return _json; } /// Returns a new [RoomSummaryDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static RoomSummaryDTO fromJson(Map json) => json == null - ? null - : RoomSummaryDTO( - id: json[r'id'], - homeId: json[r'homeId'], - name: json[r'name'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static RoomSummaryDTO? 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) => RoomSummaryDTO.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 "RoomSummaryDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "RoomSummaryDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return RoomSummaryDTO( + id: mapValueOfType(json, r'id'), + homeId: mapValueOfType(json, r'homeId'), + name: mapValueOfType(json, r'name'), + ); + } + 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 = RoomSummaryDTO.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] = RoomSummaryDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = RoomSummaryDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of RoomSummaryDTO-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] = RoomSummaryDTO.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 = RoomSummaryDTO.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/mycore_api/lib/model/screen_device.dart b/mycore_api/lib/model/screen_device.dart index 9ed497a..82099d9 100644 --- a/mycore_api/lib/model/screen_device.dart +++ b/mycore_api/lib/model/screen_device.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; @@ -21,19 +22,31 @@ class ScreenDevice { this.width, }); - String id; + String? id; - String name; + String? name; - String type; + String? type; - String location; + String? location; - String locationExplanation; + String? locationExplanation; - int height; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? height; - int width; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? width; @override bool operator ==(Object other) => identical(this, other) || other is ScreenDevice && @@ -47,79 +60,119 @@ class ScreenDevice { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode) + - (type == null ? 0 : type.hashCode) + - (location == null ? 0 : location.hashCode) + - (locationExplanation == null ? 0 : locationExplanation.hashCode) + - (height == null ? 0 : height.hashCode) + - (width == null ? 0 : width.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (location == null ? 0 : location!.hashCode) + + (locationExplanation == null ? 0 : locationExplanation!.hashCode) + + (height == null ? 0 : height!.hashCode) + + (width == null ? 0 : width!.hashCode); @override String toString() => 'ScreenDevice[id=$id, name=$name, type=$type, location=$location, locationExplanation=$locationExplanation, height=$height, width=$width]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (name != null) { - json[r'name'] = name; + _json[r'name'] = name; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } if (location != null) { - json[r'location'] = location; + _json[r'location'] = location; } if (locationExplanation != null) { - json[r'locationExplanation'] = locationExplanation; + _json[r'locationExplanation'] = locationExplanation; } if (height != null) { - json[r'height'] = height; + _json[r'height'] = height; } if (width != null) { - json[r'width'] = width; + _json[r'width'] = width; } - return json; + return _json; } /// Returns a new [ScreenDevice] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static ScreenDevice fromJson(Map json) => json == null - ? null - : ScreenDevice( - id: json[r'id'], - name: json[r'name'], - type: json[r'type'], - location: json[r'location'], - locationExplanation: json[r'locationExplanation'], - height: json[r'height'], - width: json[r'width'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ScreenDevice? 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) => ScreenDevice.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 "ScreenDevice[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ScreenDevice[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return ScreenDevice( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + type: mapValueOfType(json, r'type'), + location: mapValueOfType(json, r'location'), + locationExplanation: mapValueOfType(json, r'locationExplanation'), + height: mapValueOfType(json, r'height'), + width: mapValueOfType(json, r'width'), + ); + } + 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 = ScreenDevice.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] = ScreenDevice.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ScreenDevice.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of ScreenDevice-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] = ScreenDevice.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 = ScreenDevice.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/mycore_api/lib/model/smart_garden_message.dart b/mycore_api/lib/model/smart_garden_message.dart index 342aa1b..713ac7d 100644 --- a/mycore_api/lib/model/smart_garden_message.dart +++ b/mycore_api/lib/model/smart_garden_message.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,21 +23,51 @@ class SmartGardenMessage { this.light, }); - String id; + String? id; - String type; + String? type; - String time; + String? time; - double temperature; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? temperature; - double pressure; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? pressure; - double humidity; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? humidity; - int water; + /// + /// 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? water; - int light; + /// + /// 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? light; @override bool operator ==(Object other) => identical(this, other) || other is SmartGardenMessage && @@ -51,84 +82,124 @@ class SmartGardenMessage { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (type == null ? 0 : type.hashCode) + - (time == null ? 0 : time.hashCode) + - (temperature == null ? 0 : temperature.hashCode) + - (pressure == null ? 0 : pressure.hashCode) + - (humidity == null ? 0 : humidity.hashCode) + - (water == null ? 0 : water.hashCode) + - (light == null ? 0 : light.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (time == null ? 0 : time!.hashCode) + + (temperature == null ? 0 : temperature!.hashCode) + + (pressure == null ? 0 : pressure!.hashCode) + + (humidity == null ? 0 : humidity!.hashCode) + + (water == null ? 0 : water!.hashCode) + + (light == null ? 0 : light!.hashCode); @override String toString() => 'SmartGardenMessage[id=$id, type=$type, time=$time, temperature=$temperature, pressure=$pressure, humidity=$humidity, water=$water, light=$light]'; 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 (time != null) { - json[r'time'] = time; + _json[r'time'] = time; } if (temperature != null) { - json[r'temperature'] = temperature; + _json[r'temperature'] = temperature; } if (pressure != null) { - json[r'pressure'] = pressure; + _json[r'pressure'] = pressure; } if (humidity != null) { - json[r'humidity'] = humidity; + _json[r'humidity'] = humidity; } if (water != null) { - json[r'water'] = water; + _json[r'water'] = water; } if (light != null) { - json[r'light'] = light; + _json[r'light'] = light; } - return json; + return _json; } /// Returns a new [SmartGardenMessage] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static SmartGardenMessage fromJson(Map json) => json == null - ? null - : SmartGardenMessage( - id: json[r'id'], - type: json[r'type'], - time: json[r'time'], - temperature: json[r'temperature'], - pressure: json[r'pressure'], - humidity: json[r'humidity'], - water: json[r'water'], - light: json[r'light'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SmartGardenMessage? 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) => SmartGardenMessage.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 "SmartGardenMessage[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SmartGardenMessage[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return SmartGardenMessage( + id: mapValueOfType(json, r'id'), + type: mapValueOfType(json, r'type'), + time: mapValueOfType(json, r'time'), + temperature: mapValueOfType(json, r'temperature'), + pressure: mapValueOfType(json, r'pressure'), + humidity: mapValueOfType(json, r'humidity'), + water: mapValueOfType(json, r'water'), + light: mapValueOfType(json, r'light'), + ); + } + 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 = SmartGardenMessage.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] = SmartGardenMessage.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SmartGardenMessage.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of SmartGardenMessage-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] = SmartGardenMessage.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 = SmartGardenMessage.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/mycore_api/lib/model/smart_printer_message.dart b/mycore_api/lib/model/smart_printer_message.dart index 49a04c7..55ff658 100644 --- a/mycore_api/lib/model/smart_printer_message.dart +++ b/mycore_api/lib/model/smart_printer_message.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,17 +21,35 @@ class SmartPrinterMessage { this.smoke, }); - String id; + String? id; - String type; + String? type; - String time; + String? time; - double temperature; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? temperature; - double pressure; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + double? pressure; - int smoke; + /// + /// 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? smoke; @override bool operator ==(Object other) => identical(this, other) || other is SmartPrinterMessage && @@ -43,74 +62,114 @@ class SmartPrinterMessage { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (type == null ? 0 : type.hashCode) + - (time == null ? 0 : time.hashCode) + - (temperature == null ? 0 : temperature.hashCode) + - (pressure == null ? 0 : pressure.hashCode) + - (smoke == null ? 0 : smoke.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (time == null ? 0 : time!.hashCode) + + (temperature == null ? 0 : temperature!.hashCode) + + (pressure == null ? 0 : pressure!.hashCode) + + (smoke == null ? 0 : smoke!.hashCode); @override String toString() => 'SmartPrinterMessage[id=$id, type=$type, time=$time, temperature=$temperature, pressure=$pressure, smoke=$smoke]'; 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 (time != null) { - json[r'time'] = time; + _json[r'time'] = time; } if (temperature != null) { - json[r'temperature'] = temperature; + _json[r'temperature'] = temperature; } if (pressure != null) { - json[r'pressure'] = pressure; + _json[r'pressure'] = pressure; } if (smoke != null) { - json[r'smoke'] = smoke; + _json[r'smoke'] = smoke; } - return json; + return _json; } /// Returns a new [SmartPrinterMessage] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static SmartPrinterMessage fromJson(Map json) => json == null - ? null - : SmartPrinterMessage( - id: json[r'id'], - type: json[r'type'], - time: json[r'time'], - temperature: json[r'temperature'], - pressure: json[r'pressure'], - smoke: json[r'smoke'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SmartPrinterMessage? 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) => SmartPrinterMessage.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 "SmartPrinterMessage[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SmartPrinterMessage[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return SmartPrinterMessage( + id: mapValueOfType(json, r'id'), + type: mapValueOfType(json, r'type'), + time: mapValueOfType(json, r'time'), + temperature: mapValueOfType(json, r'temperature'), + pressure: mapValueOfType(json, r'pressure'), + smoke: mapValueOfType(json, r'smoke'), + ); + } + 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 = SmartPrinterMessage.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] = SmartPrinterMessage.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SmartPrinterMessage.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of SmartPrinterMessage-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] = SmartPrinterMessage.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 = SmartPrinterMessage.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/mycore_api/lib/model/time_period_alarm.dart b/mycore_api/lib/model/time_period_alarm.dart index d0f3505..4d5da82 100644 --- a/mycore_api/lib/model/time_period_alarm.dart +++ b/mycore_api/lib/model/time_period_alarm.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; @@ -17,11 +18,11 @@ class TimePeriodAlarm { this.alarmMode, }); - String start; + String? start; - String end; + String? end; - AlarmMode alarmMode; + AlarmMode? alarmMode; @override bool operator ==(Object other) => identical(this, other) || other is TimePeriodAlarm && @@ -31,59 +32,99 @@ class TimePeriodAlarm { @override int get hashCode => - (start == null ? 0 : start.hashCode) + - (end == null ? 0 : end.hashCode) + - (alarmMode == null ? 0 : alarmMode.hashCode); + // ignore: unnecessary_parenthesis + (start == null ? 0 : start!.hashCode) + + (end == null ? 0 : end!.hashCode) + + (alarmMode == null ? 0 : alarmMode!.hashCode); @override String toString() => 'TimePeriodAlarm[start=$start, end=$end, alarmMode=$alarmMode]'; Map toJson() { - final json = {}; + final _json = {}; if (start != null) { - json[r'start'] = start; + _json[r'start'] = start; } if (end != null) { - json[r'end'] = end; + _json[r'end'] = end; } if (alarmMode != null) { - json[r'alarmMode'] = alarmMode; + _json[r'alarmMode'] = alarmMode; } - return json; + return _json; } /// Returns a new [TimePeriodAlarm] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static TimePeriodAlarm fromJson(Map json) => json == null - ? null - : TimePeriodAlarm( - start: json[r'start'], - end: json[r'end'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TimePeriodAlarm? 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 "TimePeriodAlarm[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "TimePeriodAlarm[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return TimePeriodAlarm( + start: mapValueOfType(json, r'start'), + end: mapValueOfType(json, r'end'), alarmMode: AlarmMode.fromJson(json[r'alarmMode']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => TimePeriodAlarm.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 = TimePeriodAlarm.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] = TimePeriodAlarm.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TimePeriodAlarm.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of TimePeriodAlarm-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] = TimePeriodAlarm.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 = TimePeriodAlarm.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/mycore_api/lib/model/token_dto.dart b/mycore_api/lib/model/token_dto.dart index 5ef4e57..395efdd 100644 --- a/mycore_api/lib/model/token_dto.dart +++ b/mycore_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; @@ -20,17 +21,29 @@ class TokenDTO { this.expiration, }); - 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; @override bool operator ==(Object other) => identical(this, other) || other is TokenDTO && @@ -43,76 +56,114 @@ class TokenDTO { @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); @override String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration]'; 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; + 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', ''), + ); + } + 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/mycore_api/lib/model/trigger.dart b/mycore_api/lib/model/trigger.dart index d471689..2a14727 100644 --- a/mycore_api/lib/model/trigger.dart +++ b/mycore_api/lib/model/trigger.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,15 +20,21 @@ class Trigger { this.type, }); - String providerId; + String? providerId; - String deviceId; + String? deviceId; - String stateName; + String? stateName; - String stateValue; + String? stateValue; - TriggerType 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. + /// + TriggerType? type; @override bool operator ==(Object other) => identical(this, other) || other is Trigger && @@ -39,69 +46,109 @@ class Trigger { @override int get hashCode => - (providerId == null ? 0 : providerId.hashCode) + - (deviceId == null ? 0 : deviceId.hashCode) + - (stateName == null ? 0 : stateName.hashCode) + - (stateValue == null ? 0 : stateValue.hashCode) + - (type == null ? 0 : type.hashCode); + // ignore: unnecessary_parenthesis + (providerId == null ? 0 : providerId!.hashCode) + + (deviceId == null ? 0 : deviceId!.hashCode) + + (stateName == null ? 0 : stateName!.hashCode) + + (stateValue == null ? 0 : stateValue!.hashCode) + + (type == null ? 0 : type!.hashCode); @override String toString() => 'Trigger[providerId=$providerId, deviceId=$deviceId, stateName=$stateName, stateValue=$stateValue, type=$type]'; Map toJson() { - final json = {}; + final _json = {}; if (providerId != null) { - json[r'providerId'] = providerId; + _json[r'providerId'] = providerId; } if (deviceId != null) { - json[r'deviceId'] = deviceId; + _json[r'deviceId'] = deviceId; } if (stateName != null) { - json[r'stateName'] = stateName; + _json[r'stateName'] = stateName; } if (stateValue != null) { - json[r'stateValue'] = stateValue; + _json[r'stateValue'] = stateValue; } if (type != null) { - json[r'type'] = type; + _json[r'type'] = type; } - return json; + return _json; } /// Returns a new [Trigger] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static Trigger fromJson(Map json) => json == null - ? null - : Trigger( - providerId: json[r'providerId'], - deviceId: json[r'deviceId'], - stateName: json[r'stateName'], - stateValue: json[r'stateValue'], + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Trigger? 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 "Trigger[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Trigger[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Trigger( + providerId: mapValueOfType(json, r'providerId'), + deviceId: mapValueOfType(json, r'deviceId'), + stateName: mapValueOfType(json, r'stateName'), + stateValue: mapValueOfType(json, r'stateValue'), type: TriggerType.fromJson(json[r'type']), - ); + ); + } + return null; + } - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json.map((v) => Trigger.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 = Trigger.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] = Trigger.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Trigger.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of Trigger-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] = Trigger.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 = Trigger.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/mycore_api/lib/model/trigger_type.dart b/mycore_api/lib/model/trigger_type.dart index b2e9bac..a281fb0 100644 --- a/mycore_api/lib/model/trigger_type.dart +++ b/mycore_api/lib/model/trigger_type.dart @@ -1,15 +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; - +/// class TriggerType { /// Instantiate a new enum with the provided [value]. const TriggerType._(this.value); @@ -33,23 +34,28 @@ class TriggerType { TIME, ]; - static TriggerType fromJson(dynamic value) => - TriggerTypeTypeTransformer().decode(value); + static TriggerType? fromJson(dynamic value) => TriggerTypeTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => TriggerType.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 = TriggerType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [TriggerType] to String, /// and [decode] dynamic data back to [TriggerType]. class TriggerTypeTypeTransformer { - const TriggerTypeTypeTransformer._(); + factory TriggerTypeTypeTransformer() => _instance ??= const TriggerTypeTypeTransformer._(); - factory TriggerTypeTypeTransformer() => _instance ??= TriggerTypeTypeTransformer._(); + const TriggerTypeTypeTransformer._(); String encode(TriggerType data) => data.value; @@ -61,19 +67,22 @@ class TriggerTypeTypeTransformer { /// /// 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. - TriggerType decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'MQTT': return TriggerType.MQTT; - case r'WEB': return TriggerType.WEB; - case r'TIME': return TriggerType.TIME; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + TriggerType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'MQTT': return TriggerType.MQTT; + case r'WEB': return TriggerType.WEB; + case r'TIME': return TriggerType.TIME; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [TriggerTypeTypeTransformer] instance. - static TriggerTypeTypeTransformer _instance; + static TriggerTypeTypeTransformer? _instance; } + diff --git a/mycore_api/lib/model/twitter_auth_model.dart b/mycore_api/lib/model/twitter_auth_model.dart index c9c8c76..0d8724d 100644 --- a/mycore_api/lib/model/twitter_auth_model.dart +++ b/mycore_api/lib/model/twitter_auth_model.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 TwitterAuthModel { this.apiKey, }); - String apiKey; + String? apiKey; @override bool operator ==(Object other) => identical(this, other) || other is TwitterAuthModel && @@ -23,49 +24,89 @@ class TwitterAuthModel { @override int get hashCode => - (apiKey == null ? 0 : apiKey.hashCode); + // ignore: unnecessary_parenthesis + (apiKey == null ? 0 : apiKey!.hashCode); @override String toString() => 'TwitterAuthModel[apiKey=$apiKey]'; Map toJson() { - final json = {}; + final _json = {}; if (apiKey != null) { - json[r'apiKey'] = apiKey; + _json[r'apiKey'] = apiKey; } - return json; + return _json; } /// Returns a new [TwitterAuthModel] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static TwitterAuthModel fromJson(Map json) => json == null - ? null - : TwitterAuthModel( - apiKey: json[r'apiKey'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TwitterAuthModel? 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) => TwitterAuthModel.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 "TwitterAuthModel[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "TwitterAuthModel[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return TwitterAuthModel( + apiKey: mapValueOfType(json, r'apiKey'), + ); + } + 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 = TwitterAuthModel.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] = TwitterAuthModel.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TwitterAuthModel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of TwitterAuthModel-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] = TwitterAuthModel.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 = TwitterAuthModel.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/mycore_api/lib/model/user.dart b/mycore_api/lib/model/user.dart index 5a7e287..54663b2 100644 --- a/mycore_api/lib/model/user.dart +++ b/mycore_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; @@ -16,9 +17,9 @@ class User { this.password, }); - String id; + String? id; - String password; + String? password; @override bool operator ==(Object other) => identical(this, other) || other is User && @@ -27,54 +28,94 @@ class User { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (password == null ? 0 : password.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (password == null ? 0 : password!.hashCode); @override String toString() => 'User[id=$id, password=$password]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (password != null) { - json[r'password'] = password; + _json[r'password'] = password; } - return json; + 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'], - password: json[r'password'], - ); + /// [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'), + 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 = 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/mycore_api/lib/model/user_info.dart b/mycore_api/lib/model/user_info.dart index 81876bd..78a8327 100644 --- a/mycore_api/lib/model/user_info.dart +++ b/mycore_api/lib/model/user_info.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,7 +21,7 @@ class UserInfo { this.lastName, this.token, this.birthday, - this.homeIds, + this.homeIds = const [], this.dateCreation, this.address, this.city, @@ -31,39 +32,57 @@ class UserInfo { this.postalCode, }); - String id; + String? id; - String role; + String? role; - String email; + String? email; - String password; + String? password; - String firstName; + String? firstName; - String lastName; + String? lastName; - String token; + String? token; - DateTime birthday; + /// + /// 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? birthday; - List homeIds; + List? homeIds; - 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 address; + String? address; - String city; + String? city; - String state; + String? state; - String country; + String? country; - String language; + String? language; - String timeZone; + String? timeZone; - int postalCode; + /// + /// 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? postalCode; @override bool operator ==(Object other) => identical(this, other) || other is UserInfo && @@ -87,135 +106,171 @@ class UserInfo { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (role == null ? 0 : role.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) + - (birthday == null ? 0 : birthday.hashCode) + - (homeIds == null ? 0 : homeIds.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode) + - (address == null ? 0 : address.hashCode) + - (city == null ? 0 : city.hashCode) + - (state == null ? 0 : state.hashCode) + - (country == null ? 0 : country.hashCode) + - (language == null ? 0 : language.hashCode) + - (timeZone == null ? 0 : timeZone.hashCode) + - (postalCode == null ? 0 : postalCode.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (role == null ? 0 : role!.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) + + (birthday == null ? 0 : birthday!.hashCode) + + (homeIds == null ? 0 : homeIds!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (address == null ? 0 : address!.hashCode) + + (city == null ? 0 : city!.hashCode) + + (state == null ? 0 : state!.hashCode) + + (country == null ? 0 : country!.hashCode) + + (language == null ? 0 : language!.hashCode) + + (timeZone == null ? 0 : timeZone!.hashCode) + + (postalCode == null ? 0 : postalCode!.hashCode); @override String toString() => 'UserInfo[id=$id, role=$role, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, birthday=$birthday, homeIds=$homeIds, dateCreation=$dateCreation, address=$address, city=$city, state=$state, country=$country, language=$language, timeZone=$timeZone, postalCode=$postalCode]'; Map toJson() { - final json = {}; + final _json = {}; if (id != null) { - json[r'id'] = id; + _json[r'id'] = id; } if (role != null) { - json[r'role'] = role; + _json[r'role'] = role; } 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 (birthday != null) { - json[r'birthday'] = birthday.toUtc().toIso8601String(); + _json[r'birthday'] = birthday!.toUtc().toIso8601String(); } if (homeIds != null) { - json[r'homeIds'] = homeIds; + _json[r'homeIds'] = homeIds; } if (dateCreation != null) { - json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } if (address != null) { - json[r'address'] = address; + _json[r'address'] = address; } if (city != null) { - json[r'city'] = city; + _json[r'city'] = city; } if (state != null) { - json[r'state'] = state; + _json[r'state'] = state; } if (country != null) { - json[r'country'] = country; + _json[r'country'] = country; } if (language != null) { - json[r'language'] = language; + _json[r'language'] = language; } if (timeZone != null) { - json[r'timeZone'] = timeZone; + _json[r'timeZone'] = timeZone; } if (postalCode != null) { - json[r'postalCode'] = postalCode; + _json[r'postalCode'] = postalCode; } - return json; + return _json; } /// Returns a new [UserInfo] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static UserInfo fromJson(Map json) => json == null - ? null - : UserInfo( - id: json[r'id'], - role: json[r'role'], - email: json[r'email'], - password: json[r'password'], - firstName: json[r'firstName'], - lastName: json[r'lastName'], - token: json[r'token'], - birthday: json[r'birthday'] == null - ? null - : DateTime.parse(json[r'birthday']), - homeIds: json[r'homeIds'] == null - ? null - : (json[r'homeIds'] as List).cast(), - dateCreation: json[r'dateCreation'] == null - ? null - : DateTime.parse(json[r'dateCreation']), - address: json[r'address'], - city: json[r'city'], - state: json[r'state'], - country: json[r'country'], - language: json[r'language'], - timeZone: json[r'timeZone'], - postalCode: json[r'postalCode'], - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static UserInfo? 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) => UserInfo.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 "UserInfo[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "UserInfo[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return UserInfo( + id: mapValueOfType(json, r'id'), + role: mapValueOfType(json, r'role'), + 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'), + birthday: mapDateTime(json, r'birthday', ''), + homeIds: json[r'homeIds'] is List + ? (json[r'homeIds'] as List).cast() + : const [], + dateCreation: mapDateTime(json, r'dateCreation', ''), + address: mapValueOfType(json, r'address'), + city: mapValueOfType(json, r'city'), + state: mapValueOfType(json, r'state'), + country: mapValueOfType(json, r'country'), + language: mapValueOfType(json, r'language'), + timeZone: mapValueOfType(json, r'timeZone'), + postalCode: mapValueOfType(json, r'postalCode'), + ); + } + 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 = UserInfo.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] = UserInfo.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UserInfo.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of UserInfo-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] = UserInfo.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 = UserInfo.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/mycore_api/lib/model/user_info_detail_dto.dart b/mycore_api/lib/model/user_info_detail_dto.dart index d56fe54..ef11a74 100644 --- a/mycore_api/lib/model/user_info_detail_dto.dart +++ b/mycore_api/lib/model/user_info_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; @@ -17,20 +18,20 @@ class UserInfoDetailDTO { this.firstName, this.lastName, this.language, - this.homeIds, + this.homeIds = const [], }); - String id; + String? id; - String email; + String? email; - String firstName; + String? firstName; - String lastName; + String? lastName; - String language; + String? language; - List homeIds; + List? homeIds; @override bool operator ==(Object other) => identical(this, other) || other is UserInfoDetailDTO && @@ -43,76 +44,116 @@ class UserInfoDetailDTO { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (email == null ? 0 : email.hashCode) + - (firstName == null ? 0 : firstName.hashCode) + - (lastName == null ? 0 : lastName.hashCode) + - (language == null ? 0 : language.hashCode) + - (homeIds == null ? 0 : homeIds.hashCode); + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (email == null ? 0 : email!.hashCode) + + (firstName == null ? 0 : firstName!.hashCode) + + (lastName == null ? 0 : lastName!.hashCode) + + (language == null ? 0 : language!.hashCode) + + (homeIds == null ? 0 : homeIds!.hashCode); @override String toString() => 'UserInfoDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName, language=$language, homeIds=$homeIds]'; 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; } if (language != null) { - json[r'language'] = language; + _json[r'language'] = language; } if (homeIds != null) { - json[r'homeIds'] = homeIds; + _json[r'homeIds'] = homeIds; } - return json; + return _json; } /// Returns a new [UserInfoDetailDTO] instance and imports its values from - /// [json] if it's non-null, null if [json] is null. - static UserInfoDetailDTO fromJson(Map json) => json == null - ? null - : UserInfoDetailDTO( - id: json[r'id'], - email: json[r'email'], - firstName: json[r'firstName'], - lastName: json[r'lastName'], - language: json[r'language'], - homeIds: json[r'homeIds'] == null - ? null - : (json[r'homeIds'] as List).cast(), - ); + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static UserInfoDetailDTO? 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) => UserInfoDetailDTO.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 "UserInfoDetailDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "UserInfoDetailDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); - static Map mapFromJson(Map json) { + return UserInfoDetailDTO( + id: mapValueOfType(json, r'id'), + email: mapValueOfType(json, r'email'), + firstName: mapValueOfType(json, r'firstName'), + lastName: mapValueOfType(json, r'lastName'), + language: mapValueOfType(json, r'language'), + homeIds: json[r'homeIds'] is List + ? (json[r'homeIds'] as List).cast() + : 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 = UserInfoDetailDTO.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] = UserInfoDetailDTO.fromJson(v)); + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UserInfoDetailDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } } return map; } // maps a json object with a list of UserInfoDetailDTO-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] = UserInfoDetailDTO.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 = UserInfoDetailDTO.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/mycore_api/lib/model/view_by.dart b/mycore_api/lib/model/view_by.dart index f61f4cc..2cf70e9 100644 --- a/mycore_api/lib/model/view_by.dart +++ b/mycore_api/lib/model/view_by.dart @@ -1,15 +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; - +/// class ViewBy { /// Instantiate a new enum with the provided [value]. const ViewBy._(this.value); @@ -33,23 +34,28 @@ class ViewBy { day, ]; - static ViewBy fromJson(dynamic value) => - ViewByTypeTransformer().decode(value); + static ViewBy? fromJson(dynamic value) => ViewByTypeTransformer().decode(value); - static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => - json == null || json.isEmpty - ? true == emptyIsNull ? null : [] - : json - .map((value) => ViewBy.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 = ViewBy.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } } /// Transformation class that can [encode] an instance of [ViewBy] to String, /// and [decode] dynamic data back to [ViewBy]. class ViewByTypeTransformer { - const ViewByTypeTransformer._(); + factory ViewByTypeTransformer() => _instance ??= const ViewByTypeTransformer._(); - factory ViewByTypeTransformer() => _instance ??= ViewByTypeTransformer._(); + const ViewByTypeTransformer._(); String encode(ViewBy data) => data.value; @@ -61,19 +67,22 @@ class ViewByTypeTransformer { /// /// 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. - ViewBy decode(dynamic data, {bool allowNull}) { - switch (data) { - case r'Year': return ViewBy.year; - case r'Month': return ViewBy.month; - case r'Day': return ViewBy.day; - default: - if (allowNull == false) { - throw ArgumentError('Unknown enum value to decode: $data'); - } + ViewBy? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data.toString()) { + case r'Year': return ViewBy.year; + case r'Month': return ViewBy.month; + case r'Day': return ViewBy.day; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } } return null; } /// Singleton [ViewByTypeTransformer] instance. - static ViewByTypeTransformer _instance; + static ViewByTypeTransformer? _instance; } + diff --git a/mycore_api/pubspec.lock b/mycore_api/pubspec.lock new file mode 100644 index 0000000..cce4316 --- /dev/null +++ b/mycore_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: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.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: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + 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: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + logging: + dependency: transitive + description: + name: logging + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + 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: "12307e7f0605ce3da64cf0db90e5fcab0869f3ca03f76be6bb2991ce0a55e82b" + url: "https://pub.dev" + source: hosted + version: "1.9.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: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + 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: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" + 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 <3.0.0" diff --git a/mycore_api/pubspec.yaml b/mycore_api/pubspec.yaml index 2a260d4..4e08646 100644 --- a/mycore_api/pubspec.yaml +++ b/mycore_api/pubspec.yaml @@ -2,19 +2,15 @@ # AUTO-GENERATED FILE, DO NOT MODIFY! # -name: 'mycoreapi' +name: 'mycore_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/mycore_api/test/action_test.dart b/mycore_api/test/action_test.dart index f3e6914..c64e9af 100644 --- a/mycore_api/test/action_test.dart +++ b/mycore_api/test/action_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for Action void main() { - final instance = Action(); + // final instance = Action(); group('test Action', () { // String groupId @@ -25,7 +26,7 @@ void main() { // TODO }); - // List states (default value: const []) + // List states (default value: const []) test('to test the property `states`', () async { // TODO }); @@ -45,6 +46,11 @@ void main() { // TODO }); + // bool isForce + test('to test the property `isForce`', () async { + // TODO + }); + }); diff --git a/mycore_api/test/action_type_test.dart b/mycore_api/test/action_type_test.dart index f0c08c3..a6f8b9b 100644 --- a/mycore_api/test/action_type_test.dart +++ b/mycore_api/test/action_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ActionType diff --git a/mycore_api/test/alarm_api_test.dart b/mycore_api/test/alarm_api_test.dart index 57c92e7..097e069 100644 --- a/mycore_api/test/alarm_api_test.dart +++ b/mycore_api/test/alarm_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for AlarmApi void main() { - final instance = AlarmApi(); + // final instance = AlarmApi(); group('tests for AlarmApi', () { - // Activate current alarm mode + // Activate specified alarm mode // //Future alarmActivate(String alarmModeId) async test('test alarmActivate', () async { @@ -60,7 +61,7 @@ void main() { // Get detail info of a specified alarm mode // - //Future alarmGetDetail(String alarmId, { String alarmModeId }) async + //Future alarmGetDetail(String alarmModeId) async test('test alarmGetDetail', () async { // TODO }); diff --git a/mycore_api/test/alarm_mode_create_or_update_detail_dto_all_of_test.dart b/mycore_api/test/alarm_mode_create_or_update_detail_dto_all_of_test.dart index 3152fe5..5a4c7df 100644 --- a/mycore_api/test/alarm_mode_create_or_update_detail_dto_all_of_test.dart +++ b/mycore_api/test/alarm_mode_create_or_update_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmModeCreateOrUpdateDetailDTOAllOf void main() { - final instance = AlarmModeCreateOrUpdateDetailDTOAllOf(); + // final instance = AlarmModeCreateOrUpdateDetailDTOAllOf(); group('test AlarmModeCreateOrUpdateDetailDTOAllOf', () { // List triggers (default value: const []) diff --git a/mycore_api/test/alarm_mode_create_or_update_detail_dto_test.dart b/mycore_api/test/alarm_mode_create_or_update_detail_dto_test.dart index c3ffe13..ef4469b 100644 --- a/mycore_api/test/alarm_mode_create_or_update_detail_dto_test.dart +++ b/mycore_api/test/alarm_mode_create_or_update_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmModeCreateOrUpdateDetailDTO void main() { - final instance = AlarmModeCreateOrUpdateDetailDTO(); + // final instance = AlarmModeCreateOrUpdateDetailDTO(); group('test AlarmModeCreateOrUpdateDetailDTO', () { // String id diff --git a/mycore_api/test/alarm_mode_detail_dto_all_of_test.dart b/mycore_api/test/alarm_mode_detail_dto_all_of_test.dart index c9776e5..95622eb 100644 --- a/mycore_api/test/alarm_mode_detail_dto_all_of_test.dart +++ b/mycore_api/test/alarm_mode_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmModeDetailDTOAllOf void main() { - final instance = AlarmModeDetailDTOAllOf(); + // final instance = AlarmModeDetailDTOAllOf(); group('test AlarmModeDetailDTOAllOf', () { // List triggers (default value: const []) diff --git a/mycore_api/test/alarm_mode_detail_dto_test.dart b/mycore_api/test/alarm_mode_detail_dto_test.dart index 8c886aa..4699dca 100644 --- a/mycore_api/test/alarm_mode_detail_dto_test.dart +++ b/mycore_api/test/alarm_mode_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmModeDetailDTO void main() { - final instance = AlarmModeDetailDTO(); + // final instance = AlarmModeDetailDTO(); group('test AlarmModeDetailDTO', () { // String id diff --git a/mycore_api/test/alarm_mode_dto_test.dart b/mycore_api/test/alarm_mode_dto_test.dart index 5ee6258..5eded41 100644 --- a/mycore_api/test/alarm_mode_dto_test.dart +++ b/mycore_api/test/alarm_mode_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmModeDTO void main() { - final instance = AlarmModeDTO(); + // final instance = AlarmModeDTO(); group('test AlarmModeDTO', () { // String id diff --git a/mycore_api/test/alarm_mode_geolocalized_mode_test.dart b/mycore_api/test/alarm_mode_geolocalized_mode_test.dart new file mode 100644 index 0000000..ef77a35 --- /dev/null +++ b/mycore_api/test/alarm_mode_geolocalized_mode_test.dart @@ -0,0 +1,42 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeGeolocalizedMode +void main() { + // final instance = AlarmModeGeolocalizedMode(); + + group('test AlarmModeGeolocalizedMode', () { + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // TimePeriodAlarmAlarmMode homeMode + test('to test the property `homeMode`', () async { + // TODO + }); + + // TimePeriodAlarmAlarmMode absentMode + test('to test the property `absentMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/alarm_mode_programmed_mode_test.dart b/mycore_api/test/alarm_mode_programmed_mode_test.dart new file mode 100644 index 0000000..db24bd7 --- /dev/null +++ b/mycore_api/test/alarm_mode_programmed_mode_test.dart @@ -0,0 +1,57 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeProgrammedMode +void main() { + // final instance = AlarmModeProgrammedMode(); + + group('test AlarmModeProgrammedMode', () { + // List monday (default value: const []) + test('to test the property `monday`', () async { + // TODO + }); + + // List tuesday (default value: const []) + test('to test the property `tuesday`', () async { + // TODO + }); + + // List wednesday (default value: const []) + test('to test the property `wednesday`', () async { + // TODO + }); + + // List thursday (default value: const []) + test('to test the property `thursday`', () async { + // TODO + }); + + // List friday (default value: const []) + test('to test the property `friday`', () async { + // TODO + }); + + // List saturday (default value: const []) + test('to test the property `saturday`', () async { + // TODO + }); + + // List sunday (default value: const []) + test('to test the property `sunday`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/alarm_mode_test.dart b/mycore_api/test/alarm_mode_test.dart index 82856c2..479025a 100644 --- a/mycore_api/test/alarm_mode_test.dart +++ b/mycore_api/test/alarm_mode_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmMode void main() { - final instance = AlarmMode(); + // final instance = AlarmMode(); group('test AlarmMode', () { // String id @@ -60,12 +61,12 @@ void main() { // TODO }); - // OneOfProgrammedMode programmedMode + // AlarmModeProgrammedMode programmedMode test('to test the property `programmedMode`', () async { // TODO }); - // OneOfGeolocalizedMode geolocalizedMode + // AlarmModeGeolocalizedMode geolocalizedMode test('to test the property `geolocalizedMode`', () async { // TODO }); diff --git a/mycore_api/test/alarm_triggered_test.dart b/mycore_api/test/alarm_triggered_test.dart index afb0001..53bc8d2 100644 --- a/mycore_api/test/alarm_triggered_test.dart +++ b/mycore_api/test/alarm_triggered_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmTriggered void main() { - final instance = AlarmTriggered(); + // final instance = AlarmTriggered(); group('test AlarmTriggered', () { // String alarmModeId diff --git a/mycore_api/test/alarm_type_test.dart b/mycore_api/test/alarm_type_test.dart index a37cbb6..3b154f0 100644 --- a/mycore_api/test/alarm_type_test.dart +++ b/mycore_api/test/alarm_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AlarmType diff --git a/mycore_api/test/authentication_api_test.dart b/mycore_api/test/authentication_api_test.dart index ff8de62..7d36063 100644 --- a/mycore_api/test/authentication_api_test.dart +++ b/mycore_api/test/authentication_api_test.dart @@ -1,31 +1,32 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for AuthenticationApi void main() { - final instance = AuthenticationApi(); + // final instance = AuthenticationApi(); group('tests for AuthenticationApi', () { // Authenticate with form parameters (used by Swagger test client) // - //Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async + //Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async test('test authenticationAuthenticateWithForm', () async { // TODO }); // Authenticate with Json parameters (used by most clients) // - //Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async + //Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async test('test authenticationAuthenticateWithJson', () async { // TODO }); diff --git a/mycore_api/test/automation_api_test.dart b/mycore_api/test/automation_api_test.dart index cef701b..abf6bb7 100644 --- a/mycore_api/test/automation_api_test.dart +++ b/mycore_api/test/automation_api_test.dart @@ -1,43 +1,46 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for AutomationApi void main() { - final instance = AutomationApi(); + // final instance = AutomationApi(); group('tests for AutomationApi', () { - //Future automationCreate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async + // Create an automation + // + //Future automationCreate(AutomationDetailDTO automationDetailDTO) async test('test automationCreate', () async { // TODO }); // Delete an automation // - //Future automationDelete(String automationId) async + //Future automationDelete(String automationId) async test('test automationDelete', () async { // TODO }); - // Delete all automation for a specified + // Delete all automation for a specified home // - //Future automationDeleteAllForUser(String userId) async - test('test automationDeleteAllForUser', () async { + //Future automationDeleteAllForHome(String homeId) async + test('test automationDeleteAllForHome', () async { // TODO }); - // Get all automations for the specified user + // Get all automations for the specified home // - //Future> automationGetAll(String userId) async + //Future> automationGetAll(String homeId) async test('test automationGetAll', () async { // TODO }); @@ -51,7 +54,7 @@ void main() { // Update an automation // - //Future automationUpdate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async + //Future automationUpdate(AutomationDetailDTO automationDetailDTO) async test('test automationUpdate', () async { // TODO }); diff --git a/mycore_api/test/automation_detail_dto_all_of_test.dart b/mycore_api/test/automation_detail_dto_all_of_test.dart index cd53513..97081c8 100644 --- a/mycore_api/test/automation_detail_dto_all_of_test.dart +++ b/mycore_api/test/automation_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AutomationDetailDTOAllOf void main() { - final instance = AutomationDetailDTOAllOf(); + // final instance = AutomationDetailDTOAllOf(); group('test AutomationDetailDTOAllOf', () { // List triggers (default value: const []) diff --git a/mycore_api/test/automation_detail_dto_test.dart b/mycore_api/test/automation_detail_dto_test.dart index d5efa73..f835d3b 100644 --- a/mycore_api/test/automation_detail_dto_test.dart +++ b/mycore_api/test/automation_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AutomationDetailDTO void main() { - final instance = AutomationDetailDTO(); + // final instance = AutomationDetailDTO(); group('test AutomationDetailDTO', () { // String id @@ -25,8 +26,13 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // bool active + test('to test the property `active`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/automation_dto_test.dart b/mycore_api/test/automation_dto_test.dart index c3230e5..ef53736 100644 --- a/mycore_api/test/automation_dto_test.dart +++ b/mycore_api/test/automation_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AutomationDTO void main() { - final instance = AutomationDTO(); + // final instance = AutomationDTO(); group('test AutomationDTO', () { // String id @@ -25,8 +26,13 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // bool active + test('to test the property `active`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/automation_state_test.dart b/mycore_api/test/automation_state_test.dart index c4880f7..8dfa4c4 100644 --- a/mycore_api/test/automation_state_test.dart +++ b/mycore_api/test/automation_state_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AutomationState void main() { - final instance = AutomationState(); + // final instance = AutomationState(); group('test AutomationState', () { // String name diff --git a/mycore_api/test/automation_triggered_test.dart b/mycore_api/test/automation_triggered_test.dart index 7ead09b..0ddcec0 100644 --- a/mycore_api/test/automation_triggered_test.dart +++ b/mycore_api/test/automation_triggered_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AutomationTriggered void main() { - final instance = AutomationTriggered(); + // final instance = AutomationTriggered(); group('test AutomationTriggered', () { // String automationId diff --git a/mycore_api/test/azure_ad_auth_model_test.dart b/mycore_api/test/azure_ad_auth_model_test.dart index 61e3f1d..f770343 100644 --- a/mycore_api/test/azure_ad_auth_model_test.dart +++ b/mycore_api/test/azure_ad_auth_model_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for AzureADAuthModel void main() { - final instance = AzureADAuthModel(); + // final instance = AzureADAuthModel(); group('test AzureADAuthModel', () { // String apiKey diff --git a/mycore_api/test/azure_api_test.dart b/mycore_api/test/azure_api_test.dart index 06fb54d..f0b7780 100644 --- a/mycore_api/test/azure_api_test.dart +++ b/mycore_api/test/azure_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for AzureApi void main() { - final instance = AzureApi(); + // final instance = AzureApi(); group('tests for AzureApi', () { //Future azureCreate(AzureADAuthModel azureADAuthModel) async diff --git a/mycore_api/test/book_test.dart b/mycore_api/test/book_test.dart index 5099f95..39cb2af 100644 --- a/mycore_api/test/book_test.dart +++ b/mycore_api/test/book_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for Book void main() { - final instance = Book(); + // final instance = Book(); group('test Book', () { // String id diff --git a/mycore_api/test/books_api_test.dart b/mycore_api/test/books_api_test.dart index 53ddc9a..a5dab9a 100644 --- a/mycore_api/test/books_api_test.dart +++ b/mycore_api/test/books_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for BooksApi void main() { - final instance = BooksApi(); + // final instance = BooksApi(); group('tests for BooksApi', () { //Future booksCreate(Book book) async diff --git a/mycore_api/test/condition_state_test.dart b/mycore_api/test/condition_state_test.dart new file mode 100644 index 0000000..b55a2f3 --- /dev/null +++ b/mycore_api/test/condition_state_test.dart @@ -0,0 +1,32 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for ConditionState +void main() { + // final instance = ConditionState(); + + group('test ConditionState', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String value + test('to test the property `value`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/condition_test.dart b/mycore_api/test/condition_test.dart index 82ae0fb..c3a8af1 100644 --- a/mycore_api/test/condition_test.dart +++ b/mycore_api/test/condition_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for Condition void main() { - final instance = Condition(); + // final instance = Condition(); group('test Condition', () { // String deviceId @@ -20,7 +21,7 @@ void main() { // TODO }); - // OneOfState state + // ConditionState state test('to test the property `state`', () async { // TODO }); diff --git a/mycore_api/test/condition_type_test.dart b/mycore_api/test/condition_type_test.dart index acdff11..91c3064 100644 --- a/mycore_api/test/condition_type_test.dart +++ b/mycore_api/test/condition_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ConditionType diff --git a/mycore_api/test/condition_value_test.dart b/mycore_api/test/condition_value_test.dart index efb3270..4aff23a 100644 --- a/mycore_api/test/condition_value_test.dart +++ b/mycore_api/test/condition_value_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ConditionValue diff --git a/mycore_api/test/connection_status_test.dart b/mycore_api/test/connection_status_test.dart index b5e0825..4c889bd 100644 --- a/mycore_api/test/connection_status_test.dart +++ b/mycore_api/test/connection_status_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ConnectionStatus diff --git a/mycore_api/test/create_or_update_home_dto_all_of_test.dart b/mycore_api/test/create_or_update_home_dto_all_of_test.dart index 32e11d2..6264b64 100644 --- a/mycore_api/test/create_or_update_home_dto_all_of_test.dart +++ b/mycore_api/test/create_or_update_home_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for CreateOrUpdateHomeDTOAllOf void main() { - final instance = CreateOrUpdateHomeDTOAllOf(); + // final instance = CreateOrUpdateHomeDTOAllOf(); group('test CreateOrUpdateHomeDTOAllOf', () { // List usersIds (default value: const []) diff --git a/mycore_api/test/create_or_update_home_dto_test.dart b/mycore_api/test/create_or_update_home_dto_test.dart index c4e08bc..4d5ad51 100644 --- a/mycore_api/test/create_or_update_home_dto_test.dart +++ b/mycore_api/test/create_or_update_home_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for CreateOrUpdateHomeDTO void main() { - final instance = CreateOrUpdateHomeDTO(); + // final instance = CreateOrUpdateHomeDTO(); group('test CreateOrUpdateHomeDTO', () { // String id @@ -35,7 +36,7 @@ void main() { // TODO }); - // OneOfAlarmModeDTO currentAlarmMode + // HomeDTOCurrentAlarmMode currentAlarmMode test('to test the property `currentAlarmMode`', () async { // TODO }); diff --git a/mycore_api/test/device_api_test.dart b/mycore_api/test/device_api_test.dart index 7f0c599..e18ad63 100644 --- a/mycore_api/test/device_api_test.dart +++ b/mycore_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for DeviceApi void main() { - final instance = DeviceApi(); + // final instance = DeviceApi(); group('tests for DeviceApi', () { // Create a device @@ -25,35 +26,35 @@ void main() { // Create devices from provider // - //Future> deviceCreateDevicesFromProvider(String userId, String providerId) async + //Future> deviceCreateDevicesFromProvider(String homeId, String providerId) async test('test deviceCreateDevicesFromProvider', () async { // TODO }); // Delete a device // - //Future deviceDelete(String deviceId) async + //Future deviceDelete(String deviceId) async test('test deviceDelete', () async { // TODO }); - // Delete all device for a specified + // Delete all device for a specified home // - //Future deviceDeleteAllForUser(String userId) async - test('test deviceDeleteAllForUser', () async { + //Future deviceDeleteAllForHome(String homeId) async + test('test deviceDeleteAllForHome', () async { // TODO }); // Delete devices from provider // - //Future deviceDeleteDevicesFromProvider(String userId, String providerId) async + //Future deviceDeleteDevicesFromProvider(String homeId, String providerId) async test('test deviceDeleteDevicesFromProvider', () async { // TODO }); // Get all devices summary // - //Future> deviceGetAll(String userId) async + //Future> deviceGetAll(String homeId) async test('test deviceGetAll', () async { // TODO }); @@ -67,25 +68,32 @@ void main() { // Get list of devices from a type // - //Future> deviceGetDevicesByType(String userId, DeviceType type) async + //Future> deviceGetDevicesByType(String homeId, DeviceType type) async test('test deviceGetDevicesByType', () async { // TODO }); // Get devices from provider // - //Future> deviceGetDevicesFromProvider(String userId, String providerId) async + //Future> deviceGetDevicesFromProvider(String homeId, String providerId) async test('test deviceGetDevicesFromProvider', () async { // TODO }); // Get all zigbee2Mqtt devices // - //Future> deviceGetDevicesFromZigbee2Mqtt(String userId) async + //Future> deviceGetDevicesFromZigbee2Mqtt(String homeId) async test('test deviceGetDevicesFromZigbee2Mqtt', () async { // TODO }); + // Send action to device + // + //Future deviceSendAction(Action action) async + test('test deviceSendAction', () async { + // TODO + }); + // Update a device // //Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO) async diff --git a/mycore_api/test/device_detail_dto_all_of_test.dart b/mycore_api/test/device_detail_dto_all_of_test.dart index 0f33460..7568eac 100644 --- a/mycore_api/test/device_detail_dto_all_of_test.dart +++ b/mycore_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceDetailDTOAllOf void main() { - final instance = DeviceDetailDTOAllOf(); + // final instance = DeviceDetailDTOAllOf(); group('test DeviceDetailDTOAllOf', () { // String firmwareVersion @@ -70,7 +71,7 @@ void main() { // TODO }); - // Map properties (default value: const {}) + // String properties test('to test the property `properties`', () async { // TODO }); diff --git a/mycore_api/test/device_detail_dto_test.dart b/mycore_api/test/device_detail_dto_test.dart index 6e6d788..7456ca7 100644 --- a/mycore_api/test/device_detail_dto_test.dart +++ b/mycore_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:mycoreapi/api.dart'; +import 'package:mycore_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,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); @@ -55,8 +56,8 @@ void main() { // TODO }); - // String locationId - test('to test the property `locationId`', () async { + // String roomId + test('to test the property `roomId`', () async { // TODO }); @@ -70,11 +71,6 @@ void main() { // TODO }); - // OneOfLocationDTO location - test('to test the property `location`', () async { - // TODO - }); - // DateTime lastStateDate test('to test the property `lastStateDate`', () async { // TODO @@ -145,7 +141,7 @@ void main() { // TODO }); - // Map properties (default value: const {}) + // String properties test('to test the property `properties`', () async { // TODO }); diff --git a/mycore_api/test/device_state_test.dart b/mycore_api/test/device_state_test.dart index fcb572f..36bd4b9 100644 --- a/mycore_api/test/device_state_test.dart +++ b/mycore_api/test/device_state_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceState void main() { - final instance = DeviceState(); + // final instance = DeviceState(); group('test DeviceState', () { // String deviceId diff --git a/mycore_api/test/device_summary_dto_test.dart b/mycore_api/test/device_summary_dto_test.dart index fd43725..a1d305d 100644 --- a/mycore_api/test/device_summary_dto_test.dart +++ b/mycore_api/test/device_summary_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceSummaryDTO void main() { - final instance = DeviceSummaryDTO(); + // final instance = DeviceSummaryDTO(); group('test DeviceSummaryDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); @@ -55,8 +56,8 @@ void main() { // TODO }); - // String locationId - test('to test the property `locationId`', () async { + // String roomId + test('to test the property `roomId`', () async { // TODO }); @@ -70,11 +71,6 @@ void main() { // TODO }); - // OneOfLocationDTO location - test('to test the property `location`', () async { - // TODO - }); - // DateTime lastStateDate test('to test the property `lastStateDate`', () async { // TODO diff --git a/mycore_api/test/device_type_test.dart b/mycore_api/test/device_type_test.dart index ad3d2e4..72d3a38 100644 --- a/mycore_api/test/device_type_test.dart +++ b/mycore_api/test/device_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for DeviceType diff --git a/mycore_api/test/electricity_production_test.dart b/mycore_api/test/electricity_production_test.dart index e366f6e..9f5ca14 100644 --- a/mycore_api/test/electricity_production_test.dart +++ b/mycore_api/test/electricity_production_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ElectricityProduction void main() { - final instance = ElectricityProduction(); + // final instance = ElectricityProduction(); group('test ElectricityProduction', () { // String id @@ -25,8 +26,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/energy_api_test.dart b/mycore_api/test/energy_api_test.dart index 3b3e5ad..e98c768 100644 --- a/mycore_api/test/energy_api_test.dart +++ b/mycore_api/test/energy_api_test.dart @@ -1,24 +1,25 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for EnergyApi void main() { - final instance = EnergyApi(); + // final instance = EnergyApi(); group('tests for EnergyApi', () { // Get summary production of Kwh/Year // - //Future> energyGetElectricityProduction({ String userId, ViewBy viewBy }) async + //Future> energyGetElectricityProduction({ String homeId, ViewBy viewBy }) async test('test energyGetElectricityProduction', () async { // TODO }); diff --git a/mycore_api/test/event_api_test.dart b/mycore_api/test/event_api_test.dart index 3c7170a..d8e8748 100644 --- a/mycore_api/test/event_api_test.dart +++ b/mycore_api/test/event_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for EventApi void main() { - final instance = EventApi(); + // final instance = EventApi(); group('tests for EventApi', () { // Delete an event @@ -32,7 +33,7 @@ void main() { // Get events for the specified home // - //Future> eventGet(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, OneOfEventType eventType, OneOfDeviceType deviceType }) async + //Future eventGet(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventGetEventTypeParameter eventType, EventGetDeviceTypeParameter deviceType }) async test('test eventGet', () async { // TODO }); diff --git a/mycore_api/test/event_detail_dto_all_of_test.dart b/mycore_api/test/event_detail_dto_all_of_test.dart index 535224d..c1f8b55 100644 --- a/mycore_api/test/event_detail_dto_all_of_test.dart +++ b/mycore_api/test/event_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventDetailDTOAllOf void main() { - final instance = EventDetailDTOAllOf(); + // final instance = EventDetailDTOAllOf(); group('test EventDetailDTOAllOf', () { // OneOfDeviceState deviceState diff --git a/mycore_api/test/event_detail_dto_test.dart b/mycore_api/test/event_detail_dto_test.dart index 5bebf78..fe7e6fd 100644 --- a/mycore_api/test/event_detail_dto_test.dart +++ b/mycore_api/test/event_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventDetailDTO void main() { - final instance = EventDetailDTO(); + // final instance = EventDetailDTO(); group('test EventDetailDTO', () { // String id diff --git a/mycore_api/test/event_dto_test.dart b/mycore_api/test/event_dto_test.dart index 8f33ab0..6672512 100644 --- a/mycore_api/test/event_dto_test.dart +++ b/mycore_api/test/event_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventDTO void main() { - final instance = EventDTO(); + // final instance = EventDTO(); group('test EventDTO', () { // String id diff --git a/mycore_api/test/event_filter_test.dart b/mycore_api/test/event_filter_test.dart index 23372b7..e6e94e5 100644 --- a/mycore_api/test/event_filter_test.dart +++ b/mycore_api/test/event_filter_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventFilter void main() { - final instance = EventFilter(); + // final instance = EventFilter(); group('test EventFilter', () { // int startIndex @@ -35,12 +36,12 @@ void main() { // TODO }); - // OneOfEventType eventType + // EventGetEventTypeParameter eventType test('to test the property `eventType`', () async { // TODO }); - // OneOfDeviceType deviceType + // EventGetDeviceTypeParameter deviceType test('to test the property `deviceType`', () async { // TODO }); diff --git a/mycore_api/test/event_get_device_type_parameter_test.dart b/mycore_api/test/event_get_device_type_parameter_test.dart new file mode 100644 index 0000000..13264d6 --- /dev/null +++ b/mycore_api/test/event_get_device_type_parameter_test.dart @@ -0,0 +1,22 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for EventGetDeviceTypeParameter +void main() { + // final instance = EventGetDeviceTypeParameter(); + + group('test EventGetDeviceTypeParameter', () { + + }); + +} diff --git a/mycore_api/test/event_get_event_type_parameter_test.dart b/mycore_api/test/event_get_event_type_parameter_test.dart new file mode 100644 index 0000000..a750647 --- /dev/null +++ b/mycore_api/test/event_get_event_type_parameter_test.dart @@ -0,0 +1,22 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for EventGetEventTypeParameter +void main() { + // final instance = EventGetEventTypeParameter(); + + group('test EventGetEventTypeParameter', () { + + }); + +} diff --git a/mycore_api/test/event_home_filter_all_of_test.dart b/mycore_api/test/event_home_filter_all_of_test.dart index 3ce0036..784b700 100644 --- a/mycore_api/test/event_home_filter_all_of_test.dart +++ b/mycore_api/test/event_home_filter_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventHomeFilterAllOf void main() { - final instance = EventHomeFilterAllOf(); + // final instance = EventHomeFilterAllOf(); group('test EventHomeFilterAllOf', () { // String deviceId diff --git a/mycore_api/test/event_home_filter_test.dart b/mycore_api/test/event_home_filter_test.dart index 199f1c0..9e57e53 100644 --- a/mycore_api/test/event_home_filter_test.dart +++ b/mycore_api/test/event_home_filter_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventHomeFilter void main() { - final instance = EventHomeFilter(); + // final instance = EventHomeFilter(); group('test EventHomeFilter', () { // int startIndex @@ -35,12 +36,12 @@ void main() { // TODO }); - // OneOfEventType eventType + // EventGetEventTypeParameter eventType test('to test the property `eventType`', () async { // TODO }); - // OneOfDeviceType deviceType + // EventGetDeviceTypeParameter deviceType test('to test the property `deviceType`', () async { // TODO }); diff --git a/mycore_api/test/event_type_test.dart b/mycore_api/test/event_type_test.dart index 4cf4c36..15581f1 100644 --- a/mycore_api/test/event_type_test.dart +++ b/mycore_api/test/event_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for EventType diff --git a/mycore_api/test/facebook_api_test.dart b/mycore_api/test/facebook_api_test.dart index 5c125fb..e08e303 100644 --- a/mycore_api/test/facebook_api_test.dart +++ b/mycore_api/test/facebook_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for FacebookApi void main() { - final instance = FacebookApi(); + // final instance = FacebookApi(); group('tests for FacebookApi', () { //Future facebookCreate(FacebookAuthModel facebookAuthModel) async diff --git a/mycore_api/test/facebook_auth_model_test.dart b/mycore_api/test/facebook_auth_model_test.dart index 052e505..5e4e1ff 100644 --- a/mycore_api/test/facebook_auth_model_test.dart +++ b/mycore_api/test/facebook_auth_model_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for FacebookAuthModel void main() { - final instance = FacebookAuthModel(); + // final instance = FacebookAuthModel(); group('test FacebookAuthModel', () { // String userAccessToken diff --git a/mycore_api/test/geolocalized_mode_test.dart b/mycore_api/test/geolocalized_mode_test.dart index 80de9be..eb20b32 100644 --- a/mycore_api/test/geolocalized_mode_test.dart +++ b/mycore_api/test/geolocalized_mode_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GeolocalizedMode void main() { - final instance = GeolocalizedMode(); + // final instance = GeolocalizedMode(); group('test GeolocalizedMode', () { // String latitude @@ -25,12 +26,12 @@ void main() { // TODO }); - // OneOfAlarmMode homeMode + // TimePeriodAlarmAlarmMode homeMode test('to test the property `homeMode`', () async { // TODO }); - // OneOfAlarmMode absentMode + // TimePeriodAlarmAlarmMode absentMode test('to test the property `absentMode`', () async { // TODO }); diff --git a/mycore_api/test/google_api_test.dart b/mycore_api/test/google_api_test.dart index 552b71e..4c6ca11 100644 --- a/mycore_api/test/google_api_test.dart +++ b/mycore_api/test/google_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for GoogleApi void main() { - final instance = GoogleApi(); + // final instance = GoogleApi(); group('tests for GoogleApi', () { //Future googleCreate(GoogleAuthModel googleAuthModel) async diff --git a/mycore_api/test/google_auth_model_test.dart b/mycore_api/test/google_auth_model_test.dart index 3fee505..f9c00ce 100644 --- a/mycore_api/test/google_auth_model_test.dart +++ b/mycore_api/test/google_auth_model_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GoogleAuthModel void main() { - final instance = GoogleAuthModel(); + // final instance = GoogleAuthModel(); group('test GoogleAuthModel', () { // String authorizationCode diff --git a/mycore_api/test/group_api_test.dart b/mycore_api/test/group_api_test.dart index 6e44a50..ffe9006 100644 --- a/mycore_api/test/group_api_test.dart +++ b/mycore_api/test/group_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for GroupApi void main() { - final instance = GroupApi(); + // final instance = GroupApi(); group('tests for GroupApi', () { // Create a group @@ -25,56 +26,56 @@ void main() { // Create groups from provider // - //Future> groupCreateDevicesFromZigbee2Mqtt(String userId) async + //Future> groupCreateDevicesFromZigbee2Mqtt(String homeId) async test('test groupCreateDevicesFromZigbee2Mqtt', () async { // TODO }); // Delete device from a group // - //Future groupDelete(String deviceId, String groupId) async + //Future groupDelete(String deviceId, String groupId) async test('test groupDelete', () async { // TODO }); // Delete a group // - //Future groupDelete2(String groupId) async + //Future groupDelete2(String groupId) async test('test groupDelete2', () async { // TODO }); - // Delete all group for a specified + // Delete all group for a specified home // - //Future groupDeleteAllForUser(String userId) async - test('test groupDeleteAllForUser', () async { + //Future groupDeleteAllForHome(String homeId) async + test('test groupDeleteAllForHome', () async { // TODO }); - // Get all groups for the specified user + // Get all groups for the specified home // - //Future> groupGetAll(String userId) async + //Future> groupGetAll(String homeId) async test('test groupGetAll', () async { // TODO }); // Get detail info of a specified group // - //Future groupGetDetail(String groupId, { String userId }) async + //Future groupGetDetail(String groupId) async test('test groupGetDetail', () async { // TODO }); // Get list of group from a type // - //Future> groupGetGroupsByType(String userId, String type) async + //Future> groupGetGroupsByType(String homeId, String type) async test('test groupGetGroupsByType', () async { // TODO }); // Get all zigbee2Mqtt groups // - //Future> groupGetGroupsFromZigbee2Mqtt(String userId) async + //Future> groupGetGroupsFromZigbee2Mqtt(String homeId) async test('test groupGetGroupsFromZigbee2Mqtt', () async { // TODO }); diff --git a/mycore_api/test/group_create_or_update_detail_dto_all_of_test.dart b/mycore_api/test/group_create_or_update_detail_dto_all_of_test.dart index 3977a0c..d200838 100644 --- a/mycore_api/test/group_create_or_update_detail_dto_all_of_test.dart +++ b/mycore_api/test/group_create_or_update_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GroupCreateOrUpdateDetailDTOAllOf void main() { - final instance = GroupCreateOrUpdateDetailDTOAllOf(); + // final instance = GroupCreateOrUpdateDetailDTOAllOf(); group('test GroupCreateOrUpdateDetailDTOAllOf', () { // List deviceIds (default value: const []) diff --git a/mycore_api/test/group_create_or_update_detail_dto_test.dart b/mycore_api/test/group_create_or_update_detail_dto_test.dart index fbf296f..6391997 100644 --- a/mycore_api/test/group_create_or_update_detail_dto_test.dart +++ b/mycore_api/test/group_create_or_update_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GroupCreateOrUpdateDetailDTO void main() { - final instance = GroupCreateOrUpdateDetailDTO(); + // final instance = GroupCreateOrUpdateDetailDTO(); group('test GroupCreateOrUpdateDetailDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/group_detail_dto_all_of_test.dart b/mycore_api/test/group_detail_dto_all_of_test.dart index 4690916..ec5ebcc 100644 --- a/mycore_api/test/group_detail_dto_all_of_test.dart +++ b/mycore_api/test/group_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GroupDetailDTOAllOf void main() { - final instance = GroupDetailDTOAllOf(); + // final instance = GroupDetailDTOAllOf(); group('test GroupDetailDTOAllOf', () { // DateTime createdDate diff --git a/mycore_api/test/group_detail_dto_test.dart b/mycore_api/test/group_detail_dto_test.dart index 854395b..c1e8bf4 100644 --- a/mycore_api/test/group_detail_dto_test.dart +++ b/mycore_api/test/group_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GroupDetailDTO void main() { - final instance = GroupDetailDTO(); + // final instance = GroupDetailDTO(); group('test GroupDetailDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/group_summary_dto_test.dart b/mycore_api/test/group_summary_dto_test.dart index 56cf15f..8067792 100644 --- a/mycore_api/test/group_summary_dto_test.dart +++ b/mycore_api/test/group_summary_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for GroupSummaryDTO void main() { - final instance = GroupSummaryDTO(); + // final instance = GroupSummaryDTO(); group('test GroupSummaryDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/home_api_test.dart b/mycore_api/test/home_api_test.dart index 134e5ed..3d751ba 100644 --- a/mycore_api/test/home_api_test.dart +++ b/mycore_api/test/home_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for HomeApi void main() { - final instance = HomeApi(); + // final instance = HomeApi(); group('tests for HomeApi', () { // Create a home diff --git a/mycore_api/test/home_detail_dto_all_of_test.dart b/mycore_api/test/home_detail_dto_all_of_test.dart index 018efe6..ef346d4 100644 --- a/mycore_api/test/home_detail_dto_all_of_test.dart +++ b/mycore_api/test/home_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for HomeDetailDTOAllOf void main() { - final instance = HomeDetailDTOAllOf(); + // final instance = HomeDetailDTOAllOf(); group('test HomeDetailDTOAllOf', () { // List users (default value: const []) diff --git a/mycore_api/test/home_detail_dto_test.dart b/mycore_api/test/home_detail_dto_test.dart index d99cd0a..4c72e42 100644 --- a/mycore_api/test/home_detail_dto_test.dart +++ b/mycore_api/test/home_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for HomeDetailDTO void main() { - final instance = HomeDetailDTO(); + // final instance = HomeDetailDTO(); group('test HomeDetailDTO', () { // String id @@ -35,7 +36,7 @@ void main() { // TODO }); - // OneOfAlarmModeDTO currentAlarmMode + // HomeDTOCurrentAlarmMode currentAlarmMode test('to test the property `currentAlarmMode`', () async { // TODO }); diff --git a/mycore_api/test/home_dto_current_alarm_mode_test.dart b/mycore_api/test/home_dto_current_alarm_mode_test.dart new file mode 100644 index 0000000..843e81c --- /dev/null +++ b/mycore_api/test/home_dto_current_alarm_mode_test.dart @@ -0,0 +1,67 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for HomeDTOCurrentAlarmMode +void main() { + // final instance = HomeDTOCurrentAlarmMode(); + + group('test HomeDTOCurrentAlarmMode', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // bool notification + test('to test the property `notification`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/home_dto_test.dart b/mycore_api/test/home_dto_test.dart index 33474fa..975c661 100644 --- a/mycore_api/test/home_dto_test.dart +++ b/mycore_api/test/home_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for HomeDTO void main() { - final instance = HomeDTO(); + // final instance = HomeDTO(); group('test HomeDTO', () { // String id @@ -35,7 +36,7 @@ void main() { // TODO }); - // OneOfAlarmModeDTO currentAlarmMode + // HomeDTOCurrentAlarmMode currentAlarmMode test('to test the property `currentAlarmMode`', () async { // TODO }); diff --git a/mycore_api/test/iot_api_test.dart b/mycore_api/test/iot_api_test.dart index eb6b467..8fca3e7 100644 --- a/mycore_api/test/iot_api_test.dart +++ b/mycore_api/test/iot_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for IOTApi void main() { - final instance = IOTApi(); + // final instance = IOTApi(); group('tests for IOTApi', () { // Retrieve all SmartPrinterMessage diff --git a/mycore_api/test/layout_api_test.dart b/mycore_api/test/layout_api_test.dart index dfe6a96..5ce5d2d 100644 --- a/mycore_api/test/layout_api_test.dart +++ b/mycore_api/test/layout_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for LayoutApi void main() { - final instance = LayoutApi(); + // final instance = LayoutApi(); group('tests for LayoutApi', () { // It's a test ! :) diff --git a/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_request_parameters_test.dart b/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_request_parameters_test.dart new file mode 100644 index 0000000..32b71d0 --- /dev/null +++ b/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_request_parameters_test.dart @@ -0,0 +1,62 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters +void main() { + // final instance = ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters(); + + group('test ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters', () { + // int startIndex + test('to test the property `startIndex`', () async { + // TODO + }); + + // int count + test('to test the property `count`', () async { + // TODO + }); + + // DateTime dateStart + test('to test the property `dateStart`', () async { + // TODO + }); + + // DateTime dateEnd + test('to test the property `dateEnd`', () async { + // TODO + }); + + // EventGetEventTypeParameter eventType + test('to test the property `eventType`', () async { + // TODO + }); + + // EventGetDeviceTypeParameter deviceType + test('to test the property `deviceType`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String roomId + test('to test the property `roomId`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_test.dart b/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_test.dart index e8735b7..1da1c51 100644 --- a/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_test.dart +++ b/mycore_api/test/list_response_of_event_detail_dto_and_event_home_filter_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ListResponseOfEventDetailDTOAndEventHomeFilter void main() { - final instance = ListResponseOfEventDetailDTOAndEventHomeFilter(); + // final instance = ListResponseOfEventDetailDTOAndEventHomeFilter(); group('test ListResponseOfEventDetailDTOAndEventHomeFilter', () { // List values (default value: const []) @@ -20,7 +21,7 @@ void main() { // TODO }); - // OneOfEventHomeFilter requestParameters + // ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters requestParameters test('to test the property `requestParameters`', () async { // TODO }); diff --git a/mycore_api/test/login_dto_test.dart b/mycore_api/test/login_dto_test.dart index 39508e0..a196b1d 100644 --- a/mycore_api/test/login_dto_test.dart +++ b/mycore_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:mycoreapi/api.dart'; +import 'package:mycore_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/mycore_api/test/means_of_communication_test.dart b/mycore_api/test/means_of_communication_test.dart index 87dd1a1..04c0d8b 100644 --- a/mycore_api/test/means_of_communication_test.dart +++ b/mycore_api/test/means_of_communication_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for MeansOfCommunication diff --git a/mycore_api/test/mqtt_api_test.dart b/mycore_api/test/mqtt_api_test.dart index fe8f38b..64512ab 100644 --- a/mycore_api/test/mqtt_api_test.dart +++ b/mycore_api/test/mqtt_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for MQTTApi void main() { - final instance = MQTTApi(); + // final instance = MQTTApi(); group('tests for MQTTApi', () { // Publish mqtt test diff --git a/mycore_api/test/mqtt_message_dto_test.dart b/mycore_api/test/mqtt_message_dto_test.dart index e53dbe5..6804b74 100644 --- a/mycore_api/test/mqtt_message_dto_test.dart +++ b/mycore_api/test/mqtt_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for MqttMessageDTO void main() { - final instance = MqttMessageDTO(); + // final instance = MqttMessageDTO(); group('test MqttMessageDTO', () { // String topic diff --git a/mycore_api/test/odd_api_test.dart b/mycore_api/test/odd_api_test.dart index 8a147f5..0d5356b 100644 --- a/mycore_api/test/odd_api_test.dart +++ b/mycore_api/test/odd_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for OddApi void main() { - final instance = OddApi(); + // final instance = OddApi(); group('tests for OddApi', () { // Get odds for one country and one odd value maximum diff --git a/mycore_api/test/odd_nice_odds_test.dart b/mycore_api/test/odd_nice_odds_test.dart new file mode 100644 index 0000000..187f8d9 --- /dev/null +++ b/mycore_api/test/odd_nice_odds_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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for OddNiceOdds +void main() { + // final instance = OddNiceOdds(); + + group('test OddNiceOdds', () { + // double homeOdd + test('to test the property `homeOdd`', () async { + // TODO + }); + + // double drawOdd + test('to test the property `drawOdd`', () async { + // TODO + }); + + // double visitOdd + test('to test the property `visitOdd`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/odd_nice_test.dart b/mycore_api/test/odd_nice_test.dart index 3cbc6e4..1a29485 100644 --- a/mycore_api/test/odd_nice_test.dart +++ b/mycore_api/test/odd_nice_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for OddNice void main() { - final instance = OddNice(); + // final instance = OddNice(); group('test OddNice', () { // List teams (default value: const []) @@ -30,7 +31,7 @@ void main() { // TODO }); - // OneOfOddH2H odds + // OddNiceOdds odds test('to test the property `odds`', () async { // TODO }); diff --git a/mycore_api/test/odd_object_test.dart b/mycore_api/test/odd_object_test.dart index b0d8599..e26e7b8 100644 --- a/mycore_api/test/odd_object_test.dart +++ b/mycore_api/test/odd_object_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for OddObject void main() { - final instance = OddObject(); + // final instance = OddObject(); group('test OddObject', () { // double homeOdd diff --git a/mycore_api/test/panel_menu_item_test.dart b/mycore_api/test/panel_menu_item_test.dart index c6866c1..057955d 100644 --- a/mycore_api/test/panel_menu_item_test.dart +++ b/mycore_api/test/panel_menu_item_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for PanelMenuItem void main() { - final instance = PanelMenuItem(); + // final instance = PanelMenuItem(); group('test PanelMenuItem', () { // String label diff --git a/mycore_api/test/panel_section_test.dart b/mycore_api/test/panel_section_test.dart index 9070dd6..e90338f 100644 --- a/mycore_api/test/panel_section_test.dart +++ b/mycore_api/test/panel_section_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for PanelSection void main() { - final instance = PanelSection(); + // final instance = PanelSection(); group('test PanelSection', () { // String label diff --git a/mycore_api/test/programmed_mode_test.dart b/mycore_api/test/programmed_mode_test.dart index ba6ed2d..2427102 100644 --- a/mycore_api/test/programmed_mode_test.dart +++ b/mycore_api/test/programmed_mode_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ProgrammedMode void main() { - final instance = ProgrammedMode(); + // final instance = ProgrammedMode(); group('test ProgrammedMode', () { // List monday (default value: const []) diff --git a/mycore_api/test/provider_api_test.dart b/mycore_api/test/provider_api_test.dart index 4d48437..65d19c8 100644 --- a/mycore_api/test/provider_api_test.dart +++ b/mycore_api/test/provider_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for ProviderApi void main() { - final instance = ProviderApi(); + // final instance = ProviderApi(); group('tests for ProviderApi', () { // Create a provider @@ -25,14 +26,14 @@ void main() { // Delete a provider // - //Future providerDelete(String providerId) async + //Future providerDelete(String providerId) async test('test providerDelete', () async { // TODO }); - // Get all user providers + // Get all home providers // - //Future> providerGetAll(String userId) async + //Future> providerGetAll(String homeId) async test('test providerGetAll', () async { // TODO }); diff --git a/mycore_api/test/provider_dto_test.dart b/mycore_api/test/provider_dto_test.dart index e08b953..89561de 100644 --- a/mycore_api/test/provider_dto_test.dart +++ b/mycore_api/test/provider_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ProviderDTO void main() { - final instance = ProviderDTO(); + // final instance = ProviderDTO(); group('test ProviderDTO', () { // String id @@ -25,13 +26,13 @@ void main() { // TODO }); - // String type + // ProviderType type test('to test the property `type`', () async { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/provider_type_test.dart b/mycore_api/test/provider_type_test.dart index ef2c296..0d54b9c 100644 --- a/mycore_api/test/provider_type_test.dart +++ b/mycore_api/test/provider_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ProviderType diff --git a/mycore_api/test/room_api_test.dart b/mycore_api/test/room_api_test.dart index 84ae05c..cd84663 100644 --- a/mycore_api/test/room_api_test.dart +++ b/mycore_api/test/room_api_test.dart @@ -1,21 +1,29 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for RoomApi void main() { - final instance = RoomApi(); + // final instance = RoomApi(); group('tests for RoomApi', () { + // Add devices in the specified room + // + //Future roomAddDeviceToRoom(String roomId, List requestBody) async + test('test roomAddDeviceToRoom', () async { + // TODO + }); + // Create a room // //Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async @@ -23,37 +31,44 @@ void main() { // TODO }); - // Delete device from a room + // Delete a room // - //Future roomDelete(String deviceId, String roomId) async + //Future roomDelete(String roomId) async test('test roomDelete', () async { // TODO }); - // Delete a room + // Delete device from a room // - //Future roomDelete2(String roomId) async + //Future roomDelete2(String deviceId, String roomId) async test('test roomDelete2', () async { // TODO }); - // Delete all room for a specified + // Delete all rooms for a specified home // - //Future roomDeleteAllForUser(String userId) async - test('test roomDeleteAllForUser', () async { + //Future roomDeleteAllForHome(String homeId) async + test('test roomDeleteAllForHome', () async { // TODO }); - // Get all rooms for the specified user + // Get all rooms for the specified home // - //Future> roomGetAll(String userId) async + //Future> roomGetAll(String homeId) async test('test roomGetAll', () async { // TODO }); + // Get all rooms main details for the specified home + // + //Future> roomGetAllWithMainDetails(String homeId) async + test('test roomGetAllWithMainDetails', () async { + // TODO + }); + // Get detail info of a specified room // - //Future roomGetDetail(String roomId, { String userId }) async + //Future roomGetDetail(String roomId) async test('test roomGetDetail', () async { // TODO }); diff --git a/mycore_api/test/room_create_or_update_detail_dto_test.dart b/mycore_api/test/room_create_or_update_detail_dto_test.dart index 3956473..ab8660f 100644 --- a/mycore_api/test/room_create_or_update_detail_dto_test.dart +++ b/mycore_api/test/room_create_or_update_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for RoomCreateOrUpdateDetailDTO void main() { - final instance = RoomCreateOrUpdateDetailDTO(); + // final instance = RoomCreateOrUpdateDetailDTO(); group('test RoomCreateOrUpdateDetailDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/room_detail_dto_test.dart b/mycore_api/test/room_detail_dto_test.dart index 2dd6b4a..6294073 100644 --- a/mycore_api/test/room_detail_dto_test.dart +++ b/mycore_api/test/room_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for RoomDetailDTO void main() { - final instance = RoomDetailDTO(); + // final instance = RoomDetailDTO(); group('test RoomDetailDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/room_main_detail_dto_all_of_test.dart b/mycore_api/test/room_main_detail_dto_all_of_test.dart index ba2bc74..87c48f7 100644 --- a/mycore_api/test/room_main_detail_dto_all_of_test.dart +++ b/mycore_api/test/room_main_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for RoomMainDetailDTOAllOf void main() { - final instance = RoomMainDetailDTOAllOf(); + // final instance = RoomMainDetailDTOAllOf(); group('test RoomMainDetailDTOAllOf', () { // DateTime createdDate @@ -25,6 +26,46 @@ void main() { // TODO }); + // bool isTemperature + test('to test the property `isTemperature`', () async { + // TODO + }); + + // String temperature + test('to test the property `temperature`', () async { + // TODO + }); + + // bool isHumidity + test('to test the property `isHumidity`', () async { + // TODO + }); + + // String humidity + test('to test the property `humidity`', () async { + // TODO + }); + + // bool isMotion + test('to test the property `isMotion`', () async { + // TODO + }); + + // bool motion + test('to test the property `motion`', () async { + // TODO + }); + + // bool isDoor + test('to test the property `isDoor`', () async { + // TODO + }); + + // bool door + test('to test the property `door`', () async { + // TODO + }); + // List environmentalDevices (default value: const []) test('to test the property `environmentalDevices`', () async { // TODO diff --git a/mycore_api/test/room_main_detail_dto_test.dart b/mycore_api/test/room_main_detail_dto_test.dart index 18cb4e6..9e1bcbb 100644 --- a/mycore_api/test/room_main_detail_dto_test.dart +++ b/mycore_api/test/room_main_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for RoomMainDetailDTO void main() { - final instance = RoomMainDetailDTO(); + // final instance = RoomMainDetailDTO(); group('test RoomMainDetailDTO', () { // String id @@ -40,6 +41,46 @@ void main() { // TODO }); + // bool isTemperature + test('to test the property `isTemperature`', () async { + // TODO + }); + + // String temperature + test('to test the property `temperature`', () async { + // TODO + }); + + // bool isHumidity + test('to test the property `isHumidity`', () async { + // TODO + }); + + // String humidity + test('to test the property `humidity`', () async { + // TODO + }); + + // bool isMotion + test('to test the property `isMotion`', () async { + // TODO + }); + + // bool motion + test('to test the property `motion`', () async { + // TODO + }); + + // bool isDoor + test('to test the property `isDoor`', () async { + // TODO + }); + + // bool door + test('to test the property `door`', () async { + // TODO + }); + // List environmentalDevices (default value: const []) test('to test the property `environmentalDevices`', () async { // TODO diff --git a/mycore_api/test/room_summary_dto_test.dart b/mycore_api/test/room_summary_dto_test.dart index 5f0819d..70d430f 100644 --- a/mycore_api/test/room_summary_dto_test.dart +++ b/mycore_api/test/room_summary_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for RoomSummaryDTO void main() { - final instance = RoomSummaryDTO(); + // final instance = RoomSummaryDTO(); group('test RoomSummaryDTO', () { // String id @@ -20,8 +21,8 @@ void main() { // TODO }); - // String userId - test('to test the property `userId`', () async { + // String homeId + test('to test the property `homeId`', () async { // TODO }); diff --git a/mycore_api/test/screen_device_api_test.dart b/mycore_api/test/screen_device_api_test.dart index bed3157..5285fe2 100644 --- a/mycore_api/test/screen_device_api_test.dart +++ b/mycore_api/test/screen_device_api_test.dart @@ -1,42 +1,53 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for ScreenDeviceApi void main() { - final instance = ScreenDeviceApi(); + // final instance = ScreenDeviceApi(); group('tests for ScreenDeviceApi', () { - //Future screenDeviceCreateDevice(ScreenDevice screenDevice) async + // Create screen device + // + //Future screenDeviceCreateDevice(ScreenDevice screenDevice) async test('test screenDeviceCreateDevice', () async { // TODO }); - //Future screenDeviceDeleteDevice(String deviceId) async + // Delete device + // + //Future screenDeviceDeleteDevice(String deviceId) async test('test screenDeviceDeleteDevice', () async { // TODO }); + // Get all screen devices + // //Future> screenDeviceGetAllScreenDevices() async test('test screenDeviceGetAllScreenDevices', () async { // TODO }); + // Get screen device info + // //Future screenDeviceGetDeviceInfo(String screenDeviceId) async test('test screenDeviceGetDeviceInfo', () async { // TODO }); - //Future screenDeviceUpdateDevice(int screenDeviceId, ScreenDevice screenDevice) async + // Update screen device + // + //Future screenDeviceUpdateDevice(ScreenDevice screenDevice) async test('test screenDeviceUpdateDevice', () async { // TODO }); diff --git a/mycore_api/test/screen_device_test.dart b/mycore_api/test/screen_device_test.dart index 68cc588..9e93101 100644 --- a/mycore_api/test/screen_device_test.dart +++ b/mycore_api/test/screen_device_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ScreenDevice void main() { - final instance = ScreenDevice(); + // final instance = ScreenDevice(); group('test ScreenDevice', () { // String id diff --git a/mycore_api/test/smart_garden_message_test.dart b/mycore_api/test/smart_garden_message_test.dart index 6a4e8ae..52dad4e 100644 --- a/mycore_api/test/smart_garden_message_test.dart +++ b/mycore_api/test/smart_garden_message_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for SmartGardenMessage void main() { - final instance = SmartGardenMessage(); + // final instance = SmartGardenMessage(); group('test SmartGardenMessage', () { // String id diff --git a/mycore_api/test/smart_printer_message_test.dart b/mycore_api/test/smart_printer_message_test.dart index 808e06d..8cb9324 100644 --- a/mycore_api/test/smart_printer_message_test.dart +++ b/mycore_api/test/smart_printer_message_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for SmartPrinterMessage void main() { - final instance = SmartPrinterMessage(); + // final instance = SmartPrinterMessage(); group('test SmartPrinterMessage', () { // String id diff --git a/mycore_api/test/time_period_alarm_alarm_mode_test.dart b/mycore_api/test/time_period_alarm_alarm_mode_test.dart new file mode 100644 index 0000000..ccfe0f9 --- /dev/null +++ b/mycore_api/test/time_period_alarm_alarm_mode_test.dart @@ -0,0 +1,92 @@ +// +// 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:mycore_api/api.dart'; +import 'package:test/test.dart'; + +// tests for TimePeriodAlarmAlarmMode +void main() { + // final instance = TimePeriodAlarmAlarmMode(); + + group('test TimePeriodAlarmAlarmMode', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // bool notification + test('to test the property `notification`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + // AlarmModeProgrammedMode programmedMode + test('to test the property `programmedMode`', () async { + // TODO + }); + + // AlarmModeGeolocalizedMode geolocalizedMode + test('to test the property `geolocalizedMode`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/time_period_alarm_test.dart b/mycore_api/test/time_period_alarm_test.dart index 624d417..97b98bc 100644 --- a/mycore_api/test/time_period_alarm_test.dart +++ b/mycore_api/test/time_period_alarm_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for TimePeriodAlarm void main() { - final instance = TimePeriodAlarm(); + // final instance = TimePeriodAlarm(); group('test TimePeriodAlarm', () { // String start @@ -25,7 +26,7 @@ void main() { // TODO }); - // OneOfAlarmMode alarmMode + // TimePeriodAlarmAlarmMode alarmMode test('to test the property `alarmMode`', () async { // TODO }); diff --git a/mycore_api/test/token_api_test.dart b/mycore_api/test/token_api_test.dart index 5c9b601..20838e0 100644 --- a/mycore_api/test/token_api_test.dart +++ b/mycore_api/test/token_api_test.dart @@ -1,21 +1,24 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for TokenApi void main() { - final instance = TokenApi(); + // final instance = TokenApi(); group('tests for TokenApi', () { + // Connect user + // //Future tokenConnectUser(LoginDTO loginDTO) async test('test tokenConnectUser', () async { // TODO diff --git a/mycore_api/test/token_dto_test.dart b/mycore_api/test/token_dto_test.dart index fcc9ced..85d5799 100644 --- a/mycore_api/test/token_dto_test.dart +++ b/mycore_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for TokenDTO void main() { - final instance = TokenDTO(); + // final instance = TokenDTO(); group('test TokenDTO', () { // String accessToken diff --git a/mycore_api/test/trigger_test.dart b/mycore_api/test/trigger_test.dart index 419d2bc..d7f083d 100644 --- a/mycore_api/test/trigger_test.dart +++ b/mycore_api/test/trigger_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for Trigger void main() { - final instance = Trigger(); + // final instance = Trigger(); group('test Trigger', () { // String providerId diff --git a/mycore_api/test/trigger_type_test.dart b/mycore_api/test/trigger_type_test.dart index 78cfc13..f710412 100644 --- a/mycore_api/test/trigger_type_test.dart +++ b/mycore_api/test/trigger_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for TriggerType diff --git a/mycore_api/test/twitter_api_test.dart b/mycore_api/test/twitter_api_test.dart index 84709f7..2718a77 100644 --- a/mycore_api/test/twitter_api_test.dart +++ b/mycore_api/test/twitter_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for TwitterApi void main() { - final instance = TwitterApi(); + // final instance = TwitterApi(); group('tests for TwitterApi', () { //Future twitterCreate(TwitterAuthModel twitterAuthModel) async diff --git a/mycore_api/test/twitter_auth_model_test.dart b/mycore_api/test/twitter_auth_model_test.dart index 71e0971..261c9b4 100644 --- a/mycore_api/test/twitter_auth_model_test.dart +++ b/mycore_api/test/twitter_auth_model_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for TwitterAuthModel void main() { - final instance = TwitterAuthModel(); + // final instance = TwitterAuthModel(); group('test TwitterAuthModel', () { // String apiKey diff --git a/mycore_api/test/user_api_test.dart b/mycore_api/test/user_api_test.dart index cc8f2f4..0eacb01 100644 --- a/mycore_api/test/user_api_test.dart +++ b/mycore_api/test/user_api_test.dart @@ -1,45 +1,59 @@ // // 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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for UserApi void main() { - final instance = UserApi(); + // final instance = UserApi(); group('tests for UserApi', () { + // Create an user + // //Future userCreateUser(UserInfo userInfo) async test('test userCreateUser', () async { // TODO }); - //Future userDeleteUser(String id) async - test('test userDeleteUser', () async { - // TODO - }); - - // Get a list of user + // Delete an user // - //Future userGet() async - test('test userGet', () async { + //Future userDeleteUser(String id) async + test('test userDeleteUser', () async { // TODO }); // Get a specific user // - //Future userGet2(String id) async - test('test userGet2', () async { + //Future userGet(String id) async + test('test userGet', () async { // TODO }); + // Get a list of user + // + //Future> userGetAll() async + test('test userGetAll', () async { + // TODO + }); + + // Get a specific user by email + // + //Future userGetByEmail(String email) async + test('test userGetByEmail', () async { + // TODO + }); + + // Update an user + // //Future userUpdateUser(UserInfo userInfo) async test('test userUpdateUser', () async { // TODO diff --git a/mycore_api/test/user_info_detail_dto_test.dart b/mycore_api/test/user_info_detail_dto_test.dart index bea7c7e..5f4c6e3 100644 --- a/mycore_api/test/user_info_detail_dto_test.dart +++ b/mycore_api/test/user_info_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for UserInfoDetailDTO void main() { - final instance = UserInfoDetailDTO(); + // final instance = UserInfoDetailDTO(); group('test UserInfoDetailDTO', () { // String id @@ -35,6 +36,16 @@ void main() { // TODO }); + // String language + test('to test the property `language`', () async { + // TODO + }); + + // List homeIds (default value: const []) + test('to test the property `homeIds`', () async { + // TODO + }); + }); diff --git a/mycore_api/test/user_info_test.dart b/mycore_api/test/user_info_test.dart index 7554b95..5a1799b 100644 --- a/mycore_api/test/user_info_test.dart +++ b/mycore_api/test/user_info_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for UserInfo void main() { - final instance = UserInfo(); + // final instance = UserInfo(); group('test UserInfo', () { // String id @@ -55,6 +56,11 @@ void main() { // TODO }); + // List homeIds (default value: const []) + test('to test the property `homeIds`', () async { + // TODO + }); + // DateTime dateCreation test('to test the property `dateCreation`', () async { // TODO @@ -95,36 +101,6 @@ void main() { // TODO }); - // List automations (default value: const []) - test('to test the property `automations`', () async { - // TODO - }); - - // List devices (default value: const []) - test('to test the property `devices`', () async { - // TODO - }); - - // List providers (default value: const []) - test('to test the property `providers`', () async { - // TODO - }); - - // List groups (default value: const []) - test('to test the property `groups`', () async { - // TODO - }); - - // List screenConfigurationIds (default value: const []) - test('to test the property `screenConfigurationIds`', () async { - // TODO - }); - - // List deviceIds (default value: const []) - test('to test the property `deviceIds`', () async { - // TODO - }); - }); diff --git a/mycore_api/test/user_test.dart b/mycore_api/test/user_test.dart index d66f7b6..0d81873 100644 --- a/mycore_api/test/user_test.dart +++ b/mycore_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for User void main() { - final instance = User(); + // final instance = User(); group('test User', () { // String id diff --git a/mycore_api/test/values_api_test.dart b/mycore_api/test/values_api_test.dart index 30725b1..ba76990 100644 --- a/mycore_api/test/values_api_test.dart +++ b/mycore_api/test/values_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; /// tests for ValuesApi void main() { - final instance = ValuesApi(); + // final instance = ValuesApi(); group('tests for ValuesApi', () { //Future valuesDelete(int id) async diff --git a/mycore_api/test/view_by_test.dart b/mycore_api/test/view_by_test.dart index 6be97a1..1f4a831 100644 --- a/mycore_api/test/view_by_test.dart +++ b/mycore_api/test/view_by_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:mycoreapi/api.dart'; +import 'package:mycore_api/api.dart'; import 'package:test/test.dart'; // tests for ViewBy diff --git a/mycore_api_old/.gitignore b/mycore_api_old/.gitignore new file mode 100644 index 0000000..7c28044 --- /dev/null +++ b/mycore_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/mycore_api_old/.openapi-generator-ignore b/mycore_api_old/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/mycore_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/mycore_api_old/.openapi-generator/FILES b/mycore_api_old/.openapi-generator/FILES new file mode 100644 index 0000000..c409ccc --- /dev/null +++ b/mycore_api_old/.openapi-generator/FILES @@ -0,0 +1,210 @@ +.gitignore +.travis.yml +README.md +doc/Action.md +doc/ActionType.md +doc/AlarmApi.md +doc/AlarmMode.md +doc/AlarmModeCreateOrUpdateDetailDTO.md +doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md +doc/AlarmModeDTO.md +doc/AlarmModeDetailDTO.md +doc/AlarmModeDetailDTOAllOf.md +doc/AlarmTriggered.md +doc/AlarmType.md +doc/AuthenticationApi.md +doc/AutomationApi.md +doc/AutomationDTO.md +doc/AutomationDetailDTO.md +doc/AutomationDetailDTOAllOf.md +doc/AutomationState.md +doc/AutomationTriggered.md +doc/AzureADAuthModel.md +doc/AzureApi.md +doc/Book.md +doc/BooksApi.md +doc/Condition.md +doc/ConditionType.md +doc/ConditionValue.md +doc/ConnectionStatus.md +doc/CreateOrUpdateHomeDTO.md +doc/CreateOrUpdateHomeDTOAllOf.md +doc/DeviceApi.md +doc/DeviceDetailDTO.md +doc/DeviceDetailDTOAllOf.md +doc/DeviceState.md +doc/DeviceSummaryDTO.md +doc/DeviceType.md +doc/ElectricityProduction.md +doc/EnergyApi.md +doc/EventApi.md +doc/EventDTO.md +doc/EventDetailDTO.md +doc/EventDetailDTOAllOf.md +doc/EventFilter.md +doc/EventHomeFilter.md +doc/EventHomeFilterAllOf.md +doc/EventType.md +doc/FacebookApi.md +doc/FacebookAuthModel.md +doc/GeolocalizedMode.md +doc/GoogleApi.md +doc/GoogleAuthModel.md +doc/GroupApi.md +doc/GroupCreateOrUpdateDetailDTO.md +doc/GroupCreateOrUpdateDetailDTOAllOf.md +doc/GroupDetailDTO.md +doc/GroupDetailDTOAllOf.md +doc/GroupSummaryDTO.md +doc/HomeApi.md +doc/HomeDTO.md +doc/HomeDetailDTO.md +doc/HomeDetailDTOAllOf.md +doc/IOTApi.md +doc/LayoutApi.md +doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md +doc/LoginDTO.md +doc/MQTTApi.md +doc/MeansOfCommunication.md +doc/MqttMessageDTO.md +doc/OddApi.md +doc/OddNice.md +doc/OddObject.md +doc/PanelMenuItem.md +doc/PanelSection.md +doc/ProgrammedMode.md +doc/ProviderApi.md +doc/ProviderDTO.md +doc/ProviderType.md +doc/RoomApi.md +doc/RoomCreateOrUpdateDetailDTO.md +doc/RoomDetailDTO.md +doc/RoomMainDetailDTO.md +doc/RoomMainDetailDTOAllOf.md +doc/RoomSummaryDTO.md +doc/ScreenDevice.md +doc/ScreenDeviceApi.md +doc/SmartGardenMessage.md +doc/SmartPrinterMessage.md +doc/TimePeriodAlarm.md +doc/TokenApi.md +doc/TokenDTO.md +doc/Trigger.md +doc/TriggerType.md +doc/TwitterApi.md +doc/TwitterAuthModel.md +doc/User.md +doc/UserApi.md +doc/UserInfo.md +doc/UserInfoDetailDTO.md +doc/ValuesApi.md +doc/ViewBy.md +git_push.sh +lib/api.dart +lib/api/alarm_api.dart +lib/api/authentication_api.dart +lib/api/automation_api.dart +lib/api/azure_api.dart +lib/api/books_api.dart +lib/api/device_api.dart +lib/api/energy_api.dart +lib/api/event_api.dart +lib/api/facebook_api.dart +lib/api/google_api.dart +lib/api/group_api.dart +lib/api/home_api.dart +lib/api/iot_api.dart +lib/api/layout_api.dart +lib/api/mqtt_api.dart +lib/api/odd_api.dart +lib/api/provider_api.dart +lib/api/room_api.dart +lib/api/screen_device_api.dart +lib/api/token_api.dart +lib/api/twitter_api.dart +lib/api/user_api.dart +lib/api/values_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/action.dart +lib/model/action_type.dart +lib/model/alarm_mode.dart +lib/model/alarm_mode_create_or_update_detail_dto.dart +lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart +lib/model/alarm_mode_detail_dto.dart +lib/model/alarm_mode_detail_dto_all_of.dart +lib/model/alarm_mode_dto.dart +lib/model/alarm_triggered.dart +lib/model/alarm_type.dart +lib/model/automation_detail_dto.dart +lib/model/automation_detail_dto_all_of.dart +lib/model/automation_dto.dart +lib/model/automation_state.dart +lib/model/automation_triggered.dart +lib/model/azure_ad_auth_model.dart +lib/model/book.dart +lib/model/condition.dart +lib/model/condition_type.dart +lib/model/condition_value.dart +lib/model/connection_status.dart +lib/model/create_or_update_home_dto.dart +lib/model/create_or_update_home_dto_all_of.dart +lib/model/device_detail_dto.dart +lib/model/device_detail_dto_all_of.dart +lib/model/device_state.dart +lib/model/device_summary_dto.dart +lib/model/device_type.dart +lib/model/electricity_production.dart +lib/model/event_detail_dto.dart +lib/model/event_detail_dto_all_of.dart +lib/model/event_dto.dart +lib/model/event_filter.dart +lib/model/event_home_filter.dart +lib/model/event_home_filter_all_of.dart +lib/model/event_type.dart +lib/model/facebook_auth_model.dart +lib/model/geolocalized_mode.dart +lib/model/google_auth_model.dart +lib/model/group_create_or_update_detail_dto.dart +lib/model/group_create_or_update_detail_dto_all_of.dart +lib/model/group_detail_dto.dart +lib/model/group_detail_dto_all_of.dart +lib/model/group_summary_dto.dart +lib/model/home_detail_dto.dart +lib/model/home_detail_dto_all_of.dart +lib/model/home_dto.dart +lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart +lib/model/login_dto.dart +lib/model/means_of_communication.dart +lib/model/mqtt_message_dto.dart +lib/model/odd_nice.dart +lib/model/odd_object.dart +lib/model/panel_menu_item.dart +lib/model/panel_section.dart +lib/model/programmed_mode.dart +lib/model/provider_dto.dart +lib/model/provider_type.dart +lib/model/room_create_or_update_detail_dto.dart +lib/model/room_detail_dto.dart +lib/model/room_main_detail_dto.dart +lib/model/room_main_detail_dto_all_of.dart +lib/model/room_summary_dto.dart +lib/model/screen_device.dart +lib/model/smart_garden_message.dart +lib/model/smart_printer_message.dart +lib/model/time_period_alarm.dart +lib/model/token_dto.dart +lib/model/trigger.dart +lib/model/trigger_type.dart +lib/model/twitter_auth_model.dart +lib/model/user.dart +lib/model/user_info.dart +lib/model/user_info_detail_dto.dart +lib/model/view_by.dart +pubspec.yaml diff --git a/mycore_api_old/.openapi-generator/VERSION b/mycore_api_old/.openapi-generator/VERSION new file mode 100644 index 0000000..acf69b4 --- /dev/null +++ b/mycore_api_old/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/mycore_api_old/.travis.yml b/mycore_api_old/.travis.yml new file mode 100644 index 0000000..1a3af66 --- /dev/null +++ b/mycore_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/mycore_api_old/README.md b/mycore_api_old/README.md new file mode 100644 index 0000000..6aff251 --- /dev/null +++ b/mycore_api_old/README.md @@ -0,0 +1,255 @@ +# mycoreapi +API description + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: Version Pre-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: + mycoreapi: + 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: + mycoreapi: + path: /path/to/mycoreapi +``` + +## Tests + +TODO + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:mycoreapi/api.dart'; + +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final alarmModeId = alarmModeId_example; // String | Alarm mode to activate + +try { + final result = api_instance.alarmActivate(alarmModeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmActivate: $e\n'); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:5000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AlarmApi* | [**alarmActivate**](doc\/AlarmApi.md#alarmactivate) | **POST** /api/alarm/activate/{alarmModeId} | Activate specified alarm mode +*AlarmApi* | [**alarmCreate**](doc\/AlarmApi.md#alarmcreate) | **POST** /api/alarm | Create an alarm mode +*AlarmApi* | [**alarmCreateDefaultAlarms**](doc\/AlarmApi.md#alarmcreatedefaultalarms) | **POST** /api/alarm/defaults/{homeId} | Create default alarm modes +*AlarmApi* | [**alarmDelete**](doc\/AlarmApi.md#alarmdelete) | **DELETE** /api/alarm/{alarmModeId} | Delete an alarm mode +*AlarmApi* | [**alarmDeleteAllForHome**](doc\/AlarmApi.md#alarmdeleteallforhome) | **DELETE** /api/alarm/home/{homeId} | Delete all alarm mode for a specified home +*AlarmApi* | [**alarmGetAll**](doc\/AlarmApi.md#alarmgetall) | **GET** /api/alarm/{homeId} | Get all alarm modes for the specified home +*AlarmApi* | [**alarmGetDetail**](doc\/AlarmApi.md#alarmgetdetail) | **GET** /api/alarm/detail/{alarmModeId} | Get detail info of a specified alarm mode +*AlarmApi* | [**alarmUpdate**](doc\/AlarmApi.md#alarmupdate) | **PUT** /api/alarm | Update an alarm mode +*AuthenticationApi* | [**authenticationAuthenticateWithForm**](doc\/AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | Authenticate with form parameters (used by Swagger test client) +*AuthenticationApi* | [**authenticationAuthenticateWithJson**](doc\/AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | Authenticate with Json parameters (used by most clients) +*AutomationApi* | [**automationCreate**](doc\/AutomationApi.md#automationcreate) | **POST** /api/automation | Create an automation +*AutomationApi* | [**automationDelete**](doc\/AutomationApi.md#automationdelete) | **DELETE** /api/automation/{automationId} | Delete an automation +*AutomationApi* | [**automationDeleteAllForHome**](doc\/AutomationApi.md#automationdeleteallforhome) | **DELETE** /api/automation/home/{homeId} | Delete all automation for a specified home +*AutomationApi* | [**automationGetAll**](doc\/AutomationApi.md#automationgetall) | **GET** /api/automation/{homeId} | Get all automations for the specified home +*AutomationApi* | [**automationGetDetail**](doc\/AutomationApi.md#automationgetdetail) | **GET** /api/automation/detail/{automationId} | Get detail info of a specified automation +*AutomationApi* | [**automationUpdate**](doc\/AutomationApi.md#automationupdate) | **PUT** /api/automation | Update an automation +*AzureApi* | [**azureCreate**](doc\/AzureApi.md#azurecreate) | **POST** /azure | +*BooksApi* | [**booksCreate**](doc\/BooksApi.md#bookscreate) | **POST** /api/books | +*BooksApi* | [**booksDelete**](doc\/BooksApi.md#booksdelete) | **DELETE** /api/books/{id} | +*BooksApi* | [**booksGet**](doc\/BooksApi.md#booksget) | **GET** /api/books/{id} | +*BooksApi* | [**booksGetAll**](doc\/BooksApi.md#booksgetall) | **GET** /api/books | +*BooksApi* | [**booksUpdate**](doc\/BooksApi.md#booksupdate) | **PUT** /api/books/{id} | +*DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/device | Create a device +*DeviceApi* | [**deviceCreateDevicesFromProvider**](doc\/DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{homeId}/fromProvider/{providerId} | Create devices from provider +*DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device +*DeviceApi* | [**deviceDeleteAllForHome**](doc\/DeviceApi.md#devicedeleteallforhome) | **DELETE** /api/device/home/{homeId} | Delete all device for a specified home +*DeviceApi* | [**deviceDeleteDevicesFromProvider**](doc\/DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{homeId}/fromProvider/{providerId} | Delete devices from provider +*DeviceApi* | [**deviceGetAll**](doc\/DeviceApi.md#devicegetall) | **GET** /api/device/{homeId} | Get all devices summary +*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info +*DeviceApi* | [**deviceGetDevicesByType**](doc\/DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{homeId}/type/{type} | Get list of devices from a type +*DeviceApi* | [**deviceGetDevicesFromProvider**](doc\/DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{homeId}/fromProvider/{providerId} | Get devices from provider +*DeviceApi* | [**deviceGetDevicesFromZigbee2Mqtt**](doc\/DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt devices +*DeviceApi* | [**deviceSendAction**](doc\/DeviceApi.md#devicesendaction) | **POST** /api/device/action | Send action to device +*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device +*EnergyApi* | [**energyGetElectricityProduction**](doc\/EnergyApi.md#energygetelectricityproduction) | **GET** /api/energy/electricity | Get summary production of Kwh/Year +*EventApi* | [**eventDelete**](doc\/EventApi.md#eventdelete) | **DELETE** /api/event/{eventId} | Delete an event +*EventApi* | [**eventDeleteAllForHome**](doc\/EventApi.md#eventdeleteallforhome) | **DELETE** /api/event/home/{homeId} | Delete all events for a specified home +*EventApi* | [**eventGet**](doc\/EventApi.md#eventget) | **GET** /api/event/{homeId} | Get events for the specified home +*EventApi* | [**eventGetDetail**](doc\/EventApi.md#eventgetdetail) | **GET** /api/event/detail/{eventId} | Get detail info of a specified event +*FacebookApi* | [**facebookCreate**](doc\/FacebookApi.md#facebookcreate) | **POST** /facebook | +*GoogleApi* | [**googleCreate**](doc\/GoogleApi.md#googlecreate) | **POST** /google | +*GroupApi* | [**groupCreate**](doc\/GroupApi.md#groupcreate) | **POST** /api/group | Create a group +*GroupApi* | [**groupCreateDevicesFromZigbee2Mqtt**](doc\/GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{homeId}/fromZigbee | Create groups from provider +*GroupApi* | [**groupDelete**](doc\/GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group +*GroupApi* | [**groupDelete2**](doc\/GroupApi.md#groupdelete2) | **DELETE** /api/group/{groupId} | Delete a group +*GroupApi* | [**groupDeleteAllForHome**](doc\/GroupApi.md#groupdeleteallforhome) | **DELETE** /api/group/home/{homeId} | Delete all group for a specified home +*GroupApi* | [**groupGetAll**](doc\/GroupApi.md#groupgetall) | **GET** /api/group/{homeId} | Get all groups for the specified home +*GroupApi* | [**groupGetDetail**](doc\/GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group +*GroupApi* | [**groupGetGroupsByType**](doc\/GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{homeId}/type/{type} | Get list of group from a type +*GroupApi* | [**groupGetGroupsFromZigbee2Mqtt**](doc\/GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt groups +*GroupApi* | [**groupUpdate**](doc\/GroupApi.md#groupupdate) | **PUT** /api/group | Update a group +*HomeApi* | [**homeCreate**](doc\/HomeApi.md#homecreate) | **POST** /api/home | Create a home +*HomeApi* | [**homeDelete**](doc\/HomeApi.md#homedelete) | **DELETE** /api/home/{homeId} | Delete a home +*HomeApi* | [**homeGetAll**](doc\/HomeApi.md#homegetall) | **GET** /api/home/{userId} | Get all home for specified user +*HomeApi* | [**homeGetDetail**](doc\/HomeApi.md#homegetdetail) | **GET** /api/home/detail/{homeId} | Get detail info of a specified home +*HomeApi* | [**homeUpdate**](doc\/HomeApi.md#homeupdate) | **PUT** /api/home | Update a home +*IOTApi* | [**iOTGetSmartPrinterMessages**](doc\/IOTApi.md#iotgetsmartprintermessages) | **GET** /api/iot/smartprinter/{idDevice} | Retrieve all SmartPrinterMessage +*IOTApi* | [**iOTPostToDBPrinter**](doc\/IOTApi.md#iotposttodbprinter) | **POST** /api/iot/smartprinter/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) +*IOTApi* | [**iOTPostToDBSmartGarden**](doc\/IOTApi.md#iotposttodbsmartgarden) | **POST** /api/iot/smartgarden/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) +*LayoutApi* | [**layoutGet**](doc\/LayoutApi.md#layoutget) | **GET** /api/layout/panelSection | It's a test ! :) +*MQTTApi* | [**mQTTPublishMessage**](doc\/MQTTApi.md#mqttpublishmessage) | **POST** /api/mqtt | Publish mqtt test +*OddApi* | [**oddGetAll**](doc\/OddApi.md#oddgetall) | **GET** /api/odd/{oddRequest} | Get odds for one country and one odd value maximum +*OddApi* | [**oddGetForCountry**](doc\/OddApi.md#oddgetforcountry) | **GET** /api/odd/country/{id}/{oddRequest} | Get odds for one country and one odd value maximum +*ProviderApi* | [**providerCreate**](doc\/ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider +*ProviderApi* | [**providerDelete**](doc\/ProviderApi.md#providerdelete) | **DELETE** /api/provider/{providerId} | Delete a provider +*ProviderApi* | [**providerGetAll**](doc\/ProviderApi.md#providergetall) | **GET** /api/provider/{homeId} | Get all home providers +*ProviderApi* | [**providerUpdate**](doc\/ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider +*RoomApi* | [**roomAddDeviceToRoom**](doc\/RoomApi.md#roomadddevicetoroom) | **PUT** /api/room/{roomId} | Add devices in the specified room +*RoomApi* | [**roomCreate**](doc\/RoomApi.md#roomcreate) | **POST** /api/room | Create a room +*RoomApi* | [**roomDelete**](doc\/RoomApi.md#roomdelete) | **DELETE** /api/room/{roomId} | Delete a room +*RoomApi* | [**roomDelete2**](doc\/RoomApi.md#roomdelete2) | **DELETE** /api/room/{roomId}/device/{deviceId} | Delete device from a room +*RoomApi* | [**roomDeleteAllForHome**](doc\/RoomApi.md#roomdeleteallforhome) | **DELETE** /api/room/home/{homeId} | Delete all rooms for a specified home +*RoomApi* | [**roomGetAll**](doc\/RoomApi.md#roomgetall) | **GET** /api/room/{homeId} | Get all rooms for the specified home +*RoomApi* | [**roomGetAllWithMainDetails**](doc\/RoomApi.md#roomgetallwithmaindetails) | **GET** /api/room/{homeId}/details | Get all rooms main details for the specified home +*RoomApi* | [**roomGetDetail**](doc\/RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room +*RoomApi* | [**roomUpdate**](doc\/RoomApi.md#roomupdate) | **PUT** /api/room | Update a room +*ScreenDeviceApi* | [**screenDeviceCreateDevice**](doc\/ScreenDeviceApi.md#screendevicecreatedevice) | **POST** /api/device/screen | Create screen device +*ScreenDeviceApi* | [**screenDeviceDeleteDevice**](doc\/ScreenDeviceApi.md#screendevicedeletedevice) | **DELETE** /api/device/screen/{deviceId} | Delete device +*ScreenDeviceApi* | [**screenDeviceGetAllScreenDevices**](doc\/ScreenDeviceApi.md#screendevicegetallscreendevices) | **GET** /api/device/screen | Get all screen devices +*ScreenDeviceApi* | [**screenDeviceGetDeviceInfo**](doc\/ScreenDeviceApi.md#screendevicegetdeviceinfo) | **GET** /api/device/screen/{screenDeviceId} | Get screen device info +*ScreenDeviceApi* | [**screenDeviceUpdateDevice**](doc\/ScreenDeviceApi.md#screendeviceupdatedevice) | **PUT** /api/device/screen | Update screen device +*TokenApi* | [**tokenConnectUser**](doc\/TokenApi.md#tokenconnectuser) | **POST** /api/token | Connect user +*TokenApi* | [**tokenCreate**](doc\/TokenApi.md#tokencreate) | **POST** /token | +*TwitterApi* | [**twitterCreate**](doc\/TwitterApi.md#twittercreate) | **POST** /twitter | +*UserApi* | [**userCreateUser**](doc\/UserApi.md#usercreateuser) | **POST** /api/user | Create an user +*UserApi* | [**userDeleteUser**](doc\/UserApi.md#userdeleteuser) | **DELETE** /api/user/{id} | Delete an user +*UserApi* | [**userGet**](doc\/UserApi.md#userget) | **GET** /api/user/{id} | Get a specific user +*UserApi* | [**userGetAll**](doc\/UserApi.md#usergetall) | **GET** /api/user | Get a list of user +*UserApi* | [**userGetByEmail**](doc\/UserApi.md#usergetbyemail) | **GET** /api/user/email/{email} | Get a specific user by email +*UserApi* | [**userUpdateUser**](doc\/UserApi.md#userupdateuser) | **PUT** /api/user | Update an user +*ValuesApi* | [**valuesDelete**](doc\/ValuesApi.md#valuesdelete) | **DELETE** /api/test/{id} | +*ValuesApi* | [**valuesGet**](doc\/ValuesApi.md#valuesget) | **GET** /api/test/{id} | +*ValuesApi* | [**valuesGetAll**](doc\/ValuesApi.md#valuesgetall) | **GET** /api/test | It's a test ! :) +*ValuesApi* | [**valuesPost**](doc\/ValuesApi.md#valuespost) | **POST** /api/test | +*ValuesApi* | [**valuesPut**](doc\/ValuesApi.md#valuesput) | **PUT** /api/test/{id} | + + +## Documentation For Models + + - [Action](doc\/Action.md) + - [ActionType](doc\/ActionType.md) + - [AlarmMode](doc\/AlarmMode.md) + - [AlarmModeCreateOrUpdateDetailDTO](doc\/AlarmModeCreateOrUpdateDetailDTO.md) + - [AlarmModeCreateOrUpdateDetailDTOAllOf](doc\/AlarmModeCreateOrUpdateDetailDTOAllOf.md) + - [AlarmModeDTO](doc\/AlarmModeDTO.md) + - [AlarmModeDetailDTO](doc\/AlarmModeDetailDTO.md) + - [AlarmModeDetailDTOAllOf](doc\/AlarmModeDetailDTOAllOf.md) + - [AlarmTriggered](doc\/AlarmTriggered.md) + - [AlarmType](doc\/AlarmType.md) + - [AutomationDTO](doc\/AutomationDTO.md) + - [AutomationDetailDTO](doc\/AutomationDetailDTO.md) + - [AutomationDetailDTOAllOf](doc\/AutomationDetailDTOAllOf.md) + - [AutomationState](doc\/AutomationState.md) + - [AutomationTriggered](doc\/AutomationTriggered.md) + - [AzureADAuthModel](doc\/AzureADAuthModel.md) + - [Book](doc\/Book.md) + - [Condition](doc\/Condition.md) + - [ConditionType](doc\/ConditionType.md) + - [ConditionValue](doc\/ConditionValue.md) + - [ConnectionStatus](doc\/ConnectionStatus.md) + - [CreateOrUpdateHomeDTO](doc\/CreateOrUpdateHomeDTO.md) + - [CreateOrUpdateHomeDTOAllOf](doc\/CreateOrUpdateHomeDTOAllOf.md) + - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) + - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) + - [DeviceState](doc\/DeviceState.md) + - [DeviceSummaryDTO](doc\/DeviceSummaryDTO.md) + - [DeviceType](doc\/DeviceType.md) + - [ElectricityProduction](doc\/ElectricityProduction.md) + - [EventDTO](doc\/EventDTO.md) + - [EventDetailDTO](doc\/EventDetailDTO.md) + - [EventDetailDTOAllOf](doc\/EventDetailDTOAllOf.md) + - [EventFilter](doc\/EventFilter.md) + - [EventHomeFilter](doc\/EventHomeFilter.md) + - [EventHomeFilterAllOf](doc\/EventHomeFilterAllOf.md) + - [EventType](doc\/EventType.md) + - [FacebookAuthModel](doc\/FacebookAuthModel.md) + - [GeolocalizedMode](doc\/GeolocalizedMode.md) + - [GoogleAuthModel](doc\/GoogleAuthModel.md) + - [GroupCreateOrUpdateDetailDTO](doc\/GroupCreateOrUpdateDetailDTO.md) + - [GroupCreateOrUpdateDetailDTOAllOf](doc\/GroupCreateOrUpdateDetailDTOAllOf.md) + - [GroupDetailDTO](doc\/GroupDetailDTO.md) + - [GroupDetailDTOAllOf](doc\/GroupDetailDTOAllOf.md) + - [GroupSummaryDTO](doc\/GroupSummaryDTO.md) + - [HomeDTO](doc\/HomeDTO.md) + - [HomeDetailDTO](doc\/HomeDetailDTO.md) + - [HomeDetailDTOAllOf](doc\/HomeDetailDTOAllOf.md) + - [ListResponseOfEventDetailDTOAndEventHomeFilter](doc\/ListResponseOfEventDetailDTOAndEventHomeFilter.md) + - [LoginDTO](doc\/LoginDTO.md) + - [MeansOfCommunication](doc\/MeansOfCommunication.md) + - [MqttMessageDTO](doc\/MqttMessageDTO.md) + - [OddNice](doc\/OddNice.md) + - [OddObject](doc\/OddObject.md) + - [PanelMenuItem](doc\/PanelMenuItem.md) + - [PanelSection](doc\/PanelSection.md) + - [ProgrammedMode](doc\/ProgrammedMode.md) + - [ProviderDTO](doc\/ProviderDTO.md) + - [ProviderType](doc\/ProviderType.md) + - [RoomCreateOrUpdateDetailDTO](doc\/RoomCreateOrUpdateDetailDTO.md) + - [RoomDetailDTO](doc\/RoomDetailDTO.md) + - [RoomMainDetailDTO](doc\/RoomMainDetailDTO.md) + - [RoomMainDetailDTOAllOf](doc\/RoomMainDetailDTOAllOf.md) + - [RoomSummaryDTO](doc\/RoomSummaryDTO.md) + - [ScreenDevice](doc\/ScreenDevice.md) + - [SmartGardenMessage](doc\/SmartGardenMessage.md) + - [SmartPrinterMessage](doc\/SmartPrinterMessage.md) + - [TimePeriodAlarm](doc\/TimePeriodAlarm.md) + - [TokenDTO](doc\/TokenDTO.md) + - [Trigger](doc\/Trigger.md) + - [TriggerType](doc\/TriggerType.md) + - [TwitterAuthModel](doc\/TwitterAuthModel.md) + - [User](doc\/User.md) + - [UserInfo](doc\/UserInfo.md) + - [UserInfoDetailDTO](doc\/UserInfoDetailDTO.md) + - [ViewBy](doc\/ViewBy.md) + + +## Documentation For Authorization + + +## bearer + +- **Type**: OAuth +- **Flow**: password +- **Authorization URL**: /authentication/Token +- **Scopes**: + - **MyCore-api**: MyCore WebAPI + + +## Author + + + + diff --git a/mycore_api_old/doc/Action.md b/mycore_api_old/doc/Action.md new file mode 100644 index 0000000..82d2f28 --- /dev/null +++ b/mycore_api_old/doc/Action.md @@ -0,0 +1,21 @@ +# mycoreapi.model.Action + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groupId** | **String** | | [optional] +**deviceId** | **String** | | [optional] +**states** | [**List**](AutomationState.md) | | [optional] [default to const []] +**rawRequest** | **String** | | [optional] +**providerId** | **String** | | [optional] +**type** | [**ActionType**](ActionType.md) | | [optional] +**isForce** | **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/mycore_api_old/doc/ActionType.md b/mycore_api_old/doc/ActionType.md new file mode 100644 index 0000000..0529e1a --- /dev/null +++ b/mycore_api_old/doc/ActionType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ActionType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/AlarmApi.md b/mycore_api_old/doc/AlarmApi.md new file mode 100644 index 0000000..ee0b71f --- /dev/null +++ b/mycore_api_old/doc/AlarmApi.md @@ -0,0 +1,365 @@ +# mycoreapi.api.AlarmApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**alarmActivate**](AlarmApi.md#alarmactivate) | **POST** /api/alarm/activate/{alarmModeId} | Activate specified alarm mode +[**alarmCreate**](AlarmApi.md#alarmcreate) | **POST** /api/alarm | Create an alarm mode +[**alarmCreateDefaultAlarms**](AlarmApi.md#alarmcreatedefaultalarms) | **POST** /api/alarm/defaults/{homeId} | Create default alarm modes +[**alarmDelete**](AlarmApi.md#alarmdelete) | **DELETE** /api/alarm/{alarmModeId} | Delete an alarm mode +[**alarmDeleteAllForHome**](AlarmApi.md#alarmdeleteallforhome) | **DELETE** /api/alarm/home/{homeId} | Delete all alarm mode for a specified home +[**alarmGetAll**](AlarmApi.md#alarmgetall) | **GET** /api/alarm/{homeId} | Get all alarm modes for the specified home +[**alarmGetDetail**](AlarmApi.md#alarmgetdetail) | **GET** /api/alarm/detail/{alarmModeId} | Get detail info of a specified alarm mode +[**alarmUpdate**](AlarmApi.md#alarmupdate) | **PUT** /api/alarm | Update an alarm mode + + +# **alarmActivate** +> String alarmActivate(alarmModeId) + +Activate specified alarm mode + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final alarmModeId = alarmModeId_example; // String | Alarm mode to activate + +try { + final result = api_instance.alarmActivate(alarmModeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmActivate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alarmModeId** | **String**| Alarm mode to activate | + +### 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) + +# **alarmCreate** +> AlarmModeDetailDTO alarmCreate(alarmModeCreateOrUpdateDetailDTO) + +Create an alarm mode + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final alarmModeCreateOrUpdateDetailDTO = AlarmModeCreateOrUpdateDetailDTO(); // AlarmModeCreateOrUpdateDetailDTO | Alarm mode to create + +try { + final result = api_instance.alarmCreate(alarmModeCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alarmModeCreateOrUpdateDetailDTO** | [**AlarmModeCreateOrUpdateDetailDTO**](AlarmModeCreateOrUpdateDetailDTO.md)| Alarm mode to create | + +### Return type + +[**AlarmModeDetailDTO**](AlarmModeDetailDTO.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) + +# **alarmCreateDefaultAlarms** +> bool alarmCreateDefaultAlarms(homeId) + +Create default alarm modes + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.alarmCreateDefaultAlarms(homeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmCreateDefaultAlarms: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +**bool** + +### 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) + +# **alarmDelete** +> String alarmDelete(alarmModeId) + +Delete an alarm mode + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final alarmModeId = alarmModeId_example; // String | Id of alarm mode to delete + +try { + final result = api_instance.alarmDelete(alarmModeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alarmModeId** | **String**| Id of alarm mode to delete | + +### 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) + +# **alarmDeleteAllForHome** +> String alarmDeleteAllForHome(homeId) + +Delete all alarm mode for a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.alarmDeleteAllForHome(homeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmDeleteAllForHome: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### 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) + +# **alarmGetAll** +> List alarmGetAll(homeId) + +Get all alarm modes for the specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.alarmGetAll(homeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](AlarmModeDTO.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) + +# **alarmGetDetail** +> AlarmModeDetailDTO alarmGetDetail(alarmModeId) + +Get detail info of a specified alarm mode + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final alarmModeId = alarmModeId_example; // String | alarm id + +try { + final result = api_instance.alarmGetDetail(alarmModeId); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alarmModeId** | **String**| alarm id | + +### Return type + +[**AlarmModeDetailDTO**](AlarmModeDetailDTO.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) + +# **alarmUpdate** +> AlarmModeDetailDTO alarmUpdate(alarmModeCreateOrUpdateDetailDTO) + +Update an alarm mode + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AlarmApi(); +final alarmModeCreateOrUpdateDetailDTO = AlarmModeCreateOrUpdateDetailDTO(); // AlarmModeCreateOrUpdateDetailDTO | alarm mode to update + +try { + final result = api_instance.alarmUpdate(alarmModeCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling AlarmApi->alarmUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alarmModeCreateOrUpdateDetailDTO** | [**AlarmModeCreateOrUpdateDetailDTO**](AlarmModeCreateOrUpdateDetailDTO.md)| alarm mode to update | + +### Return type + +[**AlarmModeDetailDTO**](AlarmModeDetailDTO.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/mycore_api_old/doc/AlarmMode.md b/mycore_api_old/doc/AlarmMode.md new file mode 100644 index 0000000..983297e --- /dev/null +++ b/mycore_api_old/doc/AlarmMode.md @@ -0,0 +1,28 @@ +# mycoreapi.model.AlarmMode + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**activated** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**notification** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**type** | [**AlarmType**](AlarmType.md) | | [optional] +**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [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/mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTO.md b/mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTO.md new file mode 100644 index 0000000..e0608f3 --- /dev/null +++ b/mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTO.md @@ -0,0 +1,27 @@ +# mycoreapi.model.AlarmModeCreateOrUpdateDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | [**AlarmType**](AlarmType.md) | | [optional] +**activated** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**notification** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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/mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md b/mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md new file mode 100644 index 0000000..d8dbab5 --- /dev/null +++ b/mycore_api_old/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# mycoreapi.model.AlarmModeCreateOrUpdateDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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/mycore_api_old/doc/AlarmModeDTO.md b/mycore_api_old/doc/AlarmModeDTO.md new file mode 100644 index 0000000..5a2da17 --- /dev/null +++ b/mycore_api_old/doc/AlarmModeDTO.md @@ -0,0 +1,23 @@ +# mycoreapi.model.AlarmModeDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | [**AlarmType**](AlarmType.md) | | [optional] +**activated** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**notification** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**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/mycore_api_old/doc/AlarmModeDetailDTO.md b/mycore_api_old/doc/AlarmModeDetailDTO.md new file mode 100644 index 0000000..7079e79 --- /dev/null +++ b/mycore_api_old/doc/AlarmModeDetailDTO.md @@ -0,0 +1,27 @@ +# mycoreapi.model.AlarmModeDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | [**AlarmType**](AlarmType.md) | | [optional] +**activated** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**notification** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**devices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] +**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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/mycore_api_old/doc/AlarmModeDetailDTOAllOf.md b/mycore_api_old/doc/AlarmModeDetailDTOAllOf.md new file mode 100644 index 0000000..9b4ab2b --- /dev/null +++ b/mycore_api_old/doc/AlarmModeDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# mycoreapi.model.AlarmModeDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**devices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] +**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional] +**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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/mycore_api_old/doc/AlarmTriggered.md b/mycore_api_old/doc/AlarmTriggered.md new file mode 100644 index 0000000..ce21e22 --- /dev/null +++ b/mycore_api_old/doc/AlarmTriggered.md @@ -0,0 +1,17 @@ +# mycoreapi.model.AlarmTriggered + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alarmModeId** | **String** | | [optional] +**alarmModeName** | **String** | | [optional] +**type** | [**AlarmType**](AlarmType.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/mycore_api_old/doc/AlarmType.md b/mycore_api_old/doc/AlarmType.md new file mode 100644 index 0000000..1f4bf4f --- /dev/null +++ b/mycore_api_old/doc/AlarmType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.AlarmType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/AuthenticationApi.md b/mycore_api_old/doc/AuthenticationApi.md new file mode 100644 index 0000000..b996c89 --- /dev/null +++ b/mycore_api_old/doc/AuthenticationApi.md @@ -0,0 +1,109 @@ +# mycoreapi.api.AuthenticationApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authenticationAuthenticateWithForm**](AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | Authenticate with form parameters (used by Swagger test client) +[**authenticationAuthenticateWithJson**](AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | Authenticate with Json parameters (used by most clients) + + +# **authenticationAuthenticateWithForm** +> TokenDTO authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret) + +Authenticate with form parameters (used by Swagger test client) + +### Example +```dart +import 'package:mycoreapi/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) + +Authenticate with Json parameters (used by most clients) + +### Example +```dart +import 'package:mycoreapi/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 | Login DTO + +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)| Login DTO | + +### 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/mycore_api/doc/Automation.md b/mycore_api_old/doc/Automation.md similarity index 100% rename from mycore_api/doc/Automation.md rename to mycore_api_old/doc/Automation.md diff --git a/mycore_api_old/doc/AutomationApi.md b/mycore_api_old/doc/AutomationApi.md new file mode 100644 index 0000000..7912e8a --- /dev/null +++ b/mycore_api_old/doc/AutomationApi.md @@ -0,0 +1,277 @@ +# mycoreapi.api.AutomationApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**automationCreate**](AutomationApi.md#automationcreate) | **POST** /api/automation | Create an automation +[**automationDelete**](AutomationApi.md#automationdelete) | **DELETE** /api/automation/{automationId} | Delete an automation +[**automationDeleteAllForHome**](AutomationApi.md#automationdeleteallforhome) | **DELETE** /api/automation/home/{homeId} | Delete all automation for a specified home +[**automationGetAll**](AutomationApi.md#automationgetall) | **GET** /api/automation/{homeId} | Get all automations for the specified home +[**automationGetDetail**](AutomationApi.md#automationgetdetail) | **GET** /api/automation/detail/{automationId} | Get detail info of a specified automation +[**automationUpdate**](AutomationApi.md#automationupdate) | **PUT** /api/automation | Update an automation + + +# **automationCreate** +> AutomationDTO automationCreate(automationDetailDTO) + +Create an automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationDetailDTO = AutomationDetailDTO(); // AutomationDetailDTO | Automation to create + +try { + final result = api_instance.automationCreate(automationDetailDTO); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationDetailDTO** | [**AutomationDetailDTO**](AutomationDetailDTO.md)| Automation to create | + +### Return type + +[**AutomationDTO**](AutomationDTO.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) + +# **automationDelete** +> String automationDelete(automationId) + +Delete an automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationId = automationId_example; // String | Id of automation to delete + +try { + final result = api_instance.automationDelete(automationId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationId** | **String**| Id of automation to delete | + +### 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) + +# **automationDeleteAllForHome** +> String automationDeleteAllForHome(homeId) + +Delete all automation for a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.automationDeleteAllForHome(homeId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationDeleteAllForHome: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### 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) + +# **automationGetAll** +> List automationGetAll(homeId) + +Get all automations for the specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.automationGetAll(homeId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](AutomationDTO.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) + +# **automationGetDetail** +> AutomationDetailDTO automationGetDetail(automationId) + +Get detail info of a specified automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationId = automationId_example; // String | automation id + +try { + final result = api_instance.automationGetDetail(automationId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationId** | **String**| automation id | + +### Return type + +[**AutomationDetailDTO**](AutomationDetailDTO.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) + +# **automationUpdate** +> AutomationDetailDTO automationUpdate(automationDetailDTO) + +Update an automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationDetailDTO = AutomationDetailDTO(); // AutomationDetailDTO | automation to update + +try { + final result = api_instance.automationUpdate(automationDetailDTO); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationDetailDTO** | [**AutomationDetailDTO**](AutomationDetailDTO.md)| automation to update | + +### Return type + +[**AutomationDetailDTO**](AutomationDetailDTO.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/mycore_api/doc/AutomationCreateOrUpdateDetailDTO.md b/mycore_api_old/doc/AutomationCreateOrUpdateDetailDTO.md similarity index 100% rename from mycore_api/doc/AutomationCreateOrUpdateDetailDTO.md rename to mycore_api_old/doc/AutomationCreateOrUpdateDetailDTO.md diff --git a/mycore_api/doc/AutomationCreateOrUpdateDetailDTOAllOf.md b/mycore_api_old/doc/AutomationCreateOrUpdateDetailDTOAllOf.md similarity index 100% rename from mycore_api/doc/AutomationCreateOrUpdateDetailDTOAllOf.md rename to mycore_api_old/doc/AutomationCreateOrUpdateDetailDTOAllOf.md diff --git a/mycore_api_old/doc/AutomationDTO.md b/mycore_api_old/doc/AutomationDTO.md new file mode 100644 index 0000000..4d167e4 --- /dev/null +++ b/mycore_api_old/doc/AutomationDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.AutomationDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**active** | **bool** | | [optional] +**homeId** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**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/mycore_api_old/doc/AutomationDetailDTO.md b/mycore_api_old/doc/AutomationDetailDTO.md new file mode 100644 index 0000000..5c95094 --- /dev/null +++ b/mycore_api_old/doc/AutomationDetailDTO.md @@ -0,0 +1,24 @@ +# mycoreapi.model.AutomationDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**active** | **bool** | | [optional] +**homeId** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [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/mycore_api_old/doc/AutomationDetailDTOAllOf.md b/mycore_api_old/doc/AutomationDetailDTOAllOf.md new file mode 100644 index 0000000..1a10d67 --- /dev/null +++ b/mycore_api_old/doc/AutomationDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# mycoreapi.model.AutomationDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [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/mycore_api_old/doc/AutomationState.md b/mycore_api_old/doc/AutomationState.md new file mode 100644 index 0000000..dcd8a45 --- /dev/null +++ b/mycore_api_old/doc/AutomationState.md @@ -0,0 +1,16 @@ +# mycoreapi.model.AutomationState + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **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/mycore_api_old/doc/AutomationTriggered.md b/mycore_api_old/doc/AutomationTriggered.md new file mode 100644 index 0000000..12a5484 --- /dev/null +++ b/mycore_api_old/doc/AutomationTriggered.md @@ -0,0 +1,16 @@ +# mycoreapi.model.AutomationTriggered + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automationId** | **String** | | [optional] +**automationName** | **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/mycore_api_old/doc/AzureADAuthModel.md b/mycore_api_old/doc/AzureADAuthModel.md new file mode 100644 index 0000000..76da060 --- /dev/null +++ b/mycore_api_old/doc/AzureADAuthModel.md @@ -0,0 +1,15 @@ +# mycoreapi.model.AzureADAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiKey** | **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/mycore_api_old/doc/AzureApi.md b/mycore_api_old/doc/AzureApi.md new file mode 100644 index 0000000..77b096d --- /dev/null +++ b/mycore_api_old/doc/AzureApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.AzureApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**azureCreate**](AzureApi.md#azurecreate) | **POST** /azure | + + +# **azureCreate** +> MultipartFile azureCreate(azureADAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AzureApi(); +final azureADAuthModel = AzureADAuthModel(); // AzureADAuthModel | + +try { + final result = api_instance.azureCreate(azureADAuthModel); + print(result); +} catch (e) { + print('Exception when calling AzureApi->azureCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **azureADAuthModel** | [**AzureADAuthModel**](AzureADAuthModel.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/Book.md b/mycore_api_old/doc/Book.md new file mode 100644 index 0000000..4e3d95f --- /dev/null +++ b/mycore_api_old/doc/Book.md @@ -0,0 +1,19 @@ +# mycoreapi.model.Book + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**bookName** | **String** | | [optional] +**price** | **num** | | [optional] +**category** | **String** | | [optional] +**author** | **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/mycore_api_old/doc/BooksApi.md b/mycore_api_old/doc/BooksApi.md new file mode 100644 index 0000000..6bdff46 --- /dev/null +++ b/mycore_api_old/doc/BooksApi.md @@ -0,0 +1,231 @@ +# mycoreapi.api.BooksApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**booksCreate**](BooksApi.md#bookscreate) | **POST** /api/books | +[**booksDelete**](BooksApi.md#booksdelete) | **DELETE** /api/books/{id} | +[**booksGet**](BooksApi.md#booksget) | **GET** /api/books/{id} | +[**booksGetAll**](BooksApi.md#booksgetall) | **GET** /api/books | +[**booksUpdate**](BooksApi.md#booksupdate) | **PUT** /api/books/{id} | + + +# **booksCreate** +> Book booksCreate(book) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final book = Book(); // Book | + +try { + final result = api_instance.booksCreate(book); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **book** | [**Book**](Book.md)| | + +### Return type + +[**Book**](Book.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) + +# **booksDelete** +> MultipartFile booksDelete(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final id = id_example; // String | + +try { + final result = api_instance.booksDelete(id); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksDelete: $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 + +[[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) + +# **booksGet** +> Book booksGet(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final id = id_example; // String | + +try { + final result = api_instance.booksGet(id); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**Book**](Book.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) + +# **booksGetAll** +> List booksGetAll() + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); + +try { + final result = api_instance.booksGetAll(); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksGetAll: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](Book.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) + +# **booksUpdate** +> MultipartFile booksUpdate(id, book) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final id = id_example; // String | +final book = Book(); // Book | + +try { + final result = api_instance.booksUpdate(id, book); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **book** | [**Book**](Book.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/Condition.md b/mycore_api_old/doc/Condition.md new file mode 100644 index 0000000..3268817 --- /dev/null +++ b/mycore_api_old/doc/Condition.md @@ -0,0 +1,20 @@ +# mycoreapi.model.Condition + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceId** | **String** | | [optional] +**state** | [**OneOfAutomationState**](OneOfAutomationState.md) | | [optional] +**startTime** | **String** | | [optional] +**endTime** | **String** | | [optional] +**type** | [**ConditionType**](ConditionType.md) | | [optional] +**value** | [**ConditionValue**](ConditionValue.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/mycore_api_old/doc/ConditionType.md b/mycore_api_old/doc/ConditionType.md new file mode 100644 index 0000000..0ab4c5f --- /dev/null +++ b/mycore_api_old/doc/ConditionType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ConditionType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/ConditionValue.md b/mycore_api_old/doc/ConditionValue.md new file mode 100644 index 0000000..a557e0c --- /dev/null +++ b/mycore_api_old/doc/ConditionValue.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ConditionValue + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/ConnectionStatus.md b/mycore_api_old/doc/ConnectionStatus.md new file mode 100644 index 0000000..7c1e861 --- /dev/null +++ b/mycore_api_old/doc/ConnectionStatus.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ConnectionStatus + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/CreateOrUpdateHomeDTO.md b/mycore_api_old/doc/CreateOrUpdateHomeDTO.md new file mode 100644 index 0000000..537a60d --- /dev/null +++ b/mycore_api_old/doc/CreateOrUpdateHomeDTO.md @@ -0,0 +1,22 @@ +# mycoreapi.model.CreateOrUpdateHomeDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**usersIds** | **List** | | [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/mycore_api_old/doc/CreateOrUpdateHomeDTOAllOf.md b/mycore_api_old/doc/CreateOrUpdateHomeDTOAllOf.md new file mode 100644 index 0000000..b34361e --- /dev/null +++ b/mycore_api_old/doc/CreateOrUpdateHomeDTOAllOf.md @@ -0,0 +1,15 @@ +# mycoreapi.model.CreateOrUpdateHomeDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**usersIds** | **List** | | [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/mycore_api/doc/Device.md b/mycore_api_old/doc/Device.md similarity index 100% rename from mycore_api/doc/Device.md rename to mycore_api_old/doc/Device.md diff --git a/mycore_api_old/doc/DeviceApi.md b/mycore_api_old/doc/DeviceApi.md new file mode 100644 index 0000000..b9dae3e --- /dev/null +++ b/mycore_api_old/doc/DeviceApi.md @@ -0,0 +1,551 @@ +# mycoreapi.api.DeviceApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/device | Create a device +[**deviceCreateDevicesFromProvider**](DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{homeId}/fromProvider/{providerId} | Create devices from provider +[**deviceDelete**](DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device +[**deviceDeleteAllForHome**](DeviceApi.md#devicedeleteallforhome) | **DELETE** /api/device/home/{homeId} | Delete all device for a specified home +[**deviceDeleteDevicesFromProvider**](DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{homeId}/fromProvider/{providerId} | Delete devices from provider +[**deviceGetAll**](DeviceApi.md#devicegetall) | **GET** /api/device/{homeId} | Get all devices summary +[**deviceGetDetail**](DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info +[**deviceGetDevicesByType**](DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{homeId}/type/{type} | Get list of devices from a type +[**deviceGetDevicesFromProvider**](DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{homeId}/fromProvider/{providerId} | Get devices from provider +[**deviceGetDevicesFromZigbee2Mqtt**](DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt devices +[**deviceSendAction**](DeviceApi.md#devicesendaction) | **POST** /api/device/action | Send action to device +[**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device + + +# **deviceCreate** +> DeviceDetailDTO deviceCreate(deviceDetailDTO) + +Create a device + +### Example +```dart +import 'package:mycoreapi/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 | Device to create + +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)| Device to create | + +### 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) + +# **deviceCreateDevicesFromProvider** +> List deviceCreateDevicesFromProvider(homeId, providerId) + +Create devices from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Home Id +final providerId = providerId_example; // String | Id of Provider + +try { + final result = api_instance.deviceCreateDevicesFromProvider(homeId, providerId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + **providerId** | **String**| Id of Provider | + +### Return type + +[**List**](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) + +# **deviceDelete** +> String deviceDelete(deviceId) + +Delete a device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceId = deviceId_example; // String | Id of device to delete + +try { + final result = api_instance.deviceDelete(deviceId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Id of device to delete | + +### 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) + +# **deviceDeleteAllForHome** +> String deviceDeleteAllForHome(homeId) + +Delete all device for a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Id of home + +try { + final result = api_instance.deviceDeleteAllForHome(homeId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDeleteAllForHome: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Id of home | + +### 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) + +# **deviceDeleteDevicesFromProvider** +> String deviceDeleteDevicesFromProvider(homeId, providerId) + +Delete devices from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Home Id +final providerId = providerId_example; // String | Id of Provider + +try { + final result = api_instance.deviceDeleteDevicesFromProvider(homeId, providerId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + **providerId** | **String**| Id of Provider | + +### 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) + +# **deviceGetAll** +> List deviceGetAll(homeId) + +Get all devices summary + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.deviceGetAll(homeId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](DeviceSummaryDTO.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(deviceId) + +Get a specific device info + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceId = deviceId_example; // String | id of device + +try { + final result = api_instance.deviceGetDetail(deviceId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| id of device | + +### 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) + +# **deviceGetDevicesByType** +> List deviceGetDevicesByType(homeId, type) + +Get list of devices from a type + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Home Id +final type = ; // DeviceType | device type + +try { + final result = api_instance.deviceGetDevicesByType(homeId, type); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + **type** | [**DeviceType**](.md)| device type | + +### Return type + +[**List**](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) + +# **deviceGetDevicesFromProvider** +> List deviceGetDevicesFromProvider(homeId, providerId) + +Get devices from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Home Id +final providerId = providerId_example; // String | Id of Provider + +try { + final result = api_instance.deviceGetDevicesFromProvider(homeId, providerId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + **providerId** | **String**| Id of Provider | + +### Return type + +[**List**](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) + +# **deviceGetDevicesFromZigbee2Mqtt** +> List deviceGetDevicesFromZigbee2Mqtt(homeId) + +Get all zigbee2Mqtt devices + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(homeId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](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) + +# **deviceSendAction** +> String deviceSendAction(action) + +Send action to device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final action = Action(); // Action | Action to sent + +try { + final result = api_instance.deviceSendAction(action); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceSendAction: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **action** | [**Action**](Action.md)| Action to sent | + +### 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) + +# **deviceUpdate** +> DeviceDetailDTO deviceUpdate(deviceId, deviceDetailDTO) + +Update a device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceId = deviceId_example; // String | +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to update + +try { + final result = api_instance.deviceUpdate(deviceId, deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| | + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| Device to update | + +### 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) + diff --git a/mycore_api_old/doc/DeviceDetailDTO.md b/mycore_api_old/doc/DeviceDetailDTO.md new file mode 100644 index 0000000..ea98169 --- /dev/null +++ b/mycore_api_old/doc/DeviceDetailDTO.md @@ -0,0 +1,41 @@ +# mycoreapi.model.DeviceDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**description** | **String** | | [optional] +**name** | **String** | | [optional] +**model** | **String** | | [optional] +**type** | [**DeviceType**](DeviceType.md) | | [optional] +**status** | **bool** | | [optional] +**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional] +**roomId** | **String** | | [optional] +**providerId** | **String** | | [optional] +**providerName** | **String** | | [optional] +**lastStateDate** | [**DateTime**](DateTime.md) | | [optional] +**battery** | **bool** | | [optional] +**batteryStatus** | **int** | | [optional] +**firmwareVersion** | **String** | | [optional] +**hardwareVersion** | **String** | | [optional] +**port** | **int** | | [optional] +**meansOfCommunications** | [**List**](MeansOfCommunication.md) | | [optional] [default to const []] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**lastState** | **String** | | [optional] +**ipAddress** | **String** | | [optional] +**serviceIdentification** | **String** | | [optional] +**manufacturerName** | **String** | | [optional] +**groupIds** | **List** | | [optional] [default to const []] +**properties** | **String** | | [optional] +**supportedOperations** | **List** | | [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/mycore_api_old/doc/DeviceDetailDTOAllOf.md b/mycore_api_old/doc/DeviceDetailDTOAllOf.md new file mode 100644 index 0000000..e6fb511 --- /dev/null +++ b/mycore_api_old/doc/DeviceDetailDTOAllOf.md @@ -0,0 +1,27 @@ +# mycoreapi.model.DeviceDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firmwareVersion** | **String** | | [optional] +**hardwareVersion** | **String** | | [optional] +**port** | **int** | | [optional] +**meansOfCommunications** | [**List**](MeansOfCommunication.md) | | [optional] [default to const []] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**lastState** | **String** | | [optional] +**ipAddress** | **String** | | [optional] +**serviceIdentification** | **String** | | [optional] +**manufacturerName** | **String** | | [optional] +**groupIds** | **List** | | [optional] [default to const []] +**properties** | **String** | | [optional] +**supportedOperations** | **List** | | [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/mycore_api_old/doc/DeviceState.md b/mycore_api_old/doc/DeviceState.md new file mode 100644 index 0000000..930d187 --- /dev/null +++ b/mycore_api_old/doc/DeviceState.md @@ -0,0 +1,18 @@ +# mycoreapi.model.DeviceState + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceId** | **String** | | [optional] +**deviceName** | **String** | | [optional] +**message** | **String** | | [optional] +**deviceType** | [**DeviceType**](DeviceType.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/mycore_api_old/doc/DeviceSummaryDTO.md b/mycore_api_old/doc/DeviceSummaryDTO.md new file mode 100644 index 0000000..34560ab --- /dev/null +++ b/mycore_api_old/doc/DeviceSummaryDTO.md @@ -0,0 +1,28 @@ +# mycoreapi.model.DeviceSummaryDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**description** | **String** | | [optional] +**name** | **String** | | [optional] +**model** | **String** | | [optional] +**type** | [**DeviceType**](DeviceType.md) | | [optional] +**status** | **bool** | | [optional] +**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional] +**roomId** | **String** | | [optional] +**providerId** | **String** | | [optional] +**providerName** | **String** | | [optional] +**lastStateDate** | [**DateTime**](DateTime.md) | | [optional] +**battery** | **bool** | | [optional] +**batteryStatus** | **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/mycore_api_old/doc/DeviceType.md b/mycore_api_old/doc/DeviceType.md new file mode 100644 index 0000000..a35a53e --- /dev/null +++ b/mycore_api_old/doc/DeviceType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.DeviceType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/ElectricityProduction.md b/mycore_api_old/doc/ElectricityProduction.md new file mode 100644 index 0000000..208fd2e --- /dev/null +++ b/mycore_api_old/doc/ElectricityProduction.md @@ -0,0 +1,20 @@ +# mycoreapi.model.ElectricityProduction + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**deviceId** | **String** | | [optional] +**homeId** | **String** | | [optional] +**watt** | **double** | | [optional] +**ampere** | **double** | | [optional] +**timestamp** | [**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/mycore_api_old/doc/EnergyApi.md b/mycore_api_old/doc/EnergyApi.md new file mode 100644 index 0000000..add8f51 --- /dev/null +++ b/mycore_api_old/doc/EnergyApi.md @@ -0,0 +1,59 @@ +# mycoreapi.api.EnergyApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**energyGetElectricityProduction**](EnergyApi.md#energygetelectricityproduction) | **GET** /api/energy/electricity | Get summary production of Kwh/Year + + +# **energyGetElectricityProduction** +> List energyGetElectricityProduction(homeId, viewBy) + +Get summary production of Kwh/Year + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = EnergyApi(); +final homeId = homeId_example; // String | +final viewBy = ; // ViewBy | + +try { + final result = api_instance.energyGetElectricityProduction(homeId, viewBy); + print(result); +} catch (e) { + print('Exception when calling EnergyApi->energyGetElectricityProduction: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| | [optional] + **viewBy** | [**ViewBy**](.md)| | [optional] + +### Return type + +[**List**](ElectricityProduction.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) + diff --git a/mycore_api_old/doc/EventApi.md b/mycore_api_old/doc/EventApi.md new file mode 100644 index 0000000..c386fb6 --- /dev/null +++ b/mycore_api_old/doc/EventApi.md @@ -0,0 +1,205 @@ +# mycoreapi.api.EventApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**eventDelete**](EventApi.md#eventdelete) | **DELETE** /api/event/{eventId} | Delete an event +[**eventDeleteAllForHome**](EventApi.md#eventdeleteallforhome) | **DELETE** /api/event/home/{homeId} | Delete all events for a specified home +[**eventGet**](EventApi.md#eventget) | **GET** /api/event/{homeId} | Get events for the specified home +[**eventGetDetail**](EventApi.md#eventgetdetail) | **GET** /api/event/detail/{eventId} | Get detail info of a specified event + + +# **eventDelete** +> String eventDelete(eventId) + +Delete an event + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = EventApi(); +final eventId = eventId_example; // String | Id of event to delete + +try { + final result = api_instance.eventDelete(eventId); + print(result); +} catch (e) { + print('Exception when calling EventApi->eventDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eventId** | **String**| Id of event to delete | + +### 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) + +# **eventDeleteAllForHome** +> String eventDeleteAllForHome(homeId) + +Delete all events for a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = EventApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.eventDeleteAllForHome(homeId); + print(result); +} catch (e) { + print('Exception when calling EventApi->eventDeleteAllForHome: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### 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) + +# **eventGet** +> ListResponseOfEventDetailDTOAndEventHomeFilter eventGet(homeId, deviceId, roomId, startIndex, count, dateStart, dateEnd, eventType, deviceType) + +Get events for the specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = EventApi(); +final homeId = homeId_example; // String | Home Id +final deviceId = deviceId_example; // String | +final roomId = roomId_example; // String | +final startIndex = 56; // int | +final count = 56; // int | +final dateStart = 2013-10-20T19:20:30+01:00; // DateTime | +final dateEnd = 2013-10-20T19:20:30+01:00; // DateTime | +final eventType = ; // OneOfEventType | +final deviceType = ; // OneOfDeviceType | + +try { + final result = api_instance.eventGet(homeId, deviceId, roomId, startIndex, count, dateStart, dateEnd, eventType, deviceType); + print(result); +} catch (e) { + print('Exception when calling EventApi->eventGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + **deviceId** | **String**| | [optional] + **roomId** | **String**| | [optional] + **startIndex** | **int**| | [optional] + **count** | **int**| | [optional] + **dateStart** | **DateTime**| | [optional] + **dateEnd** | **DateTime**| | [optional] + **eventType** | [**OneOfEventType**](.md)| | [optional] + **deviceType** | [**OneOfDeviceType**](.md)| | [optional] + +### Return type + +[**ListResponseOfEventDetailDTOAndEventHomeFilter**](ListResponseOfEventDetailDTOAndEventHomeFilter.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) + +# **eventGetDetail** +> EventDetailDTO eventGetDetail(eventId) + +Get detail info of a specified event + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = EventApi(); +final eventId = eventId_example; // String | event id + +try { + final result = api_instance.eventGetDetail(eventId); + print(result); +} catch (e) { + print('Exception when calling EventApi->eventGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eventId** | **String**| event id | + +### Return type + +[**EventDetailDTO**](EventDetailDTO.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) + diff --git a/mycore_api_old/doc/EventDTO.md b/mycore_api_old/doc/EventDTO.md new file mode 100644 index 0000000..12ff11c --- /dev/null +++ b/mycore_api_old/doc/EventDTO.md @@ -0,0 +1,19 @@ +# mycoreapi.model.EventDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**date** | [**DateTime**](DateTime.md) | | [optional] +**type** | [**EventType**](EventType.md) | | [optional] +**roomId** | **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/mycore_api_old/doc/EventDetailDTO.md b/mycore_api_old/doc/EventDetailDTO.md new file mode 100644 index 0000000..2b065ea --- /dev/null +++ b/mycore_api_old/doc/EventDetailDTO.md @@ -0,0 +1,22 @@ +# mycoreapi.model.EventDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**date** | [**DateTime**](DateTime.md) | | [optional] +**type** | [**EventType**](EventType.md) | | [optional] +**roomId** | **String** | | [optional] +**deviceState** | [**OneOfDeviceState**](OneOfDeviceState.md) | | [optional] +**automationTriggered** | [**OneOfAutomationTriggered**](OneOfAutomationTriggered.md) | | [optional] +**alarmTriggered** | [**OneOfAlarmTriggered**](OneOfAlarmTriggered.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/mycore_api_old/doc/EventDetailDTOAllOf.md b/mycore_api_old/doc/EventDetailDTOAllOf.md new file mode 100644 index 0000000..9abd25a --- /dev/null +++ b/mycore_api_old/doc/EventDetailDTOAllOf.md @@ -0,0 +1,17 @@ +# mycoreapi.model.EventDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceState** | [**OneOfDeviceState**](OneOfDeviceState.md) | | [optional] +**automationTriggered** | [**OneOfAutomationTriggered**](OneOfAutomationTriggered.md) | | [optional] +**alarmTriggered** | [**OneOfAlarmTriggered**](OneOfAlarmTriggered.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/mycore_api_old/doc/EventFilter.md b/mycore_api_old/doc/EventFilter.md new file mode 100644 index 0000000..091e7b3 --- /dev/null +++ b/mycore_api_old/doc/EventFilter.md @@ -0,0 +1,20 @@ +# mycoreapi.model.EventFilter + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startIndex** | **int** | | [optional] +**count** | **int** | | [optional] +**dateStart** | [**DateTime**](DateTime.md) | | [optional] +**dateEnd** | [**DateTime**](DateTime.md) | | [optional] +**eventType** | [**OneOfEventType**](OneOfEventType.md) | | [optional] +**deviceType** | [**OneOfDeviceType**](OneOfDeviceType.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/mycore_api_old/doc/EventHomeFilter.md b/mycore_api_old/doc/EventHomeFilter.md new file mode 100644 index 0000000..98f9ba6 --- /dev/null +++ b/mycore_api_old/doc/EventHomeFilter.md @@ -0,0 +1,22 @@ +# mycoreapi.model.EventHomeFilter + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startIndex** | **int** | | [optional] +**count** | **int** | | [optional] +**dateStart** | [**DateTime**](DateTime.md) | | [optional] +**dateEnd** | [**DateTime**](DateTime.md) | | [optional] +**eventType** | [**OneOfEventType**](OneOfEventType.md) | | [optional] +**deviceType** | [**OneOfDeviceType**](OneOfDeviceType.md) | | [optional] +**deviceId** | **String** | | [optional] +**roomId** | **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/mycore_api_old/doc/EventHomeFilterAllOf.md b/mycore_api_old/doc/EventHomeFilterAllOf.md new file mode 100644 index 0000000..4af7976 --- /dev/null +++ b/mycore_api_old/doc/EventHomeFilterAllOf.md @@ -0,0 +1,16 @@ +# mycoreapi.model.EventHomeFilterAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceId** | **String** | | [optional] +**roomId** | **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/mycore_api_old/doc/EventType.md b/mycore_api_old/doc/EventType.md new file mode 100644 index 0000000..e2b757d --- /dev/null +++ b/mycore_api_old/doc/EventType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.EventType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/FacebookApi.md b/mycore_api_old/doc/FacebookApi.md new file mode 100644 index 0000000..d33af2a --- /dev/null +++ b/mycore_api_old/doc/FacebookApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.FacebookApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**facebookCreate**](FacebookApi.md#facebookcreate) | **POST** /facebook | + + +# **facebookCreate** +> MultipartFile facebookCreate(facebookAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = FacebookApi(); +final facebookAuthModel = FacebookAuthModel(); // FacebookAuthModel | + +try { + final result = api_instance.facebookCreate(facebookAuthModel); + print(result); +} catch (e) { + print('Exception when calling FacebookApi->facebookCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **facebookAuthModel** | [**FacebookAuthModel**](FacebookAuthModel.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/FacebookAuthModel.md b/mycore_api_old/doc/FacebookAuthModel.md new file mode 100644 index 0000000..fbc7fdc --- /dev/null +++ b/mycore_api_old/doc/FacebookAuthModel.md @@ -0,0 +1,15 @@ +# mycoreapi.model.FacebookAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userAccessToken** | **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/mycore_api_old/doc/GeolocalizedMode.md b/mycore_api_old/doc/GeolocalizedMode.md new file mode 100644 index 0000000..6756db9 --- /dev/null +++ b/mycore_api_old/doc/GeolocalizedMode.md @@ -0,0 +1,18 @@ +# mycoreapi.model.GeolocalizedMode + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**homeMode** | [**OneOfAlarmMode**](OneOfAlarmMode.md) | | [optional] +**absentMode** | [**OneOfAlarmMode**](OneOfAlarmMode.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/mycore_api_old/doc/GoogleApi.md b/mycore_api_old/doc/GoogleApi.md new file mode 100644 index 0000000..039ee0f --- /dev/null +++ b/mycore_api_old/doc/GoogleApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.GoogleApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**googleCreate**](GoogleApi.md#googlecreate) | **POST** /google | + + +# **googleCreate** +> MultipartFile googleCreate(googleAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GoogleApi(); +final googleAuthModel = GoogleAuthModel(); // GoogleAuthModel | + +try { + final result = api_instance.googleCreate(googleAuthModel); + print(result); +} catch (e) { + print('Exception when calling GoogleApi->googleCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **googleAuthModel** | [**GoogleAuthModel**](GoogleAuthModel.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/GoogleAuthModel.md b/mycore_api_old/doc/GoogleAuthModel.md new file mode 100644 index 0000000..aad8249 --- /dev/null +++ b/mycore_api_old/doc/GoogleAuthModel.md @@ -0,0 +1,16 @@ +# mycoreapi.model.GoogleAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authorizationCode** | **String** | | [optional] +**apiKey** | **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/mycore_api/doc/Group.md b/mycore_api_old/doc/Group.md similarity index 100% rename from mycore_api/doc/Group.md rename to mycore_api_old/doc/Group.md diff --git a/mycore_api_old/doc/GroupApi.md b/mycore_api_old/doc/GroupApi.md new file mode 100644 index 0000000..194bb41 --- /dev/null +++ b/mycore_api_old/doc/GroupApi.md @@ -0,0 +1,457 @@ +# mycoreapi.api.GroupApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**groupCreate**](GroupApi.md#groupcreate) | **POST** /api/group | Create a group +[**groupCreateDevicesFromZigbee2Mqtt**](GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{homeId}/fromZigbee | Create groups from provider +[**groupDelete**](GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group +[**groupDelete2**](GroupApi.md#groupdelete2) | **DELETE** /api/group/{groupId} | Delete a group +[**groupDeleteAllForHome**](GroupApi.md#groupdeleteallforhome) | **DELETE** /api/group/home/{homeId} | Delete all group for a specified home +[**groupGetAll**](GroupApi.md#groupgetall) | **GET** /api/group/{homeId} | Get all groups for the specified home +[**groupGetDetail**](GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group +[**groupGetGroupsByType**](GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{homeId}/type/{type} | Get list of group from a type +[**groupGetGroupsFromZigbee2Mqtt**](GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt groups +[**groupUpdate**](GroupApi.md#groupupdate) | **PUT** /api/group | Update a group + + +# **groupCreate** +> GroupDetailDTO groupCreate(groupCreateOrUpdateDetailDTO) + +Create a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | Group to create + +try { + final result = api_instance.groupCreate(groupCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupCreateOrUpdateDetailDTO** | [**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.md)| Group to create | + +### Return type + +[**GroupDetailDTO**](GroupDetailDTO.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) + +# **groupCreateDevicesFromZigbee2Mqtt** +> List groupCreateDevicesFromZigbee2Mqtt(homeId) + +Create groups from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(homeId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupCreateDevicesFromZigbee2Mqtt: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](GroupDetailDTO.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) + +# **groupDelete** +> String groupDelete(deviceId, groupId) + +Delete device from a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final deviceId = deviceId_example; // String | Id of device to delete from the group +final groupId = groupId_example; // String | Id of group + +try { + final result = api_instance.groupDelete(deviceId, groupId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Id of device to delete from the group | + **groupId** | **String**| Id of group | + +### 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) + +# **groupDelete2** +> String groupDelete2(groupId) + +Delete a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupId = groupId_example; // String | Id of group + +try { + final result = api_instance.groupDelete2(groupId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupDelete2: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| Id of group | + +### 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) + +# **groupDeleteAllForHome** +> String groupDeleteAllForHome(homeId) + +Delete all group for a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.groupDeleteAllForHome(homeId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupDeleteAllForHome: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### 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) + +# **groupGetAll** +> List groupGetAll(homeId) + +Get all groups for the specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.groupGetAll(homeId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](GroupSummaryDTO.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) + +# **groupGetDetail** +> GroupDetailDTO groupGetDetail(groupId) + +Get detail info of a specified group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupId = groupId_example; // String | groupid + +try { + final result = api_instance.groupGetDetail(groupId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| groupid | + +### Return type + +[**GroupDetailDTO**](GroupDetailDTO.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) + +# **groupGetGroupsByType** +> List groupGetGroupsByType(homeId, type) + +Get list of group from a type + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final homeId = homeId_example; // String | home Id +final type = type_example; // String | group type + +try { + final result = api_instance.groupGetGroupsByType(homeId, type); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetGroupsByType: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| home Id | + **type** | **String**| group type | + +### Return type + +[**List**](GroupSummaryDTO.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) + +# **groupGetGroupsFromZigbee2Mqtt** +> List groupGetGroupsFromZigbee2Mqtt(homeId) + +Get all zigbee2Mqtt groups + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.groupGetGroupsFromZigbee2Mqtt(homeId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetGroupsFromZigbee2Mqtt: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](GroupDetailDTO.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) + +# **groupUpdate** +> GroupCreateOrUpdateDetailDTO groupUpdate(groupCreateOrUpdateDetailDTO) + +Update a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | group to update + +try { + final result = api_instance.groupUpdate(groupCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupCreateOrUpdateDetailDTO** | [**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.md)| group to update | + +### Return type + +[**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.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/mycore_api_old/doc/GroupCreateOrUpdateDetailDTO.md b/mycore_api_old/doc/GroupCreateOrUpdateDetailDTO.md new file mode 100644 index 0000000..257392f --- /dev/null +++ b/mycore_api_old/doc/GroupCreateOrUpdateDetailDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.GroupCreateOrUpdateDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**deviceIds** | **List** | | [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/mycore_api_old/doc/GroupCreateOrUpdateDetailDTOAllOf.md b/mycore_api_old/doc/GroupCreateOrUpdateDetailDTOAllOf.md new file mode 100644 index 0000000..759be14 --- /dev/null +++ b/mycore_api_old/doc/GroupCreateOrUpdateDetailDTOAllOf.md @@ -0,0 +1,15 @@ +# mycoreapi.model.GroupCreateOrUpdateDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceIds** | **List** | | [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/mycore_api_old/doc/GroupDetailDTO.md b/mycore_api_old/doc/GroupDetailDTO.md new file mode 100644 index 0000000..288905c --- /dev/null +++ b/mycore_api_old/doc/GroupDetailDTO.md @@ -0,0 +1,22 @@ +# mycoreapi.model.GroupDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devices** | [**List**](DeviceDetailDTO.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/mycore_api_old/doc/GroupDetailDTOAllOf.md b/mycore_api_old/doc/GroupDetailDTOAllOf.md new file mode 100644 index 0000000..619df51 --- /dev/null +++ b/mycore_api_old/doc/GroupDetailDTOAllOf.md @@ -0,0 +1,17 @@ +# mycoreapi.model.GroupDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devices** | [**List**](DeviceDetailDTO.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/mycore_api_old/doc/GroupSummaryDTO.md b/mycore_api_old/doc/GroupSummaryDTO.md new file mode 100644 index 0000000..1e5caf5 --- /dev/null +++ b/mycore_api_old/doc/GroupSummaryDTO.md @@ -0,0 +1,19 @@ +# mycoreapi.model.GroupSummaryDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**isAlarm** | **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/mycore_api_old/doc/HomeApi.md b/mycore_api_old/doc/HomeApi.md new file mode 100644 index 0000000..5fa3b15 --- /dev/null +++ b/mycore_api_old/doc/HomeApi.md @@ -0,0 +1,233 @@ +# mycoreapi.api.HomeApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**homeCreate**](HomeApi.md#homecreate) | **POST** /api/home | Create a home +[**homeDelete**](HomeApi.md#homedelete) | **DELETE** /api/home/{homeId} | Delete a home +[**homeGetAll**](HomeApi.md#homegetall) | **GET** /api/home/{userId} | Get all home for specified user +[**homeGetDetail**](HomeApi.md#homegetdetail) | **GET** /api/home/detail/{homeId} | Get detail info of a specified home +[**homeUpdate**](HomeApi.md#homeupdate) | **PUT** /api/home | Update a home + + +# **homeCreate** +> HomeDTO homeCreate(createOrUpdateHomeDTO) + +Create a home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = HomeApi(); +final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to create + +try { + final result = api_instance.homeCreate(createOrUpdateHomeDTO); + print(result); +} catch (e) { + print('Exception when calling HomeApi->homeCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createOrUpdateHomeDTO** | [**CreateOrUpdateHomeDTO**](CreateOrUpdateHomeDTO.md)| Home to create | + +### Return type + +[**HomeDTO**](HomeDTO.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) + +# **homeDelete** +> String homeDelete(homeId) + +Delete a home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = HomeApi(); +final homeId = homeId_example; // String | Id of home to delete + +try { + final result = api_instance.homeDelete(homeId); + print(result); +} catch (e) { + print('Exception when calling HomeApi->homeDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Id of home to delete | + +### 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) + +# **homeGetAll** +> List homeGetAll(userId) + +Get all home for specified user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = HomeApi(); +final userId = userId_example; // String | User Id + +try { + final result = api_instance.homeGetAll(userId); + print(result); +} catch (e) { + print('Exception when calling HomeApi->homeGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + +### Return type + +[**List**](HomeDTO.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) + +# **homeGetDetail** +> HomeDetailDTO homeGetDetail(homeId) + +Get detail info of a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = HomeApi(); +final homeId = homeId_example; // String | home id + +try { + final result = api_instance.homeGetDetail(homeId); + print(result); +} catch (e) { + print('Exception when calling HomeApi->homeGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| home id | + +### Return type + +[**HomeDetailDTO**](HomeDetailDTO.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) + +# **homeUpdate** +> HomeDTO homeUpdate(createOrUpdateHomeDTO) + +Update a home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = HomeApi(); +final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to update + +try { + final result = api_instance.homeUpdate(createOrUpdateHomeDTO); + print(result); +} catch (e) { + print('Exception when calling HomeApi->homeUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createOrUpdateHomeDTO** | [**CreateOrUpdateHomeDTO**](CreateOrUpdateHomeDTO.md)| Home to update | + +### Return type + +[**HomeDTO**](HomeDTO.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/mycore_api_old/doc/HomeDTO.md b/mycore_api_old/doc/HomeDTO.md new file mode 100644 index 0000000..177cc58 --- /dev/null +++ b/mycore_api_old/doc/HomeDTO.md @@ -0,0 +1,22 @@ +# mycoreapi.model.HomeDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**usersIds** | **List** | | [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/mycore_api_old/doc/HomeDetailDTO.md b/mycore_api_old/doc/HomeDetailDTO.md new file mode 100644 index 0000000..a3ee022 --- /dev/null +++ b/mycore_api_old/doc/HomeDetailDTO.md @@ -0,0 +1,27 @@ +# mycoreapi.model.HomeDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**usersIds** | **List** | | [optional] [default to const []] +**users** | [**List**](UserInfoDetailDTO.md) | | [optional] [default to const []] +**devices** | [**List**](DeviceSummaryDTO.md) | | [optional] [default to const []] +**automations** | [**List**](AutomationDTO.md) | | [optional] [default to const []] +**providers** | [**List**](ProviderDTO.md) | | [optional] [default to const []] +**groups** | [**List**](GroupSummaryDTO.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/mycore_api_old/doc/HomeDetailDTOAllOf.md b/mycore_api_old/doc/HomeDetailDTOAllOf.md new file mode 100644 index 0000000..beccd35 --- /dev/null +++ b/mycore_api_old/doc/HomeDetailDTOAllOf.md @@ -0,0 +1,19 @@ +# mycoreapi.model.HomeDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**List**](UserInfoDetailDTO.md) | | [optional] [default to const []] +**devices** | [**List**](DeviceSummaryDTO.md) | | [optional] [default to const []] +**automations** | [**List**](AutomationDTO.md) | | [optional] [default to const []] +**providers** | [**List**](ProviderDTO.md) | | [optional] [default to const []] +**groups** | [**List**](GroupSummaryDTO.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/mycore_api_old/doc/IOTApi.md b/mycore_api_old/doc/IOTApi.md new file mode 100644 index 0000000..2ab1ec2 --- /dev/null +++ b/mycore_api_old/doc/IOTApi.md @@ -0,0 +1,151 @@ +# mycoreapi.api.IOTApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**iOTGetSmartPrinterMessages**](IOTApi.md#iotgetsmartprintermessages) | **GET** /api/iot/smartprinter/{idDevice} | Retrieve all SmartPrinterMessage +[**iOTPostToDBPrinter**](IOTApi.md#iotposttodbprinter) | **POST** /api/iot/smartprinter/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) +[**iOTPostToDBSmartGarden**](IOTApi.md#iotposttodbsmartgarden) | **POST** /api/iot/smartgarden/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) + + +# **iOTGetSmartPrinterMessages** +> List iOTGetSmartPrinterMessages(idDevice, id) + +Retrieve all SmartPrinterMessage + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = IOTApi(); +final idDevice = idDevice_example; // String | +final id = 56; // int | Id of the smart printer message + +try { + final result = api_instance.iOTGetSmartPrinterMessages(idDevice, id); + print(result); +} catch (e) { + print('Exception when calling IOTApi->iOTGetSmartPrinterMessages: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idDevice** | **String**| | + **id** | **int**| Id of the smart printer message | [optional] + +### Return type + +[**List**](SmartPrinterMessage.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) + +# **iOTPostToDBPrinter** +> MultipartFile iOTPostToDBPrinter(idDevice, smartPrinterMessage) + +It's the method to post data from mqtt broker to Database (Thanks Rpi!) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = IOTApi(); +final idDevice = 56; // int | Id of the device to upload to DB +final smartPrinterMessage = [List()]; // List | Content that will be uploaded + +try { + final result = api_instance.iOTPostToDBPrinter(idDevice, smartPrinterMessage); + print(result); +} catch (e) { + print('Exception when calling IOTApi->iOTPostToDBPrinter: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idDevice** | **int**| Id of the device to upload to DB | + **smartPrinterMessage** | [**List**](SmartPrinterMessage.md)| Content that will be uploaded | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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) + +# **iOTPostToDBSmartGarden** +> MultipartFile iOTPostToDBSmartGarden(idDevice, smartGardenMessage) + +It's the method to post data from mqtt broker to Database (Thanks Rpi!) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = IOTApi(); +final idDevice = 56; // int | +final smartGardenMessage = [List()]; // List | + +try { + final result = api_instance.iOTPostToDBSmartGarden(idDevice, smartGardenMessage); + print(result); +} catch (e) { + print('Exception when calling IOTApi->iOTPostToDBSmartGarden: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idDevice** | **int**| | + **smartGardenMessage** | [**List**](SmartGardenMessage.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/LayoutApi.md b/mycore_api_old/doc/LayoutApi.md new file mode 100644 index 0000000..5435092 --- /dev/null +++ b/mycore_api_old/doc/LayoutApi.md @@ -0,0 +1,53 @@ +# mycoreapi.api.LayoutApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**layoutGet**](LayoutApi.md#layoutget) | **GET** /api/layout/panelSection | It's a test ! :) + + +# **layoutGet** +> List layoutGet() + +It's a test ! :) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = LayoutApi(); + +try { + final result = api_instance.layoutGet(); + print(result); +} catch (e) { + print('Exception when calling LayoutApi->layoutGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](PanelSection.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) + diff --git a/mycore_api_old/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md b/mycore_api_old/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md new file mode 100644 index 0000000..97d1289 --- /dev/null +++ b/mycore_api_old/doc/ListResponseOfEventDetailDTOAndEventHomeFilter.md @@ -0,0 +1,18 @@ +# mycoreapi.model.ListResponseOfEventDetailDTOAndEventHomeFilter + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | [**List**](EventDetailDTO.md) | | [optional] [default to const []] +**requestParameters** | [**OneOfEventHomeFilter**](OneOfEventHomeFilter.md) | | [optional] +**totalCount** | **int** | | [optional] +**actualCount** | **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/mycore_api/doc/LocationDTO.md b/mycore_api_old/doc/LocationDTO.md similarity index 100% rename from mycore_api/doc/LocationDTO.md rename to mycore_api_old/doc/LocationDTO.md diff --git a/mycore_api_old/doc/LoginDTO.md b/mycore_api_old/doc/LoginDTO.md new file mode 100644 index 0000000..80fa242 --- /dev/null +++ b/mycore_api_old/doc/LoginDTO.md @@ -0,0 +1,16 @@ +# mycoreapi.model.LoginDTO + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/MQTTApi.md b/mycore_api_old/doc/MQTTApi.md new file mode 100644 index 0000000..0e31849 --- /dev/null +++ b/mycore_api_old/doc/MQTTApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.MQTTApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**mQTTPublishMessage**](MQTTApi.md#mqttpublishmessage) | **POST** /api/mqtt | Publish mqtt test + + +# **mQTTPublishMessage** +> bool mQTTPublishMessage(mqttMessageDTO) + +Publish mqtt test + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = MQTTApi(); +final mqttMessageDTO = MqttMessageDTO(); // MqttMessageDTO | Message to send + +try { + final result = api_instance.mQTTPublishMessage(mqttMessageDTO); + print(result); +} catch (e) { + print('Exception when calling MQTTApi->mQTTPublishMessage: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **mqttMessageDTO** | [**MqttMessageDTO**](MqttMessageDTO.md)| Message to send | + +### Return type + +**bool** + +### 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/mycore_api_old/doc/MeansOfCommunication.md b/mycore_api_old/doc/MeansOfCommunication.md new file mode 100644 index 0000000..6545c1c --- /dev/null +++ b/mycore_api_old/doc/MeansOfCommunication.md @@ -0,0 +1,14 @@ +# mycoreapi.model.MeansOfCommunication + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/MqttMessageDTO.md b/mycore_api_old/doc/MqttMessageDTO.md new file mode 100644 index 0000000..14e4475 --- /dev/null +++ b/mycore_api_old/doc/MqttMessageDTO.md @@ -0,0 +1,17 @@ +# mycoreapi.model.MqttMessageDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topic** | **String** | | [optional] +**message** | **String** | | [optional] +**online** | **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/mycore_api_old/doc/OddApi.md b/mycore_api_old/doc/OddApi.md new file mode 100644 index 0000000..f30b595 --- /dev/null +++ b/mycore_api_old/doc/OddApi.md @@ -0,0 +1,103 @@ +# mycoreapi.api.OddApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**oddGetAll**](OddApi.md#oddgetall) | **GET** /api/odd/{oddRequest} | Get odds for one country and one odd value maximum +[**oddGetForCountry**](OddApi.md#oddgetforcountry) | **GET** /api/odd/country/{id}/{oddRequest} | Get odds for one country and one odd value maximum + + +# **oddGetAll** +> List oddGetAll(oddRequest) + +Get odds for one country and one odd value maximum + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = OddApi(); +final oddRequest = 1.2; // double | Odd Maximum value + +try { + final result = api_instance.oddGetAll(oddRequest); + print(result); +} catch (e) { + print('Exception when calling OddApi->oddGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oddRequest** | **double**| Odd Maximum value | + +### Return type + +[**List**](OddNice.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) + +# **oddGetForCountry** +> List oddGetForCountry(id, oddRequest) + +Get odds for one country and one odd value maximum + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = OddApi(); +final id = id_example; // String | id of country, e.g = BE for Belgium +final oddRequest = 1.2; // double | Odd Maximum value + +try { + final result = api_instance.oddGetForCountry(id, oddRequest); + print(result); +} catch (e) { + print('Exception when calling OddApi->oddGetForCountry: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| id of country, e.g = BE for Belgium | + **oddRequest** | **double**| Odd Maximum value | + +### Return type + +[**List**](OddNice.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) + diff --git a/mycore_api/doc/OddH2H.md b/mycore_api_old/doc/OddH2H.md similarity index 100% rename from mycore_api/doc/OddH2H.md rename to mycore_api_old/doc/OddH2H.md diff --git a/mycore_api_old/doc/OddNice.md b/mycore_api_old/doc/OddNice.md new file mode 100644 index 0000000..de75aaa --- /dev/null +++ b/mycore_api_old/doc/OddNice.md @@ -0,0 +1,18 @@ +# mycoreapi.model.OddNice + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**teams** | **List** | | [optional] [default to const []] +**commenceTime** | **int** | | [optional] +**homeTeam** | **String** | | [optional] +**odds** | [**OneOfOddObject**](OneOfOddObject.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/mycore_api_old/doc/OddObject.md b/mycore_api_old/doc/OddObject.md new file mode 100644 index 0000000..5204f6b --- /dev/null +++ b/mycore_api_old/doc/OddObject.md @@ -0,0 +1,17 @@ +# mycoreapi.model.OddObject + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**homeOdd** | **double** | | [optional] +**drawOdd** | **double** | | [optional] +**visitOdd** | **double** | | [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/mycore_api_old/doc/PanelMenuItem.md b/mycore_api_old/doc/PanelMenuItem.md new file mode 100644 index 0000000..62ec649 --- /dev/null +++ b/mycore_api_old/doc/PanelMenuItem.md @@ -0,0 +1,21 @@ +# mycoreapi.model.PanelMenuItem + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **String** | | [optional] +**route** | **String** | | [optional] +**icon** | **String** | | [optional] +**color** | **String** | | [optional] +**badgeValue** | **int** | | [optional] +**badgeType** | **String** | | [optional] +**children** | [**List**](PanelMenuItem.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/mycore_api_old/doc/PanelSection.md b/mycore_api_old/doc/PanelSection.md new file mode 100644 index 0000000..fa22d45 --- /dev/null +++ b/mycore_api_old/doc/PanelSection.md @@ -0,0 +1,19 @@ +# mycoreapi.model.PanelSection + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **String** | | [optional] +**icon** | **String** | | [optional] +**color** | **String** | | [optional] +**defaultRoute** | **String** | | [optional] +**children** | [**List**](PanelMenuItem.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/mycore_api/doc/PlaceDTO.md b/mycore_api_old/doc/PlaceDTO.md similarity index 100% rename from mycore_api/doc/PlaceDTO.md rename to mycore_api_old/doc/PlaceDTO.md diff --git a/mycore_api_old/doc/ProgrammedMode.md b/mycore_api_old/doc/ProgrammedMode.md new file mode 100644 index 0000000..e3fd09b --- /dev/null +++ b/mycore_api_old/doc/ProgrammedMode.md @@ -0,0 +1,21 @@ +# mycoreapi.model.ProgrammedMode + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**tuesday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**wednesday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**thursday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**friday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**saturday** | [**List**](TimePeriodAlarm.md) | | [optional] [default to const []] +**sunday** | [**List**](TimePeriodAlarm.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/mycore_api/doc/Provider.md b/mycore_api_old/doc/Provider.md similarity index 100% rename from mycore_api/doc/Provider.md rename to mycore_api_old/doc/Provider.md diff --git a/mycore_api_old/doc/ProviderApi.md b/mycore_api_old/doc/ProviderApi.md new file mode 100644 index 0000000..e9716f1 --- /dev/null +++ b/mycore_api_old/doc/ProviderApi.md @@ -0,0 +1,189 @@ +# mycoreapi.api.ProviderApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**providerCreate**](ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider +[**providerDelete**](ProviderApi.md#providerdelete) | **DELETE** /api/provider/{providerId} | Delete a provider +[**providerGetAll**](ProviderApi.md#providergetall) | **GET** /api/provider/{homeId} | Get all home providers +[**providerUpdate**](ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider + + +# **providerCreate** +> ProviderDTO providerCreate(providerDTO) + +Create a provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final providerDTO = ProviderDTO(); // ProviderDTO | Provider to create + +try { + final result = api_instance.providerCreate(providerDTO); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **providerDTO** | [**ProviderDTO**](ProviderDTO.md)| Provider to create | + +### Return type + +[**ProviderDTO**](ProviderDTO.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) + +# **providerDelete** +> String providerDelete(providerId) + +Delete a provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final providerId = providerId_example; // String | Id of provider to delete + +try { + final result = api_instance.providerDelete(providerId); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **providerId** | **String**| Id of provider to delete | + +### 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) + +# **providerGetAll** +> List providerGetAll(homeId) + +Get all home providers + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.providerGetAll(homeId); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](ProviderDTO.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) + +# **providerUpdate** +> DeviceDetailDTO providerUpdate(providerDTO) + +Update a provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final providerDTO = ProviderDTO(); // ProviderDTO | Provider to update + +try { + final result = api_instance.providerUpdate(providerDTO); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **providerDTO** | [**ProviderDTO**](ProviderDTO.md)| Provider to update | + +### 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) + diff --git a/mycore_api_old/doc/ProviderDTO.md b/mycore_api_old/doc/ProviderDTO.md new file mode 100644 index 0000000..fe1e9cf --- /dev/null +++ b/mycore_api_old/doc/ProviderDTO.md @@ -0,0 +1,23 @@ +# mycoreapi.model.ProviderDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | [**ProviderType**](ProviderType.md) | | [optional] +**homeId** | **String** | | [optional] +**endpoint** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] +**apiKey** | **String** | | [optional] +**active** | **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/mycore_api_old/doc/ProviderType.md b/mycore_api_old/doc/ProviderType.md new file mode 100644 index 0000000..2c1cccb --- /dev/null +++ b/mycore_api_old/doc/ProviderType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ProviderType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/RoomApi.md b/mycore_api_old/doc/RoomApi.md new file mode 100644 index 0000000..ad72908 --- /dev/null +++ b/mycore_api_old/doc/RoomApi.md @@ -0,0 +1,413 @@ +# mycoreapi.api.RoomApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**roomAddDeviceToRoom**](RoomApi.md#roomadddevicetoroom) | **PUT** /api/room/{roomId} | Add devices in the specified room +[**roomCreate**](RoomApi.md#roomcreate) | **POST** /api/room | Create a room +[**roomDelete**](RoomApi.md#roomdelete) | **DELETE** /api/room/{roomId} | Delete a room +[**roomDelete2**](RoomApi.md#roomdelete2) | **DELETE** /api/room/{roomId}/device/{deviceId} | Delete device from a room +[**roomDeleteAllForHome**](RoomApi.md#roomdeleteallforhome) | **DELETE** /api/room/home/{homeId} | Delete all rooms for a specified home +[**roomGetAll**](RoomApi.md#roomgetall) | **GET** /api/room/{homeId} | Get all rooms for the specified home +[**roomGetAllWithMainDetails**](RoomApi.md#roomgetallwithmaindetails) | **GET** /api/room/{homeId}/details | Get all rooms main details for the specified home +[**roomGetDetail**](RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room +[**roomUpdate**](RoomApi.md#roomupdate) | **PUT** /api/room | Update a room + + +# **roomAddDeviceToRoom** +> RoomDetailDTO roomAddDeviceToRoom(roomId, requestBody) + +Add devices in the specified room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomId = roomId_example; // String | Room Id +final requestBody = [List()]; // List | Device Ids + +try { + final result = api_instance.roomAddDeviceToRoom(roomId, requestBody); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomAddDeviceToRoom: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomId** | **String**| Room Id | + **requestBody** | [**List**](String.md)| Device Ids | + +### Return type + +[**RoomDetailDTO**](RoomDetailDTO.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) + +# **roomCreate** +> RoomDetailDTO roomCreate(roomCreateOrUpdateDetailDTO) + +Create a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | Room to create + +try { + final result = api_instance.roomCreate(roomCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomCreateOrUpdateDetailDTO** | [**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.md)| Room to create | + +### Return type + +[**RoomDetailDTO**](RoomDetailDTO.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) + +# **roomDelete** +> String roomDelete(roomId) + +Delete a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomId = roomId_example; // String | Id of room + +try { + final result = api_instance.roomDelete(roomId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomId** | **String**| Id of room | + +### 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) + +# **roomDelete2** +> String roomDelete2(deviceId, roomId) + +Delete device from a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final deviceId = deviceId_example; // String | Id of device to delete from the room +final roomId = roomId_example; // String | Id of room + +try { + final result = api_instance.roomDelete2(deviceId, roomId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomDelete2: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Id of device to delete from the room | + **roomId** | **String**| Id of room | + +### 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) + +# **roomDeleteAllForHome** +> String roomDeleteAllForHome(homeId) + +Delete all rooms for a specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.roomDeleteAllForHome(homeId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomDeleteAllForHome: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### 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) + +# **roomGetAll** +> List roomGetAll(homeId) + +Get all rooms for the specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.roomGetAll(homeId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](RoomSummaryDTO.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) + +# **roomGetAllWithMainDetails** +> List roomGetAllWithMainDetails(homeId) + +Get all rooms main details for the specified home + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final homeId = homeId_example; // String | Home Id + +try { + final result = api_instance.roomGetAllWithMainDetails(homeId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomGetAllWithMainDetails: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **homeId** | **String**| Home Id | + +### Return type + +[**List**](RoomMainDetailDTO.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) + +# **roomGetDetail** +> RoomDetailDTO roomGetDetail(roomId) + +Get detail info of a specified room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomId = roomId_example; // String | room id + +try { + final result = api_instance.roomGetDetail(roomId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomId** | **String**| room id | + +### Return type + +[**RoomDetailDTO**](RoomDetailDTO.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) + +# **roomUpdate** +> RoomCreateOrUpdateDetailDTO roomUpdate(roomCreateOrUpdateDetailDTO) + +Update a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | room to update + +try { + final result = api_instance.roomUpdate(roomCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomCreateOrUpdateDetailDTO** | [**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.md)| room to update | + +### Return type + +[**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.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/mycore_api_old/doc/RoomCreateOrUpdateDetailDTO.md b/mycore_api_old/doc/RoomCreateOrUpdateDetailDTO.md new file mode 100644 index 0000000..afd96b0 --- /dev/null +++ b/mycore_api_old/doc/RoomCreateOrUpdateDetailDTO.md @@ -0,0 +1,18 @@ +# mycoreapi.model.RoomCreateOrUpdateDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**deviceIds** | **List** | | [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/mycore_api_old/doc/RoomDetailDTO.md b/mycore_api_old/doc/RoomDetailDTO.md new file mode 100644 index 0000000..84d671a --- /dev/null +++ b/mycore_api_old/doc/RoomDetailDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.RoomDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devices** | [**List**](DeviceDetailDTO.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/mycore_api_old/doc/RoomMainDetailDTO.md b/mycore_api_old/doc/RoomMainDetailDTO.md new file mode 100644 index 0000000..7a28efe --- /dev/null +++ b/mycore_api_old/doc/RoomMainDetailDTO.md @@ -0,0 +1,29 @@ +# mycoreapi.model.RoomMainDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**isTemperature** | **bool** | | [optional] +**temperature** | **String** | | [optional] +**isHumidity** | **bool** | | [optional] +**humidity** | **String** | | [optional] +**isMotion** | **bool** | | [optional] +**motion** | **bool** | | [optional] +**isDoor** | **bool** | | [optional] +**door** | **bool** | | [optional] +**environmentalDevices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] +**securityDevices** | [**List**](DeviceDetailDTO.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/mycore_api_old/doc/RoomMainDetailDTOAllOf.md b/mycore_api_old/doc/RoomMainDetailDTOAllOf.md new file mode 100644 index 0000000..8dc495c --- /dev/null +++ b/mycore_api_old/doc/RoomMainDetailDTOAllOf.md @@ -0,0 +1,26 @@ +# mycoreapi.model.RoomMainDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**isTemperature** | **bool** | | [optional] +**temperature** | **String** | | [optional] +**isHumidity** | **bool** | | [optional] +**humidity** | **String** | | [optional] +**isMotion** | **bool** | | [optional] +**motion** | **bool** | | [optional] +**isDoor** | **bool** | | [optional] +**door** | **bool** | | [optional] +**environmentalDevices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] +**securityDevices** | [**List**](DeviceDetailDTO.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/mycore_api_old/doc/RoomSummaryDTO.md b/mycore_api_old/doc/RoomSummaryDTO.md new file mode 100644 index 0000000..d80c8f9 --- /dev/null +++ b/mycore_api_old/doc/RoomSummaryDTO.md @@ -0,0 +1,17 @@ +# mycoreapi.model.RoomSummaryDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**homeId** | **String** | | [optional] +**name** | **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/mycore_api/doc/ScreenConfiguration.md b/mycore_api_old/doc/ScreenConfiguration.md similarity index 100% rename from mycore_api/doc/ScreenConfiguration.md rename to mycore_api_old/doc/ScreenConfiguration.md diff --git a/mycore_api_old/doc/ScreenDevice.md b/mycore_api_old/doc/ScreenDevice.md new file mode 100644 index 0000000..d512606 --- /dev/null +++ b/mycore_api_old/doc/ScreenDevice.md @@ -0,0 +1,21 @@ +# mycoreapi.model.ScreenDevice + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**location** | **String** | | [optional] +**locationExplanation** | **String** | | [optional] +**height** | **int** | | [optional] +**width** | **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/mycore_api_old/doc/ScreenDeviceApi.md b/mycore_api_old/doc/ScreenDeviceApi.md new file mode 100644 index 0000000..314565c --- /dev/null +++ b/mycore_api_old/doc/ScreenDeviceApi.md @@ -0,0 +1,229 @@ +# mycoreapi.api.ScreenDeviceApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**screenDeviceCreateDevice**](ScreenDeviceApi.md#screendevicecreatedevice) | **POST** /api/device/screen | Create screen device +[**screenDeviceDeleteDevice**](ScreenDeviceApi.md#screendevicedeletedevice) | **DELETE** /api/device/screen/{deviceId} | Delete device +[**screenDeviceGetAllScreenDevices**](ScreenDeviceApi.md#screendevicegetallscreendevices) | **GET** /api/device/screen | Get all screen devices +[**screenDeviceGetDeviceInfo**](ScreenDeviceApi.md#screendevicegetdeviceinfo) | **GET** /api/device/screen/{screenDeviceId} | Get screen device info +[**screenDeviceUpdateDevice**](ScreenDeviceApi.md#screendeviceupdatedevice) | **PUT** /api/device/screen | Update screen device + + +# **screenDeviceCreateDevice** +> ScreenDevice screenDeviceCreateDevice(screenDevice) + +Create screen device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final screenDevice = ScreenDevice(); // ScreenDevice | Screen device to create + +try { + final result = api_instance.screenDeviceCreateDevice(screenDevice); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceCreateDevice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenDevice** | [**ScreenDevice**](ScreenDevice.md)| Screen device to create | + +### Return type + +[**ScreenDevice**](ScreenDevice.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) + +# **screenDeviceDeleteDevice** +> String screenDeviceDeleteDevice(deviceId) + +Delete device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final deviceId = deviceId_example; // String | Screen device id to update + +try { + final result = api_instance.screenDeviceDeleteDevice(deviceId); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceDeleteDevice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Screen device id to update | + +### 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) + +# **screenDeviceGetAllScreenDevices** +> List screenDeviceGetAllScreenDevices() + +Get all screen devices + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); + +try { + final result = api_instance.screenDeviceGetAllScreenDevices(); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceGetAllScreenDevices: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](ScreenDevice.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) + +# **screenDeviceGetDeviceInfo** +> ScreenDevice screenDeviceGetDeviceInfo(screenDeviceId) + +Get screen device info + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final screenDeviceId = screenDeviceId_example; // String | Id of the screen device you want to get information + +try { + final result = api_instance.screenDeviceGetDeviceInfo(screenDeviceId); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceGetDeviceInfo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenDeviceId** | **String**| Id of the screen device you want to get information | + +### Return type + +[**ScreenDevice**](ScreenDevice.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) + +# **screenDeviceUpdateDevice** +> ScreenDevice screenDeviceUpdateDevice(screenDevice) + +Update screen device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final screenDevice = ScreenDevice(); // ScreenDevice | Screen device to update + +try { + final result = api_instance.screenDeviceUpdateDevice(screenDevice); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceUpdateDevice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenDevice** | [**ScreenDevice**](ScreenDevice.md)| Screen device to update | + +### Return type + +[**ScreenDevice**](ScreenDevice.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/mycore_api/doc/ScreenWidget.md b/mycore_api_old/doc/ScreenWidget.md similarity index 100% rename from mycore_api/doc/ScreenWidget.md rename to mycore_api_old/doc/ScreenWidget.md diff --git a/mycore_api_old/doc/SmartGardenMessage.md b/mycore_api_old/doc/SmartGardenMessage.md new file mode 100644 index 0000000..5e42dc5 --- /dev/null +++ b/mycore_api_old/doc/SmartGardenMessage.md @@ -0,0 +1,22 @@ +# mycoreapi.model.SmartGardenMessage + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**type** | **String** | | [optional] +**time** | **String** | | [optional] +**temperature** | **double** | | [optional] +**pressure** | **double** | | [optional] +**humidity** | **double** | | [optional] +**water** | **int** | | [optional] +**light** | **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/mycore_api_old/doc/SmartPrinterMessage.md b/mycore_api_old/doc/SmartPrinterMessage.md new file mode 100644 index 0000000..cff4fae --- /dev/null +++ b/mycore_api_old/doc/SmartPrinterMessage.md @@ -0,0 +1,20 @@ +# mycoreapi.model.SmartPrinterMessage + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**type** | **String** | | [optional] +**time** | **String** | | [optional] +**temperature** | **double** | | [optional] +**pressure** | **double** | | [optional] +**smoke** | **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/mycore_api/doc/State.md b/mycore_api_old/doc/State.md similarity index 100% rename from mycore_api/doc/State.md rename to mycore_api_old/doc/State.md diff --git a/mycore_api_old/doc/TimePeriodAlarm.md b/mycore_api_old/doc/TimePeriodAlarm.md new file mode 100644 index 0000000..88eb586 --- /dev/null +++ b/mycore_api_old/doc/TimePeriodAlarm.md @@ -0,0 +1,17 @@ +# mycoreapi.model.TimePeriodAlarm + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **String** | | [optional] +**end** | **String** | | [optional] +**alarmMode** | [**OneOfAlarmMode**](OneOfAlarmMode.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/mycore_api_old/doc/TokenApi.md b/mycore_api_old/doc/TokenApi.md new file mode 100644 index 0000000..9c8a82c --- /dev/null +++ b/mycore_api_old/doc/TokenApi.md @@ -0,0 +1,101 @@ +# mycoreapi.api.TokenApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tokenConnectUser**](TokenApi.md#tokenconnectuser) | **POST** /api/token | Connect user +[**tokenCreate**](TokenApi.md#tokencreate) | **POST** /token | + + +# **tokenConnectUser** +> UserInfo tokenConnectUser(loginDTO) + +Connect user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = TokenApi(); +final loginDTO = LoginDTO(); // LoginDTO | login info + +try { + final result = api_instance.tokenConnectUser(loginDTO); + print(result); +} catch (e) { + print('Exception when calling TokenApi->tokenConnectUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loginDTO** | [**LoginDTO**](LoginDTO.md)| login info | + +### Return type + +[**UserInfo**](UserInfo.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) + +# **tokenCreate** +> MultipartFile tokenCreate(user) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = TokenApi(); +final user = User(); // User | + +try { + final result = api_instance.tokenCreate(user); + print(result); +} catch (e) { + print('Exception when calling TokenApi->tokenCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/TokenDTO.md b/mycore_api_old/doc/TokenDTO.md new file mode 100644 index 0000000..be926b3 --- /dev/null +++ b/mycore_api_old/doc/TokenDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.TokenDTO + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/Trigger.md b/mycore_api_old/doc/Trigger.md new file mode 100644 index 0000000..1ab8cb4 --- /dev/null +++ b/mycore_api_old/doc/Trigger.md @@ -0,0 +1,19 @@ +# mycoreapi.model.Trigger + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**providerId** | **String** | | [optional] +**deviceId** | **String** | | [optional] +**stateName** | **String** | | [optional] +**stateValue** | **String** | | [optional] +**type** | [**TriggerType**](TriggerType.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/mycore_api_old/doc/TriggerType.md b/mycore_api_old/doc/TriggerType.md new file mode 100644 index 0000000..6d73e21 --- /dev/null +++ b/mycore_api_old/doc/TriggerType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.TriggerType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api_old/doc/TwitterApi.md b/mycore_api_old/doc/TwitterApi.md new file mode 100644 index 0000000..11050d6 --- /dev/null +++ b/mycore_api_old/doc/TwitterApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.TwitterApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**twitterCreate**](TwitterApi.md#twittercreate) | **POST** /twitter | + + +# **twitterCreate** +> MultipartFile twitterCreate(twitterAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = TwitterApi(); +final twitterAuthModel = TwitterAuthModel(); // TwitterAuthModel | + +try { + final result = api_instance.twitterCreate(twitterAuthModel); + print(result); +} catch (e) { + print('Exception when calling TwitterApi->twitterCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **twitterAuthModel** | [**TwitterAuthModel**](TwitterAuthModel.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[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/mycore_api_old/doc/TwitterAuthModel.md b/mycore_api_old/doc/TwitterAuthModel.md new file mode 100644 index 0000000..3f56c06 --- /dev/null +++ b/mycore_api_old/doc/TwitterAuthModel.md @@ -0,0 +1,15 @@ +# mycoreapi.model.TwitterAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiKey** | **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/mycore_api_old/doc/User.md b/mycore_api_old/doc/User.md new file mode 100644 index 0000000..6ee02f4 --- /dev/null +++ b/mycore_api_old/doc/User.md @@ -0,0 +1,16 @@ +# mycoreapi.model.User + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **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/mycore_api_old/doc/UserApi.md b/mycore_api_old/doc/UserApi.md new file mode 100644 index 0000000..89f2c7a --- /dev/null +++ b/mycore_api_old/doc/UserApi.md @@ -0,0 +1,273 @@ +# mycoreapi.api.UserApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**userCreateUser**](UserApi.md#usercreateuser) | **POST** /api/user | Create an user +[**userDeleteUser**](UserApi.md#userdeleteuser) | **DELETE** /api/user/{id} | Delete an user +[**userGet**](UserApi.md#userget) | **GET** /api/user/{id} | Get a specific user +[**userGetAll**](UserApi.md#usergetall) | **GET** /api/user | Get a list of user +[**userGetByEmail**](UserApi.md#usergetbyemail) | **GET** /api/user/email/{email} | Get a specific user by email +[**userUpdateUser**](UserApi.md#userupdateuser) | **PUT** /api/user | Update an user + + +# **userCreateUser** +> UserInfoDetailDTO userCreateUser(userInfo) + +Create an user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final userInfo = UserInfo(); // UserInfo | New user info + +try { + final result = api_instance.userCreateUser(userInfo); + print(result); +} catch (e) { + print('Exception when calling UserApi->userCreateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userInfo** | [**UserInfo**](UserInfo.md)| New user info | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.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) + +Delete an user + +### Example +```dart +import 'package:mycoreapi/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 | Id of user to delete + +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**| Id of user to delete | + +### 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** +> UserInfoDetailDTO userGet(id) + +Get a specific user + +### Example +```dart +import 'package:mycoreapi/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 | id user + +try { + final result = api_instance.userGet(id); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| id user | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.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) + +# **userGetAll** +> List userGetAll() + +Get a list of user + +### Example +```dart +import 'package:mycoreapi/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.userGetAll(); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGetAll: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](UserInfo.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) + +# **userGetByEmail** +> UserInfoDetailDTO userGetByEmail(email) + +Get a specific user by email + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final email = email_example; // String | user email + +try { + final result = api_instance.userGetByEmail(email); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGetByEmail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **email** | **String**| user email | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.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** +> UserInfoDetailDTO userUpdateUser(userInfo) + +Update an user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final userInfo = UserInfo(); // UserInfo | User to update + +try { + final result = api_instance.userUpdateUser(userInfo); + print(result); +} catch (e) { + print('Exception when calling UserApi->userUpdateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userInfo** | [**UserInfo**](UserInfo.md)| User to update | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.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/mycore_api_old/doc/UserInfo.md b/mycore_api_old/doc/UserInfo.md new file mode 100644 index 0000000..e17644a --- /dev/null +++ b/mycore_api_old/doc/UserInfo.md @@ -0,0 +1,31 @@ +# mycoreapi.model.UserInfo + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**role** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**token** | **String** | | [optional] +**birthday** | [**DateTime**](DateTime.md) | | [optional] +**homeIds** | **List** | | [optional] [default to const []] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**address** | **String** | | [optional] +**city** | **String** | | [optional] +**state** | **String** | | [optional] +**country** | **String** | | [optional] +**language** | **String** | | [optional] +**timeZone** | **String** | | [optional] +**postalCode** | **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/mycore_api_old/doc/UserInfoDetailDTO.md b/mycore_api_old/doc/UserInfoDetailDTO.md new file mode 100644 index 0000000..2f49668 --- /dev/null +++ b/mycore_api_old/doc/UserInfoDetailDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.UserInfoDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**email** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**language** | **String** | | [optional] +**homeIds** | **List** | | [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/mycore_api_old/doc/ValuesApi.md b/mycore_api_old/doc/ValuesApi.md new file mode 100644 index 0000000..416a89c --- /dev/null +++ b/mycore_api_old/doc/ValuesApi.md @@ -0,0 +1,228 @@ +# mycoreapi.api.ValuesApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**valuesDelete**](ValuesApi.md#valuesdelete) | **DELETE** /api/test/{id} | +[**valuesGet**](ValuesApi.md#valuesget) | **GET** /api/test/{id} | +[**valuesGetAll**](ValuesApi.md#valuesgetall) | **GET** /api/test | It's a test ! :) +[**valuesPost**](ValuesApi.md#valuespost) | **POST** /api/test | +[**valuesPut**](ValuesApi.md#valuesput) | **PUT** /api/test/{id} | + + +# **valuesDelete** +> valuesDelete(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final id = 56; // int | + +try { + api_instance.valuesDelete(id); +} catch (e) { + print('Exception when calling ValuesApi->valuesDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **valuesGet** +> String valuesGet(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final id = 56; // int | + +try { + final result = api_instance.valuesGet(id); + print(result); +} catch (e) { + print('Exception when calling ValuesApi->valuesGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + +### 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) + +# **valuesGetAll** +> List valuesGetAll() + +It's a test ! :) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); + +try { + final result = api_instance.valuesGetAll(); + print(result); +} catch (e) { + print('Exception when calling ValuesApi->valuesGetAll: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**List** + +### 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) + +# **valuesPost** +> valuesPost(body) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final body = String(); // String | + +try { + api_instance.valuesPost(body); +} catch (e) { + print('Exception when calling ValuesApi->valuesPost: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + +# **valuesPut** +> valuesPut(id, body) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final id = 56; // int | +final body = String(); // String | + +try { + api_instance.valuesPut(id, body); +} catch (e) { + print('Exception when calling ValuesApi->valuesPut: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | **String**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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/mycore_api_old/doc/ViewBy.md b/mycore_api_old/doc/ViewBy.md new file mode 100644 index 0000000..a23cd79 --- /dev/null +++ b/mycore_api_old/doc/ViewBy.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ViewBy + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/Widget.md b/mycore_api_old/doc/Widget.md similarity index 100% rename from mycore_api/doc/Widget.md rename to mycore_api_old/doc/Widget.md diff --git a/mycore_api_old/git_push.sh b/mycore_api_old/git_push.sh new file mode 100644 index 0000000..ced3be2 --- /dev/null +++ b/mycore_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/mycore_api_old/lib/api.dart b/mycore_api_old/lib/api.dart new file mode 100644 index 0000000..1665c6c --- /dev/null +++ b/mycore_api_old/lib/api.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 + +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/alarm_api.dart'; +part 'api/authentication_api.dart'; +part 'api/automation_api.dart'; +part 'api/azure_api.dart'; +part 'api/books_api.dart'; +part 'api/device_api.dart'; +part 'api/energy_api.dart'; +part 'api/event_api.dart'; +part 'api/facebook_api.dart'; +part 'api/google_api.dart'; +part 'api/group_api.dart'; +part 'api/home_api.dart'; +part 'api/iot_api.dart'; +part 'api/layout_api.dart'; +part 'api/mqtt_api.dart'; +part 'api/odd_api.dart'; +part 'api/provider_api.dart'; +part 'api/room_api.dart'; +part 'api/screen_device_api.dart'; +part 'api/token_api.dart'; +part 'api/twitter_api.dart'; +part 'api/user_api.dart'; +part 'api/values_api.dart'; + +part 'model/action.dart'; +part 'model/action_type.dart'; +part 'model/alarm_mode.dart'; +part 'model/alarm_mode_create_or_update_detail_dto.dart'; +part 'model/alarm_mode_create_or_update_detail_dto_all_of.dart'; +part 'model/alarm_mode_dto.dart'; +part 'model/alarm_mode_detail_dto.dart'; +part 'model/alarm_mode_detail_dto_all_of.dart'; +part 'model/alarm_triggered.dart'; +part 'model/alarm_type.dart'; +part 'model/automation_dto.dart'; +part 'model/automation_detail_dto.dart'; +part 'model/automation_detail_dto_all_of.dart'; +part 'model/automation_state.dart'; +part 'model/automation_triggered.dart'; +part 'model/azure_ad_auth_model.dart'; +part 'model/book.dart'; +part 'model/condition.dart'; +part 'model/condition_type.dart'; +part 'model/condition_value.dart'; +part 'model/connection_status.dart'; +part 'model/create_or_update_home_dto.dart'; +part 'model/create_or_update_home_dto_all_of.dart'; +part 'model/device_detail_dto.dart'; +part 'model/device_detail_dto_all_of.dart'; +part 'model/device_state.dart'; +part 'model/device_summary_dto.dart'; +part 'model/device_type.dart'; +part 'model/electricity_production.dart'; +part 'model/event_dto.dart'; +part 'model/event_detail_dto.dart'; +part 'model/event_detail_dto_all_of.dart'; +part 'model/event_filter.dart'; +part 'model/event_home_filter.dart'; +part 'model/event_home_filter_all_of.dart'; +part 'model/event_type.dart'; +part 'model/facebook_auth_model.dart'; +part 'model/geolocalized_mode.dart'; +part 'model/google_auth_model.dart'; +part 'model/group_create_or_update_detail_dto.dart'; +part 'model/group_create_or_update_detail_dto_all_of.dart'; +part 'model/group_detail_dto.dart'; +part 'model/group_detail_dto_all_of.dart'; +part 'model/group_summary_dto.dart'; +part 'model/home_dto.dart'; +part 'model/home_detail_dto.dart'; +part 'model/home_detail_dto_all_of.dart'; +part 'model/list_response_of_event_detail_dto_and_event_home_filter.dart'; +part 'model/login_dto.dart'; +part 'model/means_of_communication.dart'; +part 'model/mqtt_message_dto.dart'; +part 'model/odd_nice.dart'; +part 'model/odd_object.dart'; +part 'model/panel_menu_item.dart'; +part 'model/panel_section.dart'; +part 'model/programmed_mode.dart'; +part 'model/provider_dto.dart'; +part 'model/provider_type.dart'; +part 'model/room_create_or_update_detail_dto.dart'; +part 'model/room_detail_dto.dart'; +part 'model/room_main_detail_dto.dart'; +part 'model/room_main_detail_dto_all_of.dart'; +part 'model/room_summary_dto.dart'; +part 'model/screen_device.dart'; +part 'model/smart_garden_message.dart'; +part 'model/smart_printer_message.dart'; +part 'model/time_period_alarm.dart'; +part 'model/token_dto.dart'; +part 'model/trigger.dart'; +part 'model/trigger_type.dart'; +part 'model/twitter_auth_model.dart'; +part 'model/user.dart'; +part 'model/user_info.dart'; +part 'model/user_info_detail_dto.dart'; +part 'model/view_by.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/mycore_api_old/lib/api/alarm_api.dart b/mycore_api_old/lib/api/alarm_api.dart new file mode 100644 index 0000000..d0ddfba --- /dev/null +++ b/mycore_api_old/lib/api/alarm_api.dart @@ -0,0 +1,585 @@ +// +// 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 AlarmApi { + AlarmApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Activate specified alarm mode + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] alarmModeId (required): + /// Alarm mode to activate + Future alarmActivateWithHttpInfo(String alarmModeId) async { + // Verify required params are set. + if (alarmModeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId'); + } + + final path = r'/api/alarm/activate/{alarmModeId}' + .replaceAll('{' + 'alarmModeId' + '}', alarmModeId.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, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Activate specified alarm mode + /// + /// Parameters: + /// + /// * [String] alarmModeId (required): + /// Alarm mode to activate + Future alarmActivate(String alarmModeId) async { + final response = await alarmActivateWithHttpInfo(alarmModeId); + 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); + } + + /// Create an alarm mode + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): + /// Alarm mode to create + Future alarmCreateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (alarmModeCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeCreateOrUpdateDetailDTO'); + } + + final path = r'/api/alarm'; + + Object postBody = alarmModeCreateOrUpdateDetailDTO; + + 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, + ); + } + + /// Create an alarm mode + /// + /// Parameters: + /// + /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): + /// Alarm mode to create + Future alarmCreate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { + final response = await alarmCreateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO); + 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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO; + } + return Future.value(null); + } + + /// Create default alarm modes + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future alarmCreateDefaultAlarmsWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/alarm/defaults/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create default alarm modes + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future alarmCreateDefaultAlarms(String homeId) async { + final response = await alarmCreateDefaultAlarmsWithHttpInfo(homeId); + 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), 'bool') as bool; + } + return Future.value(null); + } + + /// Delete an alarm mode + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] alarmModeId (required): + /// Id of alarm mode to delete + Future alarmDeleteWithHttpInfo(String alarmModeId) async { + // Verify required params are set. + if (alarmModeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId'); + } + + final path = r'/api/alarm/{alarmModeId}' + .replaceAll('{' + 'alarmModeId' + '}', alarmModeId.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, + ); + } + + /// Delete an alarm mode + /// + /// Parameters: + /// + /// * [String] alarmModeId (required): + /// Id of alarm mode to delete + Future alarmDelete(String alarmModeId) async { + final response = await alarmDeleteWithHttpInfo(alarmModeId); + 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); + } + + /// Delete all alarm mode for a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future alarmDeleteAllForHomeWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/alarm/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete all alarm mode for a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future alarmDeleteAllForHome(String homeId) async { + final response = await alarmDeleteAllForHomeWithHttpInfo(homeId); + 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); + } + + /// Get all alarm modes for the specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future alarmGetAllWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/alarm/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all alarm modes for the specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> alarmGetAll(String homeId) async { + final response = await alarmGetAllWithHttpInfo(homeId); + 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); + } + + /// Get detail info of a specified alarm mode + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] alarmModeId (required): + /// alarm id + Future alarmGetDetailWithHttpInfo(String alarmModeId) async { + // Verify required params are set. + if (alarmModeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId'); + } + + final path = r'/api/alarm/detail/{alarmModeId}' + .replaceAll('{' + 'alarmModeId' + '}', alarmModeId.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, + ); + } + + /// Get detail info of a specified alarm mode + /// + /// Parameters: + /// + /// * [String] alarmModeId (required): + /// alarm id + Future alarmGetDetail(String alarmModeId) async { + final response = await alarmGetDetailWithHttpInfo(alarmModeId); + 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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO; + } + return Future.value(null); + } + + /// Update an alarm mode + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): + /// alarm mode to update + Future alarmUpdateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (alarmModeCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeCreateOrUpdateDetailDTO'); + } + + final path = r'/api/alarm'; + + Object postBody = alarmModeCreateOrUpdateDetailDTO; + + 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, + ); + } + + /// Update an alarm mode + /// + /// Parameters: + /// + /// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required): + /// alarm mode to update + Future alarmUpdate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async { + final response = await alarmUpdateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO); + 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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/authentication_api.dart b/mycore_api_old/lib/api/authentication_api.dart new file mode 100644 index 0000000..1a9a13a --- /dev/null +++ b/mycore_api_old/lib/api/authentication_api.dart @@ -0,0 +1,203 @@ +// +// 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; + + /// Authenticate with form parameters (used by Swagger test client) + /// + /// Note: This method returns the HTTP [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, + ); + } + + /// Authenticate with form parameters (used by Swagger test client) + /// + /// 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); + } + + /// Authenticate with Json parameters (used by most clients) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + /// Login DTO + 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, + ); + } + + /// Authenticate with Json parameters (used by most clients) + /// + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + /// Login DTO + 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/mycore_api_old/lib/api/automation_api.dart b/mycore_api_old/lib/api/automation_api.dart new file mode 100644 index 0000000..70fe930 --- /dev/null +++ b/mycore_api_old/lib/api/automation_api.dart @@ -0,0 +1,443 @@ +// +// 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 AutomationApi { + AutomationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create an automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [AutomationDetailDTO] automationDetailDTO (required): + /// Automation to create + Future automationCreateWithHttpInfo(AutomationDetailDTO automationDetailDTO) async { + // Verify required params are set. + if (automationDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationDetailDTO'); + } + + final path = r'/api/automation'; + + Object postBody = automationDetailDTO; + + 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, + ); + } + + /// Create an automation + /// + /// Parameters: + /// + /// * [AutomationDetailDTO] automationDetailDTO (required): + /// Automation to create + Future automationCreate(AutomationDetailDTO automationDetailDTO) async { + final response = await automationCreateWithHttpInfo(automationDetailDTO); + 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), 'AutomationDTO') as AutomationDTO; + } + return Future.value(null); + } + + /// Delete an automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// Id of automation to delete + Future automationDeleteWithHttpInfo(String automationId) async { + // Verify required params are set. + if (automationId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); + } + + final path = r'/api/automation/{automationId}' + .replaceAll('{' + 'automationId' + '}', automationId.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, + ); + } + + /// Delete an automation + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// Id of automation to delete + Future automationDelete(String automationId) async { + final response = await automationDeleteWithHttpInfo(automationId); + 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); + } + + /// Delete all automation for a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future automationDeleteAllForHomeWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/automation/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete all automation for a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future automationDeleteAllForHome(String homeId) async { + final response = await automationDeleteAllForHomeWithHttpInfo(homeId); + 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); + } + + /// Get all automations for the specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future automationGetAllWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/automation/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all automations for the specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> automationGetAll(String homeId) async { + final response = await automationGetAllWithHttpInfo(homeId); + 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); + } + + /// Get detail info of a specified automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// automation id + Future automationGetDetailWithHttpInfo(String automationId) async { + // Verify required params are set. + if (automationId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); + } + + final path = r'/api/automation/detail/{automationId}' + .replaceAll('{' + 'automationId' + '}', automationId.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, + ); + } + + /// Get detail info of a specified automation + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// automation id + Future automationGetDetail(String automationId) async { + final response = await automationGetDetailWithHttpInfo(automationId); + 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), 'AutomationDetailDTO') as AutomationDetailDTO; + } + return Future.value(null); + } + + /// Update an automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [AutomationDetailDTO] automationDetailDTO (required): + /// automation to update + Future automationUpdateWithHttpInfo(AutomationDetailDTO automationDetailDTO) async { + // Verify required params are set. + if (automationDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationDetailDTO'); + } + + final path = r'/api/automation'; + + Object postBody = automationDetailDTO; + + 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, + ); + } + + /// Update an automation + /// + /// Parameters: + /// + /// * [AutomationDetailDTO] automationDetailDTO (required): + /// automation to update + Future automationUpdate(AutomationDetailDTO automationDetailDTO) async { + final response = await automationUpdateWithHttpInfo(automationDetailDTO); + 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), 'AutomationDetailDTO') as AutomationDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/azure_api.dart b/mycore_api_old/lib/api/azure_api.dart new file mode 100644 index 0000000..3e2266a --- /dev/null +++ b/mycore_api_old/lib/api/azure_api.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 AzureApi { + AzureApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /azure' operation and returns the [Response]. + /// Parameters: + /// + /// * [AzureADAuthModel] azureADAuthModel (required): + Future azureCreateWithHttpInfo(AzureADAuthModel azureADAuthModel) async { + // Verify required params are set. + if (azureADAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: azureADAuthModel'); + } + + final path = r'/azure'; + + Object postBody = azureADAuthModel; + + 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: + /// + /// * [AzureADAuthModel] azureADAuthModel (required): + Future azureCreate(AzureADAuthModel azureADAuthModel) async { + final response = await azureCreateWithHttpInfo(azureADAuthModel); + 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); + } +} diff --git a/mycore_api_old/lib/api/books_api.dart b/mycore_api_old/lib/api/books_api.dart new file mode 100644 index 0000000..03998f3 --- /dev/null +++ b/mycore_api_old/lib/api/books_api.dart @@ -0,0 +1,333 @@ +// +// 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 BooksApi { + BooksApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/books' operation and returns the [Response]. + /// Parameters: + /// + /// * [Book] book (required): + Future booksCreateWithHttpInfo(Book book) async { + // Verify required params are set. + if (book == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: book'); + } + + final path = r'/api/books'; + + Object postBody = book; + + 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: + /// + /// * [Book] book (required): + Future booksCreate(Book book) async { + final response = await booksCreateWithHttpInfo(book); + 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), 'Book') as Book; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/books/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future booksDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/books/{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 booksDelete(String id) async { + final response = await booksDeleteWithHttpInfo(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 'GET /api/books/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future booksGetWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/books/{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 booksGet(String id) async { + final response = await booksGetWithHttpInfo(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), 'Book') as Book; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/books' operation and returns the [Response]. + Future booksGetAllWithHttpInfo() async { + final path = r'/api/books'; + + 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> booksGetAll() async { + final response = await booksGetAllWithHttpInfo(); + 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 'PUT /api/books/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + /// + /// * [Book] book (required): + Future booksUpdateWithHttpInfo(String id, Book book) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + if (book == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: book'); + } + + final path = r'/api/books/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody = book; + + 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: + /// + /// * [String] id (required): + /// + /// * [Book] book (required): + Future booksUpdate(String id, Book book) async { + final response = await booksUpdateWithHttpInfo(id, book); + 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); + } +} diff --git a/mycore_api_old/lib/api/device_api.dart b/mycore_api_old/lib/api/device_api.dart new file mode 100644 index 0000000..553d786 --- /dev/null +++ b/mycore_api_old/lib/api/device_api.dart @@ -0,0 +1,924 @@ +// +// 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; + + /// Create a device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to create + 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, + ); + } + + /// Create a device + /// + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to create + 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); + } + + /// Create devices from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceCreateDevicesFromProviderWithHttpInfo(String homeId, String providerId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/device/{homeId}/fromProvider/{providerId}' + .replaceAll('{' + 'homeId' + '}', homeId.toString()) + .replaceAll('{' + 'providerId' + '}', providerId.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, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create devices from provider + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future> deviceCreateDevicesFromProvider(String homeId, String providerId) async { + final response = await deviceCreateDevicesFromProviderWithHttpInfo(homeId, providerId); + 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); + } + + /// Delete a device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete + Future deviceDeleteWithHttpInfo(String deviceId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + + final path = r'/api/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.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, + ); + } + + /// Delete a device + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete + Future deviceDelete(String deviceId) async { + final response = await deviceDeleteWithHttpInfo(deviceId); + 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); + } + + /// Delete all device for a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Id of home + Future deviceDeleteAllForHomeWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/device/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete all device for a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Id of home + Future deviceDeleteAllForHome(String homeId) async { + final response = await deviceDeleteAllForHomeWithHttpInfo(homeId); + 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); + } + + /// Delete devices from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceDeleteDevicesFromProviderWithHttpInfo(String homeId, String providerId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/device/{homeId}/fromProvider/{providerId}' + .replaceAll('{' + 'homeId' + '}', homeId.toString()) + .replaceAll('{' + 'providerId' + '}', providerId.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, + ); + } + + /// Delete devices from provider + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceDeleteDevicesFromProvider(String homeId, String providerId) async { + final response = await deviceDeleteDevicesFromProviderWithHttpInfo(homeId, providerId); + 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); + } + + /// Get all devices summary + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future deviceGetAllWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/device/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all devices summary + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> deviceGetAll(String homeId) async { + final response = await deviceGetAllWithHttpInfo(homeId); + 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); + } + + /// Get a specific device info + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// id of device + Future deviceGetDetailWithHttpInfo(String deviceId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + + final path = r'/api/device/detail/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.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, + ); + } + + /// Get a specific device info + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// id of device + Future deviceGetDetail(String deviceId) async { + final response = await deviceGetDetailWithHttpInfo(deviceId); + 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); + } + + /// Get list of devices from a type + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [DeviceType] type (required): + /// device type + Future deviceGetDevicesByTypeWithHttpInfo(String homeId, DeviceType type) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + if (type == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: type'); + } + + final path = r'/api/device/{homeId}/type/{type}' + .replaceAll('{' + 'homeId' + '}', homeId.toString()) + .replaceAll('{' + 'type' + '}', type.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, + ); + } + + /// Get list of devices from a type + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [DeviceType] type (required): + /// device type + Future> deviceGetDevicesByType(String homeId, DeviceType type) async { + final response = await deviceGetDevicesByTypeWithHttpInfo(homeId, 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), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get devices from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceGetDevicesFromProviderWithHttpInfo(String homeId, String providerId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/device/{homeId}/fromProvider/{providerId}' + .replaceAll('{' + 'homeId' + '}', homeId.toString()) + .replaceAll('{' + 'providerId' + '}', providerId.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, + ); + } + + /// Get devices from provider + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future> deviceGetDevicesFromProvider(String homeId, String providerId) async { + final response = await deviceGetDevicesFromProviderWithHttpInfo(homeId, providerId); + 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); + } + + /// Get all zigbee2Mqtt devices + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future deviceGetDevicesFromZigbee2MqttWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/device/zigbee2Mqtt/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all zigbee2Mqtt devices + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> deviceGetDevicesFromZigbee2Mqtt(String homeId) async { + final response = await deviceGetDevicesFromZigbee2MqttWithHttpInfo(homeId); + 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); + } + + /// Send action to device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [Action] action (required): + /// Action to sent + Future deviceSendActionWithHttpInfo(Action action) async { + // Verify required params are set. + if (action == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: action'); + } + + final path = r'/api/device/action'; + + Object postBody = action; + + 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, + ); + } + + /// Send action to device + /// + /// Parameters: + /// + /// * [Action] action (required): + /// Action to sent + Future deviceSendAction(Action action) async { + final response = await deviceSendActionWithHttpInfo(action); + 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); + } + + /// Update a device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to update + Future deviceUpdateWithHttpInfo(String deviceId, DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + + 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, + ); + } + + /// Update a device + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to update + Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceUpdateWithHttpInfo(deviceId, 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); + } +} diff --git a/mycore_api_old/lib/api/energy_api.dart b/mycore_api_old/lib/api/energy_api.dart new file mode 100644 index 0000000..431e6d2 --- /dev/null +++ b/mycore_api_old/lib/api/energy_api.dart @@ -0,0 +1,95 @@ +// +// 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 EnergyApi { + EnergyApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Get summary production of Kwh/Year + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId: + /// + /// * [ViewBy] viewBy: + Future energyGetElectricityProductionWithHttpInfo({ String homeId, ViewBy viewBy }) async { + // Verify required params are set. + + final path = r'/api/energy/electricity'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (homeId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'homeId', homeId)); + } + if (viewBy != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'viewBy', viewBy)); + } + + 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, + ); + } + + /// Get summary production of Kwh/Year + /// + /// Parameters: + /// + /// * [String] homeId: + /// + /// * [ViewBy] viewBy: + Future> energyGetElectricityProduction({ String homeId, ViewBy viewBy }) async { + final response = await energyGetElectricityProductionWithHttpInfo( homeId: homeId, viewBy: viewBy ); + 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); + } +} diff --git a/mycore_api_old/lib/api/event_api.dart b/mycore_api_old/lib/api/event_api.dart new file mode 100644 index 0000000..236c4d1 --- /dev/null +++ b/mycore_api_old/lib/api/event_api.dart @@ -0,0 +1,358 @@ +// +// 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 EventApi { + EventApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Delete an event + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] eventId (required): + /// Id of event to delete + Future eventDeleteWithHttpInfo(String eventId) async { + // Verify required params are set. + if (eventId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: eventId'); + } + + final path = r'/api/event/{eventId}' + .replaceAll('{' + 'eventId' + '}', eventId.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, + ); + } + + /// Delete an event + /// + /// Parameters: + /// + /// * [String] eventId (required): + /// Id of event to delete + Future eventDelete(String eventId) async { + final response = await eventDeleteWithHttpInfo(eventId); + 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); + } + + /// Delete all events for a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future eventDeleteAllForHomeWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/event/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete all events for a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future eventDeleteAllForHome(String homeId) async { + final response = await eventDeleteAllForHomeWithHttpInfo(homeId); + 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); + } + + /// Get events for the specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] deviceId: + /// + /// * [String] roomId: + /// + /// * [int] startIndex: + /// + /// * [int] count: + /// + /// * [DateTime] dateStart: + /// + /// * [DateTime] dateEnd: + /// + /// * [OneOfEventType] eventType: + /// + /// * [OneOfDeviceType] deviceType: + Future eventGetWithHttpInfo(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventType eventType, DeviceType deviceType }) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/event/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (deviceId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'DeviceId', deviceId)); + } + if (roomId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'RoomId', roomId)); + } + if (startIndex != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'StartIndex', startIndex)); + } + if (count != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'Count', count)); + } + if (dateStart != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'DateStart', dateStart)); + } + if (dateEnd != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'DateEnd', dateEnd)); + } + if (eventType != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'EventType', eventType)); + } + if (deviceType != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'DeviceType', deviceType)); + } + + 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, + ); + } + + /// Get events for the specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + /// + /// * [String] deviceId: + /// + /// * [String] roomId: + /// + /// * [int] startIndex: + /// + /// * [int] count: + /// + /// * [DateTime] dateStart: + /// + /// * [DateTime] dateEnd: + /// + /// * [OneOfEventType] eventType: + /// + /// * [OneOfDeviceType] deviceType: + Future eventGet(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventType eventType, DeviceType deviceType }) async { + final response = await eventGetWithHttpInfo(homeId, deviceId: deviceId, roomId: roomId, startIndex: startIndex, count: count, dateStart: dateStart, dateEnd: dateEnd, eventType: eventType, deviceType: deviceType ); + 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), 'ListResponseOfEventDetailDTOAndEventHomeFilter') as ListResponseOfEventDetailDTOAndEventHomeFilter; + } + return Future.value(null); + } + + /// Get detail info of a specified event + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] eventId (required): + /// event id + Future eventGetDetailWithHttpInfo(String eventId) async { + // Verify required params are set. + if (eventId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: eventId'); + } + + final path = r'/api/event/detail/{eventId}' + .replaceAll('{' + 'eventId' + '}', eventId.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, + ); + } + + /// Get detail info of a specified event + /// + /// Parameters: + /// + /// * [String] eventId (required): + /// event id + Future eventGetDetail(String eventId) async { + final response = await eventGetDetailWithHttpInfo(eventId); + 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), 'EventDetailDTO') as EventDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/facebook_api.dart b/mycore_api_old/lib/api/facebook_api.dart new file mode 100644 index 0000000..d98657b --- /dev/null +++ b/mycore_api_old/lib/api/facebook_api.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 FacebookApi { + FacebookApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /facebook' operation and returns the [Response]. + /// Parameters: + /// + /// * [FacebookAuthModel] facebookAuthModel (required): + Future facebookCreateWithHttpInfo(FacebookAuthModel facebookAuthModel) async { + // Verify required params are set. + if (facebookAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: facebookAuthModel'); + } + + final path = r'/facebook'; + + Object postBody = facebookAuthModel; + + 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: + /// + /// * [FacebookAuthModel] facebookAuthModel (required): + Future facebookCreate(FacebookAuthModel facebookAuthModel) async { + final response = await facebookCreateWithHttpInfo(facebookAuthModel); + 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); + } +} diff --git a/mycore_api_old/lib/api/google_api.dart b/mycore_api_old/lib/api/google_api.dart new file mode 100644 index 0000000..64faecc --- /dev/null +++ b/mycore_api_old/lib/api/google_api.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 GoogleApi { + GoogleApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /google' operation and returns the [Response]. + /// Parameters: + /// + /// * [GoogleAuthModel] googleAuthModel (required): + Future googleCreateWithHttpInfo(GoogleAuthModel googleAuthModel) async { + // Verify required params are set. + if (googleAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: googleAuthModel'); + } + + final path = r'/google'; + + Object postBody = googleAuthModel; + + 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: + /// + /// * [GoogleAuthModel] googleAuthModel (required): + Future googleCreate(GoogleAuthModel googleAuthModel) async { + final response = await googleCreateWithHttpInfo(googleAuthModel); + 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); + } +} diff --git a/mycore_api_old/lib/api/group_api.dart b/mycore_api_old/lib/api/group_api.dart new file mode 100644 index 0000000..020e8f1 --- /dev/null +++ b/mycore_api_old/lib/api/group_api.dart @@ -0,0 +1,753 @@ +// +// 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 GroupApi { + GroupApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// Group to create + Future groupCreateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (groupCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupCreateOrUpdateDetailDTO'); + } + + final path = r'/api/group'; + + Object postBody = groupCreateOrUpdateDetailDTO; + + 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, + ); + } + + /// Create a group + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// Group to create + Future groupCreate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + final response = await groupCreateWithHttpInfo(groupCreateOrUpdateDetailDTO); + 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), 'GroupDetailDTO') as GroupDetailDTO; + } + return Future.value(null); + } + + /// Create groups from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future groupCreateDevicesFromZigbee2MqttWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/group/{homeId}/fromZigbee' + .replaceAll('{' + 'homeId' + '}', homeId.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, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create groups from provider + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> groupCreateDevicesFromZigbee2Mqtt(String homeId) async { + final response = await groupCreateDevicesFromZigbee2MqttWithHttpInfo(homeId); + 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); + } + + /// Delete device from a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the group + /// + /// * [String] groupId (required): + /// Id of group + Future groupDeleteWithHttpInfo(String deviceId, String groupId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + if (groupId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); + } + + final path = r'/api/group/{groupId}/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()) + .replaceAll('{' + 'groupId' + '}', groupId.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, + ); + } + + /// Delete device from a group + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the group + /// + /// * [String] groupId (required): + /// Id of group + Future groupDelete(String deviceId, String groupId) async { + final response = await groupDeleteWithHttpInfo(deviceId, groupId); + 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); + } + + /// Delete a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// Id of group + Future groupDelete2WithHttpInfo(String groupId) async { + // Verify required params are set. + if (groupId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); + } + + final path = r'/api/group/{groupId}' + .replaceAll('{' + 'groupId' + '}', groupId.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, + ); + } + + /// Delete a group + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// Id of group + Future groupDelete2(String groupId) async { + final response = await groupDelete2WithHttpInfo(groupId); + 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); + } + + /// Delete all group for a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future groupDeleteAllForHomeWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/group/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete all group for a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future groupDeleteAllForHome(String homeId) async { + final response = await groupDeleteAllForHomeWithHttpInfo(homeId); + 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); + } + + /// Get all groups for the specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future groupGetAllWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/group/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all groups for the specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> groupGetAll(String homeId) async { + final response = await groupGetAllWithHttpInfo(homeId); + 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); + } + + /// Get detail info of a specified group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// groupid + Future groupGetDetailWithHttpInfo(String groupId) async { + // Verify required params are set. + if (groupId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); + } + + final path = r'/api/group/detail/{groupId}' + .replaceAll('{' + 'groupId' + '}', groupId.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, + ); + } + + /// Get detail info of a specified group + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// groupid + Future groupGetDetail(String groupId) async { + final response = await groupGetDetailWithHttpInfo(groupId); + 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), 'GroupDetailDTO') as GroupDetailDTO; + } + return Future.value(null); + } + + /// Get list of group from a type + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// home Id + /// + /// * [String] type (required): + /// group type + Future groupGetGroupsByTypeWithHttpInfo(String homeId, String type) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + if (type == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: type'); + } + + final path = r'/api/group/{homeId}/type/{type}' + .replaceAll('{' + 'homeId' + '}', homeId.toString()) + .replaceAll('{' + 'type' + '}', type.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, + ); + } + + /// Get list of group from a type + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// home Id + /// + /// * [String] type (required): + /// group type + Future> groupGetGroupsByType(String homeId, String type) async { + final response = await groupGetGroupsByTypeWithHttpInfo(homeId, 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), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get all zigbee2Mqtt groups + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future groupGetGroupsFromZigbee2MqttWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/group/zigbee2Mqtt/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all zigbee2Mqtt groups + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> groupGetGroupsFromZigbee2Mqtt(String homeId) async { + final response = await groupGetGroupsFromZigbee2MqttWithHttpInfo(homeId); + 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); + } + + /// Update a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// group to update + Future groupUpdateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (groupCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupCreateOrUpdateDetailDTO'); + } + + final path = r'/api/group'; + + Object postBody = groupCreateOrUpdateDetailDTO; + + 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, + ); + } + + /// Update a group + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// group to update + Future groupUpdate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + final response = await groupUpdateWithHttpInfo(groupCreateOrUpdateDetailDTO); + 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), 'GroupCreateOrUpdateDetailDTO') as GroupCreateOrUpdateDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/home_api.dart b/mycore_api_old/lib/api/home_api.dart new file mode 100644 index 0000000..64dbdd8 --- /dev/null +++ b/mycore_api_old/lib/api/home_api.dart @@ -0,0 +1,372 @@ +// +// 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 HomeApi { + HomeApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): + /// Home to create + Future homeCreateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { + // Verify required params are set. + if (createOrUpdateHomeDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: createOrUpdateHomeDTO'); + } + + final path = r'/api/home'; + + Object postBody = createOrUpdateHomeDTO; + + 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, + ); + } + + /// Create a home + /// + /// Parameters: + /// + /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): + /// Home to create + Future homeCreate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { + final response = await homeCreateWithHttpInfo(createOrUpdateHomeDTO); + 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), 'HomeDTO') as HomeDTO; + } + return Future.value(null); + } + + /// Delete a home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Id of home to delete + Future homeDeleteWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete a home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Id of home to delete + Future homeDelete(String homeId) async { + final response = await homeDeleteWithHttpInfo(homeId); + 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); + } + + /// Get all home for specified user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future homeGetAllWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/home/{userId}' + .replaceAll('{' + 'userId' + '}', userId.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, + ); + } + + /// Get all home for specified user + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future> homeGetAll(String userId) async { + final response = await homeGetAllWithHttpInfo(userId); + 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); + } + + /// Get detail info of a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// home id + Future homeGetDetailWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/home/detail/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get detail info of a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// home id + Future homeGetDetail(String homeId) async { + final response = await homeGetDetailWithHttpInfo(homeId); + 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), 'HomeDetailDTO') as HomeDetailDTO; + } + return Future.value(null); + } + + /// Update a home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): + /// Home to update + Future homeUpdateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { + // Verify required params are set. + if (createOrUpdateHomeDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: createOrUpdateHomeDTO'); + } + + final path = r'/api/home'; + + Object postBody = createOrUpdateHomeDTO; + + 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, + ); + } + + /// Update a home + /// + /// Parameters: + /// + /// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required): + /// Home to update + Future homeUpdate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async { + final response = await homeUpdateWithHttpInfo(createOrUpdateHomeDTO); + 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), 'HomeDTO') as HomeDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/iot_api.dart b/mycore_api_old/lib/api/iot_api.dart new file mode 100644 index 0000000..33bb0f4 --- /dev/null +++ b/mycore_api_old/lib/api/iot_api.dart @@ -0,0 +1,254 @@ +// +// 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 IOTApi { + IOTApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve all SmartPrinterMessage + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] idDevice (required): + /// + /// * [int] id: + /// Id of the smart printer message + Future iOTGetSmartPrinterMessagesWithHttpInfo(String idDevice, { int id }) async { + // Verify required params are set. + if (idDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); + } + + final path = r'/api/iot/smartprinter/{idDevice}' + .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (id != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'id', id)); + } + + 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, + ); + } + + /// Retrieve all SmartPrinterMessage + /// + /// Parameters: + /// + /// * [String] idDevice (required): + /// + /// * [int] id: + /// Id of the smart printer message + Future> iOTGetSmartPrinterMessages(String idDevice, { int id }) async { + final response = await iOTGetSmartPrinterMessagesWithHttpInfo(idDevice, id: 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); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// Id of the device to upload to DB + /// + /// * [List] smartPrinterMessage (required): + /// Content that will be uploaded + Future iOTPostToDBPrinterWithHttpInfo(int idDevice, List smartPrinterMessage) async { + // Verify required params are set. + if (idDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); + } + if (smartPrinterMessage == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: smartPrinterMessage'); + } + + final path = r'/api/iot/smartprinter/{idDevice}' + .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + + Object postBody = smartPrinterMessage; + + 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, + ); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// Id of the device to upload to DB + /// + /// * [List] smartPrinterMessage (required): + /// Content that will be uploaded + Future iOTPostToDBPrinter(int idDevice, List smartPrinterMessage) async { + final response = await iOTPostToDBPrinterWithHttpInfo(idDevice, smartPrinterMessage); + 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); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// + /// * [List] smartGardenMessage (required): + Future iOTPostToDBSmartGardenWithHttpInfo(int idDevice, List smartGardenMessage) async { + // Verify required params are set. + if (idDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); + } + if (smartGardenMessage == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: smartGardenMessage'); + } + + final path = r'/api/iot/smartgarden/{idDevice}' + .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + + Object postBody = smartGardenMessage; + + 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, + ); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// + /// * [List] smartGardenMessage (required): + Future iOTPostToDBSmartGarden(int idDevice, List smartGardenMessage) async { + final response = await iOTPostToDBSmartGardenWithHttpInfo(idDevice, smartGardenMessage); + 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); + } +} diff --git a/mycore_api_old/lib/api/layout_api.dart b/mycore_api_old/lib/api/layout_api.dart new file mode 100644 index 0000000..c433978 --- /dev/null +++ b/mycore_api_old/lib/api/layout_api.dart @@ -0,0 +1,74 @@ +// +// 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 LayoutApi { + LayoutApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// It's a test ! :) + /// + /// Note: This method returns the HTTP [Response]. + Future layoutGetWithHttpInfo() async { + final path = r'/api/layout/panelSection'; + + 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, + ); + } + + /// It's a test ! :) + Future> layoutGet() async { + final response = await layoutGetWithHttpInfo(); + 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); + } +} diff --git a/mycore_api_old/lib/api/mqtt_api.dart b/mycore_api_old/lib/api/mqtt_api.dart new file mode 100644 index 0000000..4b360bf --- /dev/null +++ b/mycore_api_old/lib/api/mqtt_api.dart @@ -0,0 +1,87 @@ +// +// 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 MQTTApi { + MQTTApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Publish mqtt test + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [MqttMessageDTO] mqttMessageDTO (required): + /// Message to send + Future mQTTPublishMessageWithHttpInfo(MqttMessageDTO mqttMessageDTO) async { + // Verify required params are set. + if (mqttMessageDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: mqttMessageDTO'); + } + + final path = r'/api/mqtt'; + + Object postBody = mqttMessageDTO; + + 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, + ); + } + + /// Publish mqtt test + /// + /// Parameters: + /// + /// * [MqttMessageDTO] mqttMessageDTO (required): + /// Message to send + Future mQTTPublishMessage(MqttMessageDTO mqttMessageDTO) async { + final response = await mQTTPublishMessageWithHttpInfo(mqttMessageDTO); + 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), 'bool') as bool; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/odd_api.dart b/mycore_api_old/lib/api/odd_api.dart new file mode 100644 index 0000000..cfde296 --- /dev/null +++ b/mycore_api_old/lib/api/odd_api.dart @@ -0,0 +1,173 @@ +// +// 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 OddApi { + OddApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Get odds for one country and one odd value maximum + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future oddGetAllWithHttpInfo(double oddRequest) async { + // Verify required params are set. + if (oddRequest == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: oddRequest'); + } + + final path = r'/api/odd/{oddRequest}' + .replaceAll('{' + 'oddRequest' + '}', oddRequest.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, + ); + } + + /// Get odds for one country and one odd value maximum + /// + /// Parameters: + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future> oddGetAll(double oddRequest) async { + final response = await oddGetAllWithHttpInfo(oddRequest); + 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); + } + + /// Get odds for one country and one odd value maximum + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] id (required): + /// id of country, e.g = BE for Belgium + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future oddGetForCountryWithHttpInfo(String id, double oddRequest) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + if (oddRequest == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: oddRequest'); + } + + final path = r'/api/odd/country/{id}/{oddRequest}' + .replaceAll('{' + 'id' + '}', id.toString()) + .replaceAll('{' + 'oddRequest' + '}', oddRequest.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, + ); + } + + /// Get odds for one country and one odd value maximum + /// + /// Parameters: + /// + /// * [String] id (required): + /// id of country, e.g = BE for Belgium + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future> oddGetForCountry(String id, double oddRequest) async { + final response = await oddGetForCountryWithHttpInfo(id, oddRequest); + 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); + } +} diff --git a/mycore_api_old/lib/api/provider_api.dart b/mycore_api_old/lib/api/provider_api.dart new file mode 100644 index 0000000..03bfdde --- /dev/null +++ b/mycore_api_old/lib/api/provider_api.dart @@ -0,0 +1,301 @@ +// +// 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 ProviderApi { + ProviderApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to create + Future providerCreateWithHttpInfo(ProviderDTO providerDTO) async { + // Verify required params are set. + if (providerDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerDTO'); + } + + final path = r'/api/provider'; + + Object postBody = providerDTO; + + 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, + ); + } + + /// Create a provider + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to create + Future providerCreate(ProviderDTO providerDTO) async { + final response = await providerCreateWithHttpInfo(providerDTO); + 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), 'ProviderDTO') as ProviderDTO; + } + return Future.value(null); + } + + /// Delete a provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] providerId (required): + /// Id of provider to delete + Future providerDeleteWithHttpInfo(String providerId) async { + // Verify required params are set. + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/provider/{providerId}' + .replaceAll('{' + 'providerId' + '}', providerId.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, + ); + } + + /// Delete a provider + /// + /// Parameters: + /// + /// * [String] providerId (required): + /// Id of provider to delete + Future providerDelete(String providerId) async { + final response = await providerDeleteWithHttpInfo(providerId); + 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); + } + + /// Get all home providers + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future providerGetAllWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/provider/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all home providers + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> providerGetAll(String homeId) async { + final response = await providerGetAllWithHttpInfo(homeId); + 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); + } + + /// Update a provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to update + Future providerUpdateWithHttpInfo(ProviderDTO providerDTO) async { + // Verify required params are set. + if (providerDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerDTO'); + } + + final path = r'/api/provider'; + + Object postBody = providerDTO; + + 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, + ); + } + + /// Update a provider + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to update + Future providerUpdate(ProviderDTO providerDTO) async { + final response = await providerUpdateWithHttpInfo(providerDTO); + 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); + } +} diff --git a/mycore_api_old/lib/api/room_api.dart b/mycore_api_old/lib/api/room_api.dart new file mode 100644 index 0000000..db5c5a2 --- /dev/null +++ b/mycore_api_old/lib/api/room_api.dart @@ -0,0 +1,677 @@ +// +// 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 RoomApi { + RoomApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Add devices in the specified room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// Room Id + /// + /// * [List] requestBody (required): + /// Device Ids + Future roomAddDeviceToRoomWithHttpInfo(String roomId, List requestBody) async { + // Verify required params are set. + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + if (requestBody == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: requestBody'); + } + + final path = r'/api/room/{roomId}' + .replaceAll('{' + 'roomId' + '}', roomId.toString()); + + Object postBody = requestBody; + + 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, + ); + } + + /// Add devices in the specified room + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// Room Id + /// + /// * [List] requestBody (required): + /// Device Ids + Future roomAddDeviceToRoom(String roomId, List requestBody) async { + final response = await roomAddDeviceToRoomWithHttpInfo(roomId, requestBody); + 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), 'RoomDetailDTO') as RoomDetailDTO; + } + return Future.value(null); + } + + /// Create a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// Room to create + Future roomCreateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (roomCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomCreateOrUpdateDetailDTO'); + } + + final path = r'/api/room'; + + Object postBody = roomCreateOrUpdateDetailDTO; + + 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, + ); + } + + /// Create a room + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// Room to create + Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + final response = await roomCreateWithHttpInfo(roomCreateOrUpdateDetailDTO); + 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), 'RoomDetailDTO') as RoomDetailDTO; + } + return Future.value(null); + } + + /// Delete a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// Id of room + Future roomDeleteWithHttpInfo(String roomId) async { + // Verify required params are set. + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + + final path = r'/api/room/{roomId}' + .replaceAll('{' + 'roomId' + '}', roomId.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, + ); + } + + /// Delete a room + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// Id of room + Future roomDelete(String roomId) async { + final response = await roomDeleteWithHttpInfo(roomId); + 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); + } + + /// Delete device from a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the room + /// + /// * [String] roomId (required): + /// Id of room + Future roomDelete2WithHttpInfo(String deviceId, String roomId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + + final path = r'/api/room/{roomId}/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()) + .replaceAll('{' + 'roomId' + '}', roomId.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, + ); + } + + /// Delete device from a room + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the room + /// + /// * [String] roomId (required): + /// Id of room + Future roomDelete2(String deviceId, String roomId) async { + final response = await roomDelete2WithHttpInfo(deviceId, roomId); + 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); + } + + /// Delete all rooms for a specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future roomDeleteAllForHomeWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/room/home/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Delete all rooms for a specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future roomDeleteAllForHome(String homeId) async { + final response = await roomDeleteAllForHomeWithHttpInfo(homeId); + 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); + } + + /// Get all rooms for the specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future roomGetAllWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/room/{homeId}' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all rooms for the specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> roomGetAll(String homeId) async { + final response = await roomGetAllWithHttpInfo(homeId); + 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); + } + + /// Get all rooms main details for the specified home + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future roomGetAllWithMainDetailsWithHttpInfo(String homeId) async { + // Verify required params are set. + if (homeId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId'); + } + + final path = r'/api/room/{homeId}/details' + .replaceAll('{' + 'homeId' + '}', homeId.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, + ); + } + + /// Get all rooms main details for the specified home + /// + /// Parameters: + /// + /// * [String] homeId (required): + /// Home Id + Future> roomGetAllWithMainDetails(String homeId) async { + final response = await roomGetAllWithMainDetailsWithHttpInfo(homeId); + 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); + } + + /// Get detail info of a specified room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// room id + Future roomGetDetailWithHttpInfo(String roomId) async { + // Verify required params are set. + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + + final path = r'/api/room/detail/{roomId}' + .replaceAll('{' + 'roomId' + '}', roomId.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, + ); + } + + /// Get detail info of a specified room + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// room id + Future roomGetDetail(String roomId) async { + final response = await roomGetDetailWithHttpInfo(roomId); + 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), 'RoomDetailDTO') as RoomDetailDTO; + } + return Future.value(null); + } + + /// Update a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// room to update + Future roomUpdateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (roomCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomCreateOrUpdateDetailDTO'); + } + + final path = r'/api/room'; + + Object postBody = roomCreateOrUpdateDetailDTO; + + 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, + ); + } + + /// Update a room + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// room to update + Future roomUpdate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + final response = await roomUpdateWithHttpInfo(roomCreateOrUpdateDetailDTO); + 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), 'RoomCreateOrUpdateDetailDTO') as RoomCreateOrUpdateDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/screen_device_api.dart b/mycore_api_old/lib/api/screen_device_api.dart new file mode 100644 index 0000000..6def34f --- /dev/null +++ b/mycore_api_old/lib/api/screen_device_api.dart @@ -0,0 +1,356 @@ +// +// 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 ScreenDeviceApi { + ScreenDeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create screen device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [ScreenDevice] screenDevice (required): + /// Screen device to create + Future screenDeviceCreateDeviceWithHttpInfo(ScreenDevice screenDevice) async { + // Verify required params are set. + if (screenDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDevice'); + } + + final path = r'/api/device/screen'; + + Object postBody = screenDevice; + + 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, + ); + } + + /// Create screen device + /// + /// Parameters: + /// + /// * [ScreenDevice] screenDevice (required): + /// Screen device to create + Future screenDeviceCreateDevice(ScreenDevice screenDevice) async { + final response = await screenDeviceCreateDeviceWithHttpInfo(screenDevice); + 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), 'ScreenDevice') as ScreenDevice; + } + return Future.value(null); + } + + /// Delete device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Screen device id to update + Future screenDeviceDeleteDeviceWithHttpInfo(String deviceId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + + final path = r'/api/device/screen/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.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, + ); + } + + /// Delete device + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Screen device id to update + Future screenDeviceDeleteDevice(String deviceId) async { + final response = await screenDeviceDeleteDeviceWithHttpInfo(deviceId); + 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); + } + + /// Get all screen devices + /// + /// Note: This method returns the HTTP [Response]. + Future screenDeviceGetAllScreenDevicesWithHttpInfo() async { + final path = r'/api/device/screen'; + + 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, + ); + } + + /// Get all screen devices + Future> screenDeviceGetAllScreenDevices() async { + final response = await screenDeviceGetAllScreenDevicesWithHttpInfo(); + 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); + } + + /// Get screen device info + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] screenDeviceId (required): + /// Id of the screen device you want to get information + Future screenDeviceGetDeviceInfoWithHttpInfo(String screenDeviceId) async { + // Verify required params are set. + if (screenDeviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDeviceId'); + } + + final path = r'/api/device/screen/{screenDeviceId}' + .replaceAll('{' + 'screenDeviceId' + '}', screenDeviceId.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, + ); + } + + /// Get screen device info + /// + /// Parameters: + /// + /// * [String] screenDeviceId (required): + /// Id of the screen device you want to get information + Future screenDeviceGetDeviceInfo(String screenDeviceId) async { + final response = await screenDeviceGetDeviceInfoWithHttpInfo(screenDeviceId); + 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), 'ScreenDevice') as ScreenDevice; + } + return Future.value(null); + } + + /// Update screen device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [ScreenDevice] screenDevice (required): + /// Screen device to update + Future screenDeviceUpdateDeviceWithHttpInfo(ScreenDevice screenDevice) async { + // Verify required params are set. + if (screenDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDevice'); + } + + final path = r'/api/device/screen'; + + Object postBody = screenDevice; + + 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, + ); + } + + /// Update screen device + /// + /// Parameters: + /// + /// * [ScreenDevice] screenDevice (required): + /// Screen device to update + Future screenDeviceUpdateDevice(ScreenDevice screenDevice) async { + final response = await screenDeviceUpdateDeviceWithHttpInfo(screenDevice); + 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), 'ScreenDevice') as ScreenDevice; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/token_api.dart b/mycore_api_old/lib/api/token_api.dart new file mode 100644 index 0000000..88287aa --- /dev/null +++ b/mycore_api_old/lib/api/token_api.dart @@ -0,0 +1,150 @@ +// +// 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 TokenApi { + TokenApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Connect user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + /// login info + Future tokenConnectUserWithHttpInfo(LoginDTO loginDTO) async { + // Verify required params are set. + if (loginDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO'); + } + + final path = r'/api/token'; + + 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, + ); + } + + /// Connect user + /// + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + /// login info + Future tokenConnectUser(LoginDTO loginDTO) async { + final response = await tokenConnectUserWithHttpInfo(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), 'UserInfo') as UserInfo; + } + return Future.value(null); + } + + /// Performs an HTTP 'POST /token' operation and returns the [Response]. + /// Parameters: + /// + /// * [User] user (required): + Future tokenCreateWithHttpInfo(User user) async { + // Verify required params are set. + if (user == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); + } + + final path = r'/token'; + + 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 tokenCreate(User user) async { + final response = await tokenCreateWithHttpInfo(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), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/twitter_api.dart b/mycore_api_old/lib/api/twitter_api.dart new file mode 100644 index 0000000..426572c --- /dev/null +++ b/mycore_api_old/lib/api/twitter_api.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 TwitterApi { + TwitterApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /twitter' operation and returns the [Response]. + /// Parameters: + /// + /// * [TwitterAuthModel] twitterAuthModel (required): + Future twitterCreateWithHttpInfo(TwitterAuthModel twitterAuthModel) async { + // Verify required params are set. + if (twitterAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: twitterAuthModel'); + } + + final path = r'/twitter'; + + Object postBody = twitterAuthModel; + + 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: + /// + /// * [TwitterAuthModel] twitterAuthModel (required): + Future twitterCreate(TwitterAuthModel twitterAuthModel) async { + final response = await twitterCreateWithHttpInfo(twitterAuthModel); + 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); + } +} diff --git a/mycore_api_old/lib/api/user_api.dart b/mycore_api_old/lib/api/user_api.dart new file mode 100644 index 0000000..e22c4f9 --- /dev/null +++ b/mycore_api_old/lib/api/user_api.dart @@ -0,0 +1,427 @@ +// +// 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; + + /// Create an user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + /// New user info + Future userCreateUserWithHttpInfo(UserInfo userInfo) async { + // Verify required params are set. + if (userInfo == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userInfo'); + } + + final path = r'/api/user'; + + Object postBody = userInfo; + + 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, + ); + } + + /// Create an user + /// + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + /// New user info + Future userCreateUser(UserInfo userInfo) async { + final response = await userCreateUserWithHttpInfo(userInfo); + 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), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } + + /// Delete an user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] id (required): + /// Id of user to delete + 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, + ); + } + + /// Delete an user + /// + /// Parameters: + /// + /// * [String] id (required): + /// Id of user to delete + 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); + } + + /// Get a specific user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] id (required): + /// id user + Future userGetWithHttpInfo(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, + ); + } + + /// Get a specific user + /// + /// Parameters: + /// + /// * [String] id (required): + /// id user + Future userGet(String id) async { + final response = await userGetWithHttpInfo(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), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } + + /// Get a list of user + /// + /// Note: This method returns the HTTP [Response]. + Future userGetAllWithHttpInfo() 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, + ); + } + + /// Get a list of user + Future> userGetAll() async { + final response = await userGetAllWithHttpInfo(); + 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); + } + + /// Get a specific user by email + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] email (required): + /// user email + Future userGetByEmailWithHttpInfo(String email) async { + // Verify required params are set. + if (email == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: email'); + } + + final path = r'/api/user/email/{email}' + .replaceAll('{' + 'email' + '}', email.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, + ); + } + + /// Get a specific user by email + /// + /// Parameters: + /// + /// * [String] email (required): + /// user email + Future userGetByEmail(String email) async { + final response = await userGetByEmailWithHttpInfo(email); + 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), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } + + /// Update an user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + /// User to update + Future userUpdateUserWithHttpInfo(UserInfo userInfo) async { + // Verify required params are set. + if (userInfo == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userInfo'); + } + + final path = r'/api/user'; + + Object postBody = userInfo; + + 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, + ); + } + + /// Update an user + /// + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + /// User to update + Future userUpdateUser(UserInfo userInfo) async { + final response = await userUpdateUserWithHttpInfo(userInfo); + 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), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api_old/lib/api/values_api.dart b/mycore_api_old/lib/api/values_api.dart new file mode 100644 index 0000000..1a6b1f1 --- /dev/null +++ b/mycore_api_old/lib/api/values_api.dart @@ -0,0 +1,315 @@ +// +// 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 ValuesApi { + ValuesApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'DELETE /api/test/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] id (required): + Future valuesDeleteWithHttpInfo(int id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/test/{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: + /// + /// * [int] id (required): + Future valuesDelete(int id) async { + final response = await valuesDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + } + + /// Performs an HTTP 'GET /api/test/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] id (required): + Future valuesGetWithHttpInfo(int id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/test/{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: + /// + /// * [int] id (required): + Future valuesGet(int id) async { + final response = await valuesGetWithHttpInfo(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); + } + + /// It's a test ! :) + /// + /// Note: This method returns the HTTP [Response]. + Future valuesGetAllWithHttpInfo() async { + final path = r'/api/test'; + + 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, + ); + } + + /// It's a test ! :) + Future> valuesGetAll() async { + final response = await valuesGetAllWithHttpInfo(); + 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 'POST /api/test' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] body (required): + Future valuesPostWithHttpInfo(String body) async { + // Verify required params are set. + if (body == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: body'); + } + + final path = r'/api/test'; + + Object postBody = body; + + 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: + /// + /// * [String] body (required): + Future valuesPost(String body) async { + final response = await valuesPostWithHttpInfo(body); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + } + + /// Performs an HTTP 'PUT /api/test/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] id (required): + /// + /// * [String] body (required): + Future valuesPutWithHttpInfo(int id, String body) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + if (body == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: body'); + } + + final path = r'/api/test/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody = body; + + 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: + /// + /// * [int] id (required): + /// + /// * [String] body (required): + Future valuesPut(int id, String body) async { + final response = await valuesPutWithHttpInfo(id, body); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + } +} diff --git a/mycore_api_old/lib/api_client.dart b/mycore_api_old/lib/api_client.dart new file mode 100644 index 0000000..584293b --- /dev/null +++ b/mycore_api_old/lib/api_client.dart @@ -0,0 +1,375 @@ +// +// 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://localhost:5000'}) { + // 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 'Action': + return Action.fromJson(value); + case 'ActionType': + return ActionTypeTypeTransformer().decode(value); + + case 'AlarmMode': + return AlarmMode.fromJson(value); + case 'AlarmModeCreateOrUpdateDetailDTO': + return AlarmModeCreateOrUpdateDetailDTO.fromJson(value); + case 'AlarmModeCreateOrUpdateDetailDTOAllOf': + return AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(value); + case 'AlarmModeDTO': + return AlarmModeDTO.fromJson(value); + case 'AlarmModeDetailDTO': + return AlarmModeDetailDTO.fromJson(value); + case 'AlarmModeDetailDTOAllOf': + return AlarmModeDetailDTOAllOf.fromJson(value); + case 'AlarmTriggered': + return AlarmTriggered.fromJson(value); + case 'AlarmType': + return AlarmTypeTypeTransformer().decode(value); + + case 'AutomationDTO': + return AutomationDTO.fromJson(value); + case 'AutomationDetailDTO': + return AutomationDetailDTO.fromJson(value); + case 'AutomationDetailDTOAllOf': + return AutomationDetailDTOAllOf.fromJson(value); + case 'AutomationState': + return AutomationState.fromJson(value); + case 'AutomationTriggered': + return AutomationTriggered.fromJson(value); + case 'AzureADAuthModel': + return AzureADAuthModel.fromJson(value); + case 'Book': + return Book.fromJson(value); + case 'Condition': + return Condition.fromJson(value); + case 'ConditionType': + return ConditionTypeTypeTransformer().decode(value); + + case 'ConditionValue': + return ConditionValueTypeTransformer().decode(value); + + case 'ConnectionStatus': + return ConnectionStatusTypeTransformer().decode(value); + + case 'CreateOrUpdateHomeDTO': + return CreateOrUpdateHomeDTO.fromJson(value); + case 'CreateOrUpdateHomeDTOAllOf': + return CreateOrUpdateHomeDTOAllOf.fromJson(value); + case 'DeviceDetailDTO': + return DeviceDetailDTO.fromJson(value); + case 'DeviceDetailDTOAllOf': + return DeviceDetailDTOAllOf.fromJson(value); + case 'DeviceState': + return DeviceState.fromJson(value); + case 'DeviceSummaryDTO': + return DeviceSummaryDTO.fromJson(value); + case 'DeviceType': + return DeviceTypeTypeTransformer().decode(value); + + case 'ElectricityProduction': + return ElectricityProduction.fromJson(value); + case 'EventDTO': + return EventDTO.fromJson(value); + case 'EventDetailDTO': + return EventDetailDTO.fromJson(value); + case 'EventDetailDTOAllOf': + return EventDetailDTOAllOf.fromJson(value); + case 'EventFilter': + return EventFilter.fromJson(value); + case 'EventHomeFilter': + return EventHomeFilter.fromJson(value); + case 'EventHomeFilterAllOf': + return EventHomeFilterAllOf.fromJson(value); + case 'EventType': + return EventTypeTypeTransformer().decode(value); + + case 'FacebookAuthModel': + return FacebookAuthModel.fromJson(value); + case 'GeolocalizedMode': + return GeolocalizedMode.fromJson(value); + case 'GoogleAuthModel': + return GoogleAuthModel.fromJson(value); + case 'GroupCreateOrUpdateDetailDTO': + return GroupCreateOrUpdateDetailDTO.fromJson(value); + case 'GroupCreateOrUpdateDetailDTOAllOf': + return GroupCreateOrUpdateDetailDTOAllOf.fromJson(value); + case 'GroupDetailDTO': + return GroupDetailDTO.fromJson(value); + case 'GroupDetailDTOAllOf': + return GroupDetailDTOAllOf.fromJson(value); + case 'GroupSummaryDTO': + return GroupSummaryDTO.fromJson(value); + case 'HomeDTO': + return HomeDTO.fromJson(value); + case 'HomeDetailDTO': + return HomeDetailDTO.fromJson(value); + case 'HomeDetailDTOAllOf': + return HomeDetailDTOAllOf.fromJson(value); + case 'ListResponseOfEventDetailDTOAndEventHomeFilter': + return ListResponseOfEventDetailDTOAndEventHomeFilter.fromJson(value); + case 'LoginDTO': + return LoginDTO.fromJson(value); + case 'MeansOfCommunication': + return MeansOfCommunicationTypeTransformer().decode(value); + + case 'MqttMessageDTO': + return MqttMessageDTO.fromJson(value); + case 'OddNice': + return OddNice.fromJson(value); + case 'OddObject': + return OddObject.fromJson(value); + case 'PanelMenuItem': + return PanelMenuItem.fromJson(value); + case 'PanelSection': + return PanelSection.fromJson(value); + case 'ProgrammedMode': + return ProgrammedMode.fromJson(value); + case 'ProviderDTO': + return ProviderDTO.fromJson(value); + case 'ProviderType': + return ProviderTypeTypeTransformer().decode(value); + + case 'RoomCreateOrUpdateDetailDTO': + return RoomCreateOrUpdateDetailDTO.fromJson(value); + case 'RoomDetailDTO': + return RoomDetailDTO.fromJson(value); + case 'RoomMainDetailDTO': + return RoomMainDetailDTO.fromJson(value); + case 'RoomMainDetailDTOAllOf': + return RoomMainDetailDTOAllOf.fromJson(value); + case 'RoomSummaryDTO': + return RoomSummaryDTO.fromJson(value); + case 'ScreenDevice': + return ScreenDevice.fromJson(value); + case 'SmartGardenMessage': + return SmartGardenMessage.fromJson(value); + case 'SmartPrinterMessage': + return SmartPrinterMessage.fromJson(value); + case 'TimePeriodAlarm': + return TimePeriodAlarm.fromJson(value); + case 'TokenDTO': + return TokenDTO.fromJson(value); + case 'Trigger': + return Trigger.fromJson(value); + case 'TriggerType': + return TriggerTypeTypeTransformer().decode(value); + + case 'TwitterAuthModel': + return TwitterAuthModel.fromJson(value); + case 'User': + return User.fromJson(value); + case 'UserInfo': + return UserInfo.fromJson(value); + case 'UserInfoDetailDTO': + return UserInfoDetailDTO.fromJson(value); + case 'ViewBy': + return ViewByTypeTransformer().decode(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/mycore_api_old/lib/api_exception.dart b/mycore_api_old/lib/api_exception.dart new file mode 100644 index 0000000..1537c97 --- /dev/null +++ b/mycore_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/mycore_api_old/lib/api_helper.dart b/mycore_api_old/lib/api_helper.dart new file mode 100644 index 0000000..54c52a6 --- /dev/null +++ b/mycore_api_old/lib/api_helper.dart @@ -0,0 +1,104 @@ +// +// 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 ActionType) { + return ActionTypeTypeTransformer().encode(value).toString(); + } + if (value is AlarmType) { + return AlarmTypeTypeTransformer().encode(value).toString(); + } + if (value is ConditionType) { + return ConditionTypeTypeTransformer().encode(value).toString(); + } + if (value is ConditionValue) { + return ConditionValueTypeTransformer().encode(value).toString(); + } + if (value is ConnectionStatus) { + return ConnectionStatusTypeTransformer().encode(value).toString(); + } + if (value is DeviceType) { + return DeviceTypeTypeTransformer().encode(value).toString(); + } + if (value is EventType) { + return EventTypeTypeTransformer().encode(value).toString(); + } + if (value is MeansOfCommunication) { + return MeansOfCommunicationTypeTransformer().encode(value).toString(); + } + if (value is ProviderType) { + return ProviderTypeTypeTransformer().encode(value).toString(); + } + if (value is TriggerType) { + return TriggerTypeTypeTransformer().encode(value).toString(); + } + if (value is ViewBy) { + return ViewByTypeTransformer().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/mycore_api_old/lib/auth/api_key_auth.dart b/mycore_api_old/lib/auth/api_key_auth.dart new file mode 100644 index 0000000..41a4afd --- /dev/null +++ b/mycore_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/mycore_api_old/lib/auth/authentication.dart b/mycore_api_old/lib/auth/authentication.dart new file mode 100644 index 0000000..5ca198d --- /dev/null +++ b/mycore_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/mycore_api_old/lib/auth/http_basic_auth.dart b/mycore_api_old/lib/auth/http_basic_auth.dart new file mode 100644 index 0000000..6dc36a1 --- /dev/null +++ b/mycore_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/mycore_api_old/lib/auth/http_bearer_auth.dart b/mycore_api_old/lib/auth/http_bearer_auth.dart new file mode 100644 index 0000000..a23b65f --- /dev/null +++ b/mycore_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/mycore_api_old/lib/auth/oauth.dart b/mycore_api_old/lib/auth/oauth.dart new file mode 100644 index 0000000..c0463ad --- /dev/null +++ b/mycore_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/mycore_api_old/lib/model/action.dart b/mycore_api_old/lib/model/action.dart new file mode 100644 index 0000000..57dff7c --- /dev/null +++ b/mycore_api_old/lib/model/action.dart @@ -0,0 +1,125 @@ +// +// 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 Action { + /// Returns a new [Action] instance. + Action({ + this.groupId, + this.deviceId, + this.states, + this.rawRequest, + this.providerId, + this.type, + this.isForce, + }); + + String groupId; + + String deviceId; + + List states; + + String rawRequest; + + String providerId; + + ActionType type; + + bool isForce; + + @override + bool operator ==(Object other) => identical(this, other) || other is Action && + other.groupId == groupId && + other.deviceId == deviceId && + other.states == states && + other.rawRequest == rawRequest && + other.providerId == providerId && + other.type == type && + other.isForce == isForce; + + @override + int get hashCode => + (groupId == null ? 0 : groupId.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (states == null ? 0 : states.hashCode) + + (rawRequest == null ? 0 : rawRequest.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (type == null ? 0 : type.hashCode) + + (isForce == null ? 0 : isForce.hashCode); + + @override + String toString() => 'Action[groupId=$groupId, deviceId=$deviceId, states=$states, rawRequest=$rawRequest, providerId=$providerId, type=$type, isForce=$isForce]'; + + Map toJson() { + final json = {}; + if (groupId != null) { + json[r'groupId'] = groupId; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (states != null) { + json[r'states'] = states; + } + if (rawRequest != null) { + json[r'rawRequest'] = rawRequest; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (type != null) { + json[r'type'] = type; + } + if (isForce != null) { + json[r'isForce'] = isForce; + } + return json; + } + + /// Returns a new [Action] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Action fromJson(Map json) => json == null + ? null + : Action( + groupId: json[r'groupId'], + deviceId: json[r'deviceId'], + states: AutomationState.listFromJson(json[r'states']), + rawRequest: json[r'rawRequest'], + providerId: json[r'providerId'], + type: ActionType.fromJson(json[r'type']), + isForce: json[r'isForce'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Action.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] = Action.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Action-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] = Action.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/action_type.dart b/mycore_api_old/lib/model/action_type.dart new file mode 100644 index 0000000..33387c8 --- /dev/null +++ b/mycore_api_old/lib/model/action_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 ActionType { + /// Instantiate a new enum with the provided [value]. + const ActionType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const DELAY = ActionType._(r'DELAY'); + static const DEVICE = ActionType._(r'DEVICE'); + static const HTTP = ActionType._(r'HTTP'); + static const zIGBEE2MQTT = ActionType._(r'ZIGBEE2MQTT'); + static const MQTT = ActionType._(r'MQTT'); + static const GROUP = ActionType._(r'GROUP'); + + /// List of all possible values in this [enum][ActionType]. + static const values = [ + DELAY, + DEVICE, + HTTP, + zIGBEE2MQTT, + MQTT, + GROUP, + ]; + + static ActionType fromJson(dynamic value) => + ActionTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ActionType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ActionType] to String, +/// and [decode] dynamic data back to [ActionType]. +class ActionTypeTypeTransformer { + const ActionTypeTypeTransformer._(); + + factory ActionTypeTypeTransformer() => _instance ??= ActionTypeTypeTransformer._(); + + String encode(ActionType data) => data.value; + + /// Decodes a [dynamic value][data] to a ActionType. + /// + /// 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. + ActionType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'DELAY': return ActionType.DELAY; + case r'DEVICE': return ActionType.DEVICE; + case r'HTTP': return ActionType.HTTP; + case r'ZIGBEE2MQTT': return ActionType.zIGBEE2MQTT; + case r'MQTT': return ActionType.MQTT; + case r'GROUP': return ActionType.GROUP; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ActionTypeTypeTransformer] instance. + static ActionTypeTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/alarm_mode.dart b/mycore_api_old/lib/model/alarm_mode.dart new file mode 100644 index 0000000..381cade --- /dev/null +++ b/mycore_api_old/lib/model/alarm_mode.dart @@ -0,0 +1,194 @@ +// +// 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 AlarmMode { + /// Returns a new [AlarmMode] instance. + AlarmMode({ + this.id, + this.homeId, + this.name, + this.activated, + this.isDefault, + this.notification, + this.createdDate, + this.updatedDate, + this.type, + this.programmedMode, + this.geolocalizedMode, + this.triggers, + this.actions, + this.devicesIds, + }); + + String id; + + String homeId; + + String name; + + bool activated; + + bool isDefault; + + bool notification; + + DateTime createdDate; + + DateTime updatedDate; + + AlarmType type; + + ProgrammedMode programmedMode; + + GeolocalizedMode geolocalizedMode; + + List triggers; + + List actions; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmMode && + other.id == id && + other.homeId == homeId && + other.name == name && + other.activated == activated && + other.isDefault == isDefault && + other.notification == notification && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.type == type && + other.programmedMode == programmedMode && + other.geolocalizedMode == geolocalizedMode && + other.triggers == triggers && + other.actions == actions && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (activated == null ? 0 : activated.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (notification == null ? 0 : notification.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (type == null ? 0 : type.hashCode) + + (programmedMode == null ? 0 : programmedMode.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'AlarmMode[id=$id, homeId=$homeId, name=$name, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, type=$type, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode, triggers=$triggers, actions=$actions, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (activated != null) { + json[r'activated'] = activated; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (notification != null) { + json[r'notification'] = notification; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (type != null) { + json[r'type'] = type; + } + if (programmedMode != null) { + json[r'programmedMode'] = programmedMode; + } + if (geolocalizedMode != null) { + json[r'geolocalizedMode'] = geolocalizedMode; + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [AlarmMode] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmMode fromJson(Map json) => json == null + ? null + : AlarmMode( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + activated: json[r'activated'], + isDefault: json[r'isDefault'], + notification: json[r'notification'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + type: AlarmType.fromJson(json[r'type']), + programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), + geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), + triggers: Trigger.listFromJson(json[r'triggers']), + actions: Action.listFromJson(json[r'actions']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmMode.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] = AlarmMode.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmMode-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] = AlarmMode.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto.dart b/mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto.dart new file mode 100644 index 0000000..1fea333 --- /dev/null +++ b/mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto.dart @@ -0,0 +1,183 @@ +// +// 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 AlarmModeCreateOrUpdateDetailDTO { + /// Returns a new [AlarmModeCreateOrUpdateDetailDTO] instance. + AlarmModeCreateOrUpdateDetailDTO({ + this.id, + this.homeId, + this.name, + this.type, + this.activated, + this.isDefault, + this.notification, + this.createdDate, + this.updatedDate, + this.triggers, + this.actions, + this.programmedMode, + this.geolocalizedMode, + }); + + String id; + + String homeId; + + String name; + + AlarmType type; + + bool activated; + + bool isDefault; + + bool notification; + + DateTime createdDate; + + DateTime updatedDate; + + List triggers; + + List actions; + + ProgrammedMode programmedMode; + + GeolocalizedMode geolocalizedMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.type == type && + other.activated == activated && + other.isDefault == isDefault && + other.notification == notification && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.triggers == triggers && + other.actions == actions && + other.programmedMode == programmedMode && + other.geolocalizedMode == geolocalizedMode; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (activated == null ? 0 : activated.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (notification == null ? 0 : notification.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (programmedMode == null ? 0 : programmedMode.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + + @override + String toString() => 'AlarmModeCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (activated != null) { + json[r'activated'] = activated; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (notification != null) { + json[r'notification'] = notification; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (programmedMode != null) { + json[r'programmedMode'] = programmedMode; + } + if (geolocalizedMode != null) { + json[r'geolocalizedMode'] = geolocalizedMode; + } + return json; + } + + /// Returns a new [AlarmModeCreateOrUpdateDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmModeCreateOrUpdateDetailDTO fromJson(Map json) => json == null + ? null + : AlarmModeCreateOrUpdateDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + type: AlarmType.fromJson(json[r'type']), + activated: json[r'activated'], + isDefault: json[r'isDefault'], + notification: json[r'notification'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + triggers: Trigger.listFromJson(json[r'triggers']), + actions: Action.listFromJson(json[r'actions']), + programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), + geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmModeCreateOrUpdateDetailDTO.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] = AlarmModeCreateOrUpdateDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmModeCreateOrUpdateDetailDTO-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] = AlarmModeCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart b/mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart new file mode 100644 index 0000000..e04b206 --- /dev/null +++ b/mycore_api_old/lib/model/alarm_mode_create_or_update_detail_dto_all_of.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 AlarmModeCreateOrUpdateDetailDTOAllOf { + /// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance. + AlarmModeCreateOrUpdateDetailDTOAllOf({ + this.triggers, + this.actions, + this.programmedMode, + this.geolocalizedMode, + }); + + List triggers; + + List actions; + + ProgrammedMode programmedMode; + + GeolocalizedMode geolocalizedMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTOAllOf && + other.triggers == triggers && + other.actions == actions && + other.programmedMode == programmedMode && + other.geolocalizedMode == geolocalizedMode; + + @override + int get hashCode => + (triggers == null ? 0 : triggers.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (programmedMode == null ? 0 : programmedMode.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + + @override + String toString() => 'AlarmModeCreateOrUpdateDetailDTOAllOf[triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; + + Map toJson() { + final json = {}; + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (programmedMode != null) { + json[r'programmedMode'] = programmedMode; + } + if (geolocalizedMode != null) { + json[r'geolocalizedMode'] = geolocalizedMode; + } + return json; + } + + /// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmModeCreateOrUpdateDetailDTOAllOf fromJson(Map json) => json == null + ? null + : AlarmModeCreateOrUpdateDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']), + actions: Action.listFromJson(json[r'actions']), + programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), + geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmModeCreateOrUpdateDetailDTOAllOf.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] = AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmModeCreateOrUpdateDetailDTOAllOf-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] = AlarmModeCreateOrUpdateDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_mode_detail_dto.dart b/mycore_api_old/lib/model/alarm_mode_detail_dto.dart new file mode 100644 index 0000000..4f15d1b --- /dev/null +++ b/mycore_api_old/lib/model/alarm_mode_detail_dto.dart @@ -0,0 +1,183 @@ +// +// 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 AlarmModeDetailDTO { + /// Returns a new [AlarmModeDetailDTO] instance. + AlarmModeDetailDTO({ + this.id, + this.homeId, + this.name, + this.type, + this.activated, + this.isDefault, + this.notification, + this.createdDate, + this.updatedDate, + this.triggers, + this.devices, + this.programmedMode, + this.geolocalizedMode, + }); + + String id; + + String homeId; + + String name; + + AlarmType type; + + bool activated; + + bool isDefault; + + bool notification; + + DateTime createdDate; + + DateTime updatedDate; + + List triggers; + + List devices; + + ProgrammedMode programmedMode; + + GeolocalizedMode geolocalizedMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.type == type && + other.activated == activated && + other.isDefault == isDefault && + other.notification == notification && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.triggers == triggers && + other.devices == devices && + other.programmedMode == programmedMode && + other.geolocalizedMode == geolocalizedMode; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (activated == null ? 0 : activated.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (notification == null ? 0 : notification.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (devices == null ? 0 : devices.hashCode) + + (programmedMode == null ? 0 : programmedMode.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + + @override + String toString() => 'AlarmModeDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (activated != null) { + json[r'activated'] = activated; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (notification != null) { + json[r'notification'] = notification; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (devices != null) { + json[r'devices'] = devices; + } + if (programmedMode != null) { + json[r'programmedMode'] = programmedMode; + } + if (geolocalizedMode != null) { + json[r'geolocalizedMode'] = geolocalizedMode; + } + return json; + } + + /// Returns a new [AlarmModeDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmModeDetailDTO fromJson(Map json) => json == null + ? null + : AlarmModeDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + type: AlarmType.fromJson(json[r'type']), + activated: json[r'activated'], + isDefault: json[r'isDefault'], + notification: json[r'notification'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + triggers: Trigger.listFromJson(json[r'triggers']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), + geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmModeDetailDTO.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] = AlarmModeDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmModeDetailDTO-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] = AlarmModeDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_mode_detail_dto_all_of.dart b/mycore_api_old/lib/model/alarm_mode_detail_dto_all_of.dart new file mode 100644 index 0000000..860a99e --- /dev/null +++ b/mycore_api_old/lib/model/alarm_mode_detail_dto_all_of.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 AlarmModeDetailDTOAllOf { + /// Returns a new [AlarmModeDetailDTOAllOf] instance. + AlarmModeDetailDTOAllOf({ + this.triggers, + this.devices, + this.programmedMode, + this.geolocalizedMode, + }); + + List triggers; + + List devices; + + ProgrammedMode programmedMode; + + GeolocalizedMode geolocalizedMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTOAllOf && + other.triggers == triggers && + other.devices == devices && + other.programmedMode == programmedMode && + other.geolocalizedMode == geolocalizedMode; + + @override + int get hashCode => + (triggers == null ? 0 : triggers.hashCode) + + (devices == null ? 0 : devices.hashCode) + + (programmedMode == null ? 0 : programmedMode.hashCode) + + (geolocalizedMode == null ? 0 : geolocalizedMode.hashCode); + + @override + String toString() => 'AlarmModeDetailDTOAllOf[triggers=$triggers, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]'; + + Map toJson() { + final json = {}; + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (devices != null) { + json[r'devices'] = devices; + } + if (programmedMode != null) { + json[r'programmedMode'] = programmedMode; + } + if (geolocalizedMode != null) { + json[r'geolocalizedMode'] = geolocalizedMode; + } + return json; + } + + /// Returns a new [AlarmModeDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmModeDetailDTOAllOf fromJson(Map json) => json == null + ? null + : AlarmModeDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']), + geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmModeDetailDTOAllOf.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] = AlarmModeDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmModeDetailDTOAllOf-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] = AlarmModeDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_mode_dto.dart b/mycore_api_old/lib/model/alarm_mode_dto.dart new file mode 100644 index 0000000..86f85cf --- /dev/null +++ b/mycore_api_old/lib/model/alarm_mode_dto.dart @@ -0,0 +1,147 @@ +// +// 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 AlarmModeDTO { + /// Returns a new [AlarmModeDTO] instance. + AlarmModeDTO({ + this.id, + this.homeId, + this.name, + this.type, + this.activated, + this.isDefault, + this.notification, + this.createdDate, + this.updatedDate, + }); + + String id; + + String homeId; + + String name; + + AlarmType type; + + bool activated; + + bool isDefault; + + bool notification; + + DateTime createdDate; + + DateTime updatedDate; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmModeDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.type == type && + other.activated == activated && + other.isDefault == isDefault && + other.notification == notification && + other.createdDate == createdDate && + other.updatedDate == updatedDate; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (activated == null ? 0 : activated.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (notification == null ? 0 : notification.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode); + + @override + String toString() => 'AlarmModeDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (activated != null) { + json[r'activated'] = activated; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (notification != null) { + json[r'notification'] = notification; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [AlarmModeDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmModeDTO fromJson(Map json) => json == null + ? null + : AlarmModeDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + type: AlarmType.fromJson(json[r'type']), + activated: json[r'activated'], + isDefault: json[r'isDefault'], + notification: json[r'notification'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmModeDTO.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] = AlarmModeDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmModeDTO-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] = AlarmModeDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_triggered.dart b/mycore_api_old/lib/model/alarm_triggered.dart new file mode 100644 index 0000000..04e52c8 --- /dev/null +++ b/mycore_api_old/lib/model/alarm_triggered.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 AlarmTriggered { + /// Returns a new [AlarmTriggered] instance. + AlarmTriggered({ + this.alarmModeId, + this.alarmModeName, + this.type, + }); + + String alarmModeId; + + String alarmModeName; + + AlarmType type; + + @override + bool operator ==(Object other) => identical(this, other) || other is AlarmTriggered && + other.alarmModeId == alarmModeId && + other.alarmModeName == alarmModeName && + other.type == type; + + @override + int get hashCode => + (alarmModeId == null ? 0 : alarmModeId.hashCode) + + (alarmModeName == null ? 0 : alarmModeName.hashCode) + + (type == null ? 0 : type.hashCode); + + @override + String toString() => 'AlarmTriggered[alarmModeId=$alarmModeId, alarmModeName=$alarmModeName, type=$type]'; + + Map toJson() { + final json = {}; + if (alarmModeId != null) { + json[r'alarmModeId'] = alarmModeId; + } + if (alarmModeName != null) { + json[r'alarmModeName'] = alarmModeName; + } + if (type != null) { + json[r'type'] = type; + } + return json; + } + + /// Returns a new [AlarmTriggered] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AlarmTriggered fromJson(Map json) => json == null + ? null + : AlarmTriggered( + alarmModeId: json[r'alarmModeId'], + alarmModeName: json[r'alarmModeName'], + type: AlarmType.fromJson(json[r'type']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AlarmTriggered.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] = AlarmTriggered.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AlarmTriggered-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] = AlarmTriggered.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/alarm_type.dart b/mycore_api_old/lib/model/alarm_type.dart new file mode 100644 index 0000000..3cbbc37 --- /dev/null +++ b/mycore_api_old/lib/model/alarm_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 AlarmType { + /// Instantiate a new enum with the provided [value]. + const AlarmType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const home = AlarmType._(r'Home'); + static const absent = AlarmType._(r'Absent'); + static const geolocalized = AlarmType._(r'Geolocalized'); + static const programmed = AlarmType._(r'Programmed'); + static const desarmed = AlarmType._(r'Desarmed'); + static const custom = AlarmType._(r'Custom'); + + /// List of all possible values in this [enum][AlarmType]. + static const values = [ + home, + absent, + geolocalized, + programmed, + desarmed, + custom, + ]; + + static AlarmType fromJson(dynamic value) => + AlarmTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => AlarmType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [AlarmType] to String, +/// and [decode] dynamic data back to [AlarmType]. +class AlarmTypeTypeTransformer { + const AlarmTypeTypeTransformer._(); + + factory AlarmTypeTypeTransformer() => _instance ??= AlarmTypeTypeTransformer._(); + + String encode(AlarmType data) => data.value; + + /// Decodes a [dynamic value][data] to a AlarmType. + /// + /// 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. + AlarmType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Home': return AlarmType.home; + case r'Absent': return AlarmType.absent; + case r'Geolocalized': return AlarmType.geolocalized; + case r'Programmed': return AlarmType.programmed; + case r'Desarmed': return AlarmType.desarmed; + case r'Custom': return AlarmType.custom; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [AlarmTypeTypeTransformer] instance. + static AlarmTypeTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/automation.dart b/mycore_api_old/lib/model/automation.dart similarity index 100% rename from mycore_api/lib/model/automation.dart rename to mycore_api_old/lib/model/automation.dart diff --git a/mycore_api/lib/model/automation_create_or_update_detail_dto.dart b/mycore_api_old/lib/model/automation_create_or_update_detail_dto.dart similarity index 100% rename from mycore_api/lib/model/automation_create_or_update_detail_dto.dart rename to mycore_api_old/lib/model/automation_create_or_update_detail_dto.dart diff --git a/mycore_api/lib/model/automation_create_or_update_detail_dto_all_of.dart b/mycore_api_old/lib/model/automation_create_or_update_detail_dto_all_of.dart similarity index 100% rename from mycore_api/lib/model/automation_create_or_update_detail_dto_all_of.dart rename to mycore_api_old/lib/model/automation_create_or_update_detail_dto_all_of.dart diff --git a/mycore_api_old/lib/model/automation_detail_dto.dart b/mycore_api_old/lib/model/automation_detail_dto.dart new file mode 100644 index 0000000..1e3d4cf --- /dev/null +++ b/mycore_api_old/lib/model/automation_detail_dto.dart @@ -0,0 +1,158 @@ +// +// 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 AutomationDetailDTO { + /// Returns a new [AutomationDetailDTO] instance. + AutomationDetailDTO({ + this.id, + this.name, + this.active, + this.homeId, + this.createdDate, + this.updatedDate, + this.triggers, + this.conditions, + this.actions, + this.devicesIds, + }); + + String id; + + String name; + + bool active; + + String homeId; + + DateTime createdDate; + + DateTime updatedDate; + + List triggers; + + List conditions; + + List actions; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationDetailDTO && + other.id == id && + other.name == name && + other.active == active && + other.homeId == homeId && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (active == null ? 0 : active.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'AutomationDetailDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (active != null) { + json[r'active'] = active; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [AutomationDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationDetailDTO fromJson(Map json) => json == null + ? null + : AutomationDetailDTO( + id: json[r'id'], + name: json[r'name'], + active: json[r'active'], + homeId: json[r'homeId'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationDetailDTO.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] = AutomationDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationDetailDTO-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] = AutomationDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/automation_detail_dto_all_of.dart b/mycore_api_old/lib/model/automation_detail_dto_all_of.dart new file mode 100644 index 0000000..155dea7 --- /dev/null +++ b/mycore_api_old/lib/model/automation_detail_dto_all_of.dart @@ -0,0 +1,100 @@ +// +// 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 AutomationDetailDTOAllOf { + /// Returns a new [AutomationDetailDTOAllOf] instance. + AutomationDetailDTOAllOf({ + this.triggers, + this.conditions, + this.actions, + this.devicesIds, + }); + + List triggers; + + List conditions; + + List actions; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationDetailDTOAllOf && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'AutomationDetailDTOAllOf[triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [AutomationDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationDetailDTOAllOf fromJson(Map json) => json == null + ? null + : AutomationDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationDetailDTOAllOf.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] = AutomationDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationDetailDTOAllOf-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] = AutomationDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/automation_dto.dart b/mycore_api_old/lib/model/automation_dto.dart new file mode 100644 index 0000000..1a94deb --- /dev/null +++ b/mycore_api_old/lib/model/automation_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 AutomationDTO { + /// Returns a new [AutomationDTO] instance. + AutomationDTO({ + this.id, + this.name, + this.active, + this.homeId, + this.createdDate, + this.updatedDate, + }); + + String id; + + String name; + + bool active; + + String homeId; + + DateTime createdDate; + + DateTime updatedDate; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationDTO && + other.id == id && + other.name == name && + other.active == active && + other.homeId == homeId && + other.createdDate == createdDate && + other.updatedDate == updatedDate; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (active == null ? 0 : active.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode); + + @override + String toString() => 'AutomationDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (active != null) { + json[r'active'] = active; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [AutomationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationDTO fromJson(Map json) => json == null + ? null + : AutomationDTO( + id: json[r'id'], + name: json[r'name'], + active: json[r'active'], + homeId: json[r'homeId'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationDTO.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] = AutomationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationDTO-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] = AutomationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/automation_state.dart b/mycore_api_old/lib/model/automation_state.dart new file mode 100644 index 0000000..7c55189 --- /dev/null +++ b/mycore_api_old/lib/model/automation_state.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 AutomationState { + /// Returns a new [AutomationState] instance. + AutomationState({ + this.name, + this.value, + }); + + String name; + + String value; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationState && + other.name == name && + other.value == value; + + @override + int get hashCode => + (name == null ? 0 : name.hashCode) + + (value == null ? 0 : value.hashCode); + + @override + String toString() => 'AutomationState[name=$name, value=$value]'; + + Map toJson() { + final json = {}; + if (name != null) { + json[r'name'] = name; + } + if (value != null) { + json[r'value'] = value; + } + return json; + } + + /// Returns a new [AutomationState] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationState fromJson(Map json) => json == null + ? null + : AutomationState( + name: json[r'name'], + value: json[r'value'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationState.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] = AutomationState.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationState-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] = AutomationState.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/automation_triggered.dart b/mycore_api_old/lib/model/automation_triggered.dart new file mode 100644 index 0000000..8fcecbc --- /dev/null +++ b/mycore_api_old/lib/model/automation_triggered.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 AutomationTriggered { + /// Returns a new [AutomationTriggered] instance. + AutomationTriggered({ + this.automationId, + this.automationName, + }); + + String automationId; + + String automationName; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationTriggered && + other.automationId == automationId && + other.automationName == automationName; + + @override + int get hashCode => + (automationId == null ? 0 : automationId.hashCode) + + (automationName == null ? 0 : automationName.hashCode); + + @override + String toString() => 'AutomationTriggered[automationId=$automationId, automationName=$automationName]'; + + Map toJson() { + final json = {}; + if (automationId != null) { + json[r'automationId'] = automationId; + } + if (automationName != null) { + json[r'automationName'] = automationName; + } + return json; + } + + /// Returns a new [AutomationTriggered] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationTriggered fromJson(Map json) => json == null + ? null + : AutomationTriggered( + automationId: json[r'automationId'], + automationName: json[r'automationName'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationTriggered.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] = AutomationTriggered.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationTriggered-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] = AutomationTriggered.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/azure_ad_auth_model.dart b/mycore_api_old/lib/model/azure_ad_auth_model.dart new file mode 100644 index 0000000..718d9cb --- /dev/null +++ b/mycore_api_old/lib/model/azure_ad_auth_model.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 AzureADAuthModel { + /// Returns a new [AzureADAuthModel] instance. + AzureADAuthModel({ + this.apiKey, + }); + + String apiKey; + + @override + bool operator ==(Object other) => identical(this, other) || other is AzureADAuthModel && + other.apiKey == apiKey; + + @override + int get hashCode => + (apiKey == null ? 0 : apiKey.hashCode); + + @override + String toString() => 'AzureADAuthModel[apiKey=$apiKey]'; + + Map toJson() { + final json = {}; + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + return json; + } + + /// Returns a new [AzureADAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AzureADAuthModel fromJson(Map json) => json == null + ? null + : AzureADAuthModel( + apiKey: json[r'apiKey'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AzureADAuthModel.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] = AzureADAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AzureADAuthModel-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] = AzureADAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/book.dart b/mycore_api_old/lib/model/book.dart new file mode 100644 index 0000000..a36138b --- /dev/null +++ b/mycore_api_old/lib/model/book.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 Book { + /// Returns a new [Book] instance. + Book({ + this.id, + this.bookName, + this.price, + this.category, + this.author, + }); + + String id; + + String bookName; + + num price; + + String category; + + String author; + + @override + bool operator ==(Object other) => identical(this, other) || other is Book && + other.id == id && + other.bookName == bookName && + other.price == price && + other.category == category && + other.author == author; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (bookName == null ? 0 : bookName.hashCode) + + (price == null ? 0 : price.hashCode) + + (category == null ? 0 : category.hashCode) + + (author == null ? 0 : author.hashCode); + + @override + String toString() => 'Book[id=$id, bookName=$bookName, price=$price, category=$category, author=$author]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (bookName != null) { + json[r'bookName'] = bookName; + } + if (price != null) { + json[r'price'] = price; + } + if (category != null) { + json[r'category'] = category; + } + if (author != null) { + json[r'author'] = author; + } + return json; + } + + /// Returns a new [Book] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Book fromJson(Map json) => json == null + ? null + : Book( + id: json[r'id'], + bookName: json[r'bookName'], + price: json[r'price'] == null ? + null : + json[r'price'].toDouble(), + category: json[r'category'], + author: json[r'author'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Book.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] = Book.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Book-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] = Book.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/condition.dart b/mycore_api_old/lib/model/condition.dart new file mode 100644 index 0000000..390b350 --- /dev/null +++ b/mycore_api_old/lib/model/condition.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 Condition { + /// Returns a new [Condition] instance. + Condition({ + this.deviceId, + this.state, + this.startTime, + this.endTime, + this.type, + this.value, + }); + + String deviceId; + + AutomationState state; + + String startTime; + + String endTime; + + ConditionType type; + + ConditionValue value; + + @override + bool operator ==(Object other) => identical(this, other) || other is Condition && + other.deviceId == deviceId && + other.state == state && + other.startTime == startTime && + other.endTime == endTime && + other.type == type && + other.value == value; + + @override + int get hashCode => + (deviceId == null ? 0 : deviceId.hashCode) + + (state == null ? 0 : state.hashCode) + + (startTime == null ? 0 : startTime.hashCode) + + (endTime == null ? 0 : endTime.hashCode) + + (type == null ? 0 : type.hashCode) + + (value == null ? 0 : value.hashCode); + + @override + String toString() => 'Condition[deviceId=$deviceId, state=$state, startTime=$startTime, endTime=$endTime, type=$type, value=$value]'; + + Map toJson() { + final json = {}; + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (state != null) { + json[r'state'] = state; + } + if (startTime != null) { + json[r'startTime'] = startTime; + } + if (endTime != null) { + json[r'endTime'] = endTime; + } + if (type != null) { + json[r'type'] = type; + } + if (value != null) { + json[r'value'] = value; + } + return json; + } + + /// Returns a new [Condition] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Condition fromJson(Map json) => json == null + ? null + : Condition( + deviceId: json[r'deviceId'], + state: AutomationState.fromJson(json[r'state']), + startTime: json[r'startTime'], + endTime: json[r'endTime'], + type: ConditionType.fromJson(json[r'type']), + value: ConditionValue.fromJson(json[r'value']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Condition.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] = Condition.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Condition-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] = Condition.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/condition_type.dart b/mycore_api_old/lib/model/condition_type.dart new file mode 100644 index 0000000..f95d569 --- /dev/null +++ b/mycore_api_old/lib/model/condition_type.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 + +part of openapi.api; + + +class ConditionType { + /// Instantiate a new enum with the provided [value]. + const ConditionType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const STATE = ConditionType._(r'STATE'); + static const TIME = ConditionType._(r'TIME'); + + /// List of all possible values in this [enum][ConditionType]. + static const values = [ + STATE, + TIME, + ]; + + static ConditionType fromJson(dynamic value) => + ConditionTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ConditionType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ConditionType] to String, +/// and [decode] dynamic data back to [ConditionType]. +class ConditionTypeTypeTransformer { + const ConditionTypeTypeTransformer._(); + + factory ConditionTypeTypeTransformer() => _instance ??= ConditionTypeTypeTransformer._(); + + String encode(ConditionType data) => data.value; + + /// Decodes a [dynamic value][data] to a ConditionType. + /// + /// 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. + ConditionType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'STATE': return ConditionType.STATE; + case r'TIME': return ConditionType.TIME; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ConditionTypeTypeTransformer] instance. + static ConditionTypeTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/condition_value.dart b/mycore_api_old/lib/model/condition_value.dart new file mode 100644 index 0000000..aa7d9d2 --- /dev/null +++ b/mycore_api_old/lib/model/condition_value.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 ConditionValue { + /// Instantiate a new enum with the provided [value]. + const ConditionValue._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const EQUAL = ConditionValue._(r'EQUAL'); + static const NOT_EQUAL = ConditionValue._(r'NOT_EQUAL'); + static const BIGGER = ConditionValue._(r'BIGGER'); + static const BIGGEST = ConditionValue._(r'BIGGEST'); + static const SMALLER = ConditionValue._(r'SMALLER'); + static const SMALLEST = ConditionValue._(r'SMALLEST'); + + /// List of all possible values in this [enum][ConditionValue]. + static const values = [ + EQUAL, + NOT_EQUAL, + BIGGER, + BIGGEST, + SMALLER, + SMALLEST, + ]; + + static ConditionValue fromJson(dynamic value) => + ConditionValueTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ConditionValue.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ConditionValue] to String, +/// and [decode] dynamic data back to [ConditionValue]. +class ConditionValueTypeTransformer { + const ConditionValueTypeTransformer._(); + + factory ConditionValueTypeTransformer() => _instance ??= ConditionValueTypeTransformer._(); + + String encode(ConditionValue data) => data.value; + + /// Decodes a [dynamic value][data] to a ConditionValue. + /// + /// 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. + ConditionValue decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'EQUAL': return ConditionValue.EQUAL; + case r'NOT_EQUAL': return ConditionValue.NOT_EQUAL; + case r'BIGGER': return ConditionValue.BIGGER; + case r'BIGGEST': return ConditionValue.BIGGEST; + case r'SMALLER': return ConditionValue.SMALLER; + case r'SMALLEST': return ConditionValue.SMALLEST; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ConditionValueTypeTransformer] instance. + static ConditionValueTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/connection_status.dart b/mycore_api_old/lib/model/connection_status.dart new file mode 100644 index 0000000..b690d09 --- /dev/null +++ b/mycore_api_old/lib/model/connection_status.dart @@ -0,0 +1,79 @@ +// +// 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 ConnectionStatus { + /// Instantiate a new enum with the provided [value]. + const ConnectionStatus._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const connected = ConnectionStatus._(r'Connected'); + static const disconnected = ConnectionStatus._(r'Disconnected'); + static const unknown = ConnectionStatus._(r'Unknown'); + + /// List of all possible values in this [enum][ConnectionStatus]. + static const values = [ + connected, + disconnected, + unknown, + ]; + + static ConnectionStatus fromJson(dynamic value) => + ConnectionStatusTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ConnectionStatus.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ConnectionStatus] to String, +/// and [decode] dynamic data back to [ConnectionStatus]. +class ConnectionStatusTypeTransformer { + const ConnectionStatusTypeTransformer._(); + + factory ConnectionStatusTypeTransformer() => _instance ??= ConnectionStatusTypeTransformer._(); + + String encode(ConnectionStatus data) => data.value; + + /// Decodes a [dynamic value][data] to a ConnectionStatus. + /// + /// 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. + ConnectionStatus decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Connected': return ConnectionStatus.connected; + case r'Disconnected': return ConnectionStatus.disconnected; + case r'Unknown': return ConnectionStatus.unknown; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ConnectionStatusTypeTransformer] instance. + static ConnectionStatusTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/create_or_update_home_dto.dart b/mycore_api_old/lib/model/create_or_update_home_dto.dart new file mode 100644 index 0000000..8bc499e --- /dev/null +++ b/mycore_api_old/lib/model/create_or_update_home_dto.dart @@ -0,0 +1,140 @@ +// +// 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 CreateOrUpdateHomeDTO { + /// Returns a new [CreateOrUpdateHomeDTO] instance. + CreateOrUpdateHomeDTO({ + this.id, + this.name, + this.isAlarm, + this.isDefault, + this.currentAlarmMode, + this.createdDate, + this.updatedDate, + this.usersIds, + }); + + String id; + + String name; + + bool isAlarm; + + bool isDefault; + + AlarmModeDTO currentAlarmMode; + + DateTime createdDate; + + DateTime updatedDate; + + List usersIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateOrUpdateHomeDTO && + other.id == id && + other.name == name && + other.isAlarm == isAlarm && + other.isDefault == isDefault && + other.currentAlarmMode == currentAlarmMode && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.usersIds == usersIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (currentAlarmMode == null ? 0 : currentAlarmMode.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (usersIds == null ? 0 : usersIds.hashCode); + + @override + String toString() => 'CreateOrUpdateHomeDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (currentAlarmMode != null) { + json[r'currentAlarmMode'] = currentAlarmMode; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (usersIds != null) { + json[r'usersIds'] = usersIds; + } + return json; + } + + /// Returns a new [CreateOrUpdateHomeDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static CreateOrUpdateHomeDTO fromJson(Map json) => json == null + ? null + : CreateOrUpdateHomeDTO( + id: json[r'id'], + name: json[r'name'], + isAlarm: json[r'isAlarm'], + isDefault: json[r'isDefault'], + currentAlarmMode: AlarmModeDTO.fromJson(json[r'currentAlarmMode']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + usersIds: json[r'usersIds'] == null + ? null + : (json[r'usersIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => CreateOrUpdateHomeDTO.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] = CreateOrUpdateHomeDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of CreateOrUpdateHomeDTO-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] = CreateOrUpdateHomeDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/create_or_update_home_dto_all_of.dart b/mycore_api_old/lib/model/create_or_update_home_dto_all_of.dart new file mode 100644 index 0000000..fb66ebf --- /dev/null +++ b/mycore_api_old/lib/model/create_or_update_home_dto_all_of.dart @@ -0,0 +1,73 @@ +// +// 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 CreateOrUpdateHomeDTOAllOf { + /// Returns a new [CreateOrUpdateHomeDTOAllOf] instance. + CreateOrUpdateHomeDTOAllOf({ + this.usersIds, + }); + + List usersIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateOrUpdateHomeDTOAllOf && + other.usersIds == usersIds; + + @override + int get hashCode => + (usersIds == null ? 0 : usersIds.hashCode); + + @override + String toString() => 'CreateOrUpdateHomeDTOAllOf[usersIds=$usersIds]'; + + Map toJson() { + final json = {}; + if (usersIds != null) { + json[r'usersIds'] = usersIds; + } + return json; + } + + /// Returns a new [CreateOrUpdateHomeDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static CreateOrUpdateHomeDTOAllOf fromJson(Map json) => json == null + ? null + : CreateOrUpdateHomeDTOAllOf( + usersIds: json[r'usersIds'] == null + ? null + : (json[r'usersIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => CreateOrUpdateHomeDTOAllOf.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] = CreateOrUpdateHomeDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of CreateOrUpdateHomeDTOAllOf-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] = CreateOrUpdateHomeDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/device.dart b/mycore_api_old/lib/model/device.dart similarity index 100% rename from mycore_api/lib/model/device.dart rename to mycore_api_old/lib/model/device.dart diff --git a/mycore_api_old/lib/model/device_detail_dto.dart b/mycore_api_old/lib/model/device_detail_dto.dart new file mode 100644 index 0000000..3f24293 --- /dev/null +++ b/mycore_api_old/lib/model/device_detail_dto.dart @@ -0,0 +1,315 @@ +// +// 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.homeId, + this.description, + this.name, + this.model, + this.type, + this.status, + this.connectionStatus, + this.roomId, + this.providerId, + this.providerName, + this.lastStateDate, + this.battery, + this.batteryStatus, + this.firmwareVersion, + this.hardwareVersion, + this.port, + this.meansOfCommunications, + this.createdDate, + this.updatedDate, + this.lastState, + this.ipAddress, + this.serviceIdentification, + this.manufacturerName, + this.groupIds, + this.properties, + this.supportedOperations, + }); + + String id; + + String homeId; + + String description; + + String name; + + String model; + + DeviceType type; + + bool status; + + ConnectionStatus connectionStatus; + + String roomId; + + String providerId; + + String providerName; + + DateTime lastStateDate; + + bool battery; + + int batteryStatus; + + String firmwareVersion; + + String hardwareVersion; + + int port; + + List meansOfCommunications; + + DateTime createdDate; + + DateTime updatedDate; + + String lastState; + + String ipAddress; + + String serviceIdentification; + + String manufacturerName; + + List groupIds; + + String properties; + + List supportedOperations; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && + other.id == id && + other.homeId == homeId && + other.description == description && + other.name == name && + other.model == model && + other.type == type && + other.status == status && + other.connectionStatus == connectionStatus && + other.roomId == roomId && + other.providerId == providerId && + other.providerName == providerName && + other.lastStateDate == lastStateDate && + other.battery == battery && + other.batteryStatus == batteryStatus && + other.firmwareVersion == firmwareVersion && + other.hardwareVersion == hardwareVersion && + other.port == port && + other.meansOfCommunications == meansOfCommunications && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.lastState == lastState && + other.ipAddress == ipAddress && + other.serviceIdentification == serviceIdentification && + other.manufacturerName == manufacturerName && + other.groupIds == groupIds && + other.properties == properties && + other.supportedOperations == supportedOperations; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (description == null ? 0 : description.hashCode) + + (name == null ? 0 : name.hashCode) + + (model == null ? 0 : model.hashCode) + + (type == null ? 0 : type.hashCode) + + (status == null ? 0 : status.hashCode) + + (connectionStatus == null ? 0 : connectionStatus.hashCode) + + (roomId == null ? 0 : roomId.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (providerName == null ? 0 : providerName.hashCode) + + (lastStateDate == null ? 0 : lastStateDate.hashCode) + + (battery == null ? 0 : battery.hashCode) + + (batteryStatus == null ? 0 : batteryStatus.hashCode) + + (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + + (port == null ? 0 : port.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (lastState == null ? 0 : lastState.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + + (manufacturerName == null ? 0 : manufacturerName.hashCode) + + (groupIds == null ? 0 : groupIds.hashCode) + + (properties == null ? 0 : properties.hashCode) + + (supportedOperations == null ? 0 : supportedOperations.hashCode); + + @override + String toString() => 'DeviceDetailDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (description != null) { + json[r'description'] = description; + } + if (name != null) { + json[r'name'] = name; + } + if (model != null) { + json[r'model'] = model; + } + if (type != null) { + json[r'type'] = type; + } + if (status != null) { + json[r'status'] = status; + } + if (connectionStatus != null) { + json[r'connectionStatus'] = connectionStatus; + } + if (roomId != null) { + json[r'roomId'] = roomId; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (providerName != null) { + json[r'providerName'] = providerName; + } + if (lastStateDate != null) { + json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + } + if (battery != null) { + json[r'battery'] = battery; + } + if (batteryStatus != null) { + json[r'batteryStatus'] = batteryStatus; + } + if (firmwareVersion != null) { + json[r'firmwareVersion'] = firmwareVersion; + } + if (hardwareVersion != null) { + json[r'hardwareVersion'] = hardwareVersion; + } + if (port != null) { + json[r'port'] = port; + } + if (meansOfCommunications != null) { + json[r'meansOfCommunications'] = meansOfCommunications; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (lastState != null) { + json[r'lastState'] = lastState; + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (serviceIdentification != null) { + json[r'serviceIdentification'] = serviceIdentification; + } + if (manufacturerName != null) { + json[r'manufacturerName'] = manufacturerName; + } + if (groupIds != null) { + json[r'groupIds'] = groupIds; + } + if (properties != null) { + json[r'properties'] = properties; + } + if (supportedOperations != null) { + json[r'supportedOperations'] = supportedOperations; + } + 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'], + homeId: json[r'homeId'], + description: json[r'description'], + name: json[r'name'], + model: json[r'model'], + type: DeviceType.fromJson(json[r'type']), + status: json[r'status'], + connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), + roomId: json[r'roomId'], + providerId: json[r'providerId'], + providerName: json[r'providerName'], + lastStateDate: json[r'lastStateDate'] == null + ? null + : DateTime.parse(json[r'lastStateDate']), + battery: json[r'battery'], + batteryStatus: json[r'batteryStatus'], + firmwareVersion: json[r'firmwareVersion'], + hardwareVersion: json[r'hardwareVersion'], + port: json[r'port'], + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + lastState: json[r'lastState'], + ipAddress: json[r'ipAddress'], + serviceIdentification: json[r'serviceIdentification'], + manufacturerName: json[r'manufacturerName'], + groupIds: json[r'groupIds'] == null + ? null + : (json[r'groupIds'] as List).cast(), + properties: json[r'properties'], + supportedOperations: json[r'supportedOperations'] == null + ? null + : (json[r'supportedOperations'] as List).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); + + 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/mycore_api_old/lib/model/device_detail_dto_all_of.dart b/mycore_api_old/lib/model/device_detail_dto_all_of.dart new file mode 100644 index 0000000..62a285f --- /dev/null +++ b/mycore_api_old/lib/model/device_detail_dto_all_of.dart @@ -0,0 +1,187 @@ +// +// 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.firmwareVersion, + this.hardwareVersion, + this.port, + this.meansOfCommunications, + this.createdDate, + this.updatedDate, + this.lastState, + this.ipAddress, + this.serviceIdentification, + this.manufacturerName, + this.groupIds, + this.properties, + this.supportedOperations, + }); + + String firmwareVersion; + + String hardwareVersion; + + int port; + + List meansOfCommunications; + + DateTime createdDate; + + DateTime updatedDate; + + String lastState; + + String ipAddress; + + String serviceIdentification; + + String manufacturerName; + + List groupIds; + + String properties; + + List supportedOperations; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && + other.firmwareVersion == firmwareVersion && + other.hardwareVersion == hardwareVersion && + other.port == port && + other.meansOfCommunications == meansOfCommunications && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.lastState == lastState && + other.ipAddress == ipAddress && + other.serviceIdentification == serviceIdentification && + other.manufacturerName == manufacturerName && + other.groupIds == groupIds && + other.properties == properties && + other.supportedOperations == supportedOperations; + + @override + int get hashCode => + (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + + (port == null ? 0 : port.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (lastState == null ? 0 : lastState.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + + (manufacturerName == null ? 0 : manufacturerName.hashCode) + + (groupIds == null ? 0 : groupIds.hashCode) + + (properties == null ? 0 : properties.hashCode) + + (supportedOperations == null ? 0 : supportedOperations.hashCode); + + @override + String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; + + Map toJson() { + final json = {}; + if (firmwareVersion != null) { + json[r'firmwareVersion'] = firmwareVersion; + } + if (hardwareVersion != null) { + json[r'hardwareVersion'] = hardwareVersion; + } + if (port != null) { + json[r'port'] = port; + } + if (meansOfCommunications != null) { + json[r'meansOfCommunications'] = meansOfCommunications; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (lastState != null) { + json[r'lastState'] = lastState; + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (serviceIdentification != null) { + json[r'serviceIdentification'] = serviceIdentification; + } + if (manufacturerName != null) { + json[r'manufacturerName'] = manufacturerName; + } + if (groupIds != null) { + json[r'groupIds'] = groupIds; + } + if (properties != null) { + json[r'properties'] = properties; + } + if (supportedOperations != null) { + json[r'supportedOperations'] = supportedOperations; + } + 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( + firmwareVersion: json[r'firmwareVersion'], + hardwareVersion: json[r'hardwareVersion'], + port: json[r'port'], + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + lastState: json[r'lastState'], + ipAddress: json[r'ipAddress'], + serviceIdentification: json[r'serviceIdentification'], + manufacturerName: json[r'manufacturerName'], + groupIds: json[r'groupIds'] == null + ? null + : (json[r'groupIds'] as List).cast(), + properties: json[r'properties'], + supportedOperations: json[r'supportedOperations'] == null + ? null + : (json[r'supportedOperations'] as List).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); + + 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/mycore_api_old/lib/model/device_state.dart b/mycore_api_old/lib/model/device_state.dart new file mode 100644 index 0000000..f5b19a0 --- /dev/null +++ b/mycore_api_old/lib/model/device_state.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 DeviceState { + /// Returns a new [DeviceState] instance. + DeviceState({ + this.deviceId, + this.deviceName, + this.message, + this.deviceType, + }); + + String deviceId; + + String deviceName; + + String message; + + DeviceType deviceType; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceState && + other.deviceId == deviceId && + other.deviceName == deviceName && + other.message == message && + other.deviceType == deviceType; + + @override + int get hashCode => + (deviceId == null ? 0 : deviceId.hashCode) + + (deviceName == null ? 0 : deviceName.hashCode) + + (message == null ? 0 : message.hashCode) + + (deviceType == null ? 0 : deviceType.hashCode); + + @override + String toString() => 'DeviceState[deviceId=$deviceId, deviceName=$deviceName, message=$message, deviceType=$deviceType]'; + + Map toJson() { + final json = {}; + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (deviceName != null) { + json[r'deviceName'] = deviceName; + } + if (message != null) { + json[r'message'] = message; + } + if (deviceType != null) { + json[r'deviceType'] = deviceType; + } + return json; + } + + /// Returns a new [DeviceState] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceState fromJson(Map json) => json == null + ? null + : DeviceState( + deviceId: json[r'deviceId'], + deviceName: json[r'deviceName'], + message: json[r'message'], + deviceType: DeviceType.fromJson(json[r'deviceType']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceState.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] = DeviceState.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceState-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] = DeviceState.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/device_summary_dto.dart b/mycore_api_old/lib/model/device_summary_dto.dart new file mode 100644 index 0000000..c4c1806 --- /dev/null +++ b/mycore_api_old/lib/model/device_summary_dto.dart @@ -0,0 +1,190 @@ +// +// 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 DeviceSummaryDTO { + /// Returns a new [DeviceSummaryDTO] instance. + DeviceSummaryDTO({ + this.id, + this.homeId, + this.description, + this.name, + this.model, + this.type, + this.status, + this.connectionStatus, + this.roomId, + this.providerId, + this.providerName, + this.lastStateDate, + this.battery, + this.batteryStatus, + }); + + String id; + + String homeId; + + String description; + + String name; + + String model; + + DeviceType type; + + bool status; + + ConnectionStatus connectionStatus; + + String roomId; + + String providerId; + + String providerName; + + DateTime lastStateDate; + + bool battery; + + int batteryStatus; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceSummaryDTO && + other.id == id && + other.homeId == homeId && + other.description == description && + other.name == name && + other.model == model && + other.type == type && + other.status == status && + other.connectionStatus == connectionStatus && + other.roomId == roomId && + other.providerId == providerId && + other.providerName == providerName && + other.lastStateDate == lastStateDate && + other.battery == battery && + other.batteryStatus == batteryStatus; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (description == null ? 0 : description.hashCode) + + (name == null ? 0 : name.hashCode) + + (model == null ? 0 : model.hashCode) + + (type == null ? 0 : type.hashCode) + + (status == null ? 0 : status.hashCode) + + (connectionStatus == null ? 0 : connectionStatus.hashCode) + + (roomId == null ? 0 : roomId.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (providerName == null ? 0 : providerName.hashCode) + + (lastStateDate == null ? 0 : lastStateDate.hashCode) + + (battery == null ? 0 : battery.hashCode) + + (batteryStatus == null ? 0 : batteryStatus.hashCode); + + @override + String toString() => 'DeviceSummaryDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (description != null) { + json[r'description'] = description; + } + if (name != null) { + json[r'name'] = name; + } + if (model != null) { + json[r'model'] = model; + } + if (type != null) { + json[r'type'] = type; + } + if (status != null) { + json[r'status'] = status; + } + if (connectionStatus != null) { + json[r'connectionStatus'] = connectionStatus; + } + if (roomId != null) { + json[r'roomId'] = roomId; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (providerName != null) { + json[r'providerName'] = providerName; + } + if (lastStateDate != null) { + json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + } + if (battery != null) { + json[r'battery'] = battery; + } + if (batteryStatus != null) { + json[r'batteryStatus'] = batteryStatus; + } + return json; + } + + /// Returns a new [DeviceSummaryDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceSummaryDTO fromJson(Map json) => json == null + ? null + : DeviceSummaryDTO( + id: json[r'id'], + homeId: json[r'homeId'], + description: json[r'description'], + name: json[r'name'], + model: json[r'model'], + type: DeviceType.fromJson(json[r'type']), + status: json[r'status'], + connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), + roomId: json[r'roomId'], + providerId: json[r'providerId'], + providerName: json[r'providerName'], + lastStateDate: json[r'lastStateDate'] == null + ? null + : DateTime.parse(json[r'lastStateDate']), + battery: json[r'battery'], + batteryStatus: json[r'batteryStatus'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceSummaryDTO.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] = DeviceSummaryDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceSummaryDTO-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] = DeviceSummaryDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/device_type.dart b/mycore_api_old/lib/model/device_type.dart new file mode 100644 index 0000000..46c5ca9 --- /dev/null +++ b/mycore_api_old/lib/model/device_type.dart @@ -0,0 +1,115 @@ +// +// 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 DeviceType { + /// Instantiate a new enum with the provided [value]. + const DeviceType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const sensor = DeviceType._(r'Sensor'); + static const actuator = DeviceType._(r'Actuator'); + static const camera = DeviceType._(r'Camera'); + static const switch_ = DeviceType._(r'Switch'); + static const light = DeviceType._(r'Light'); + static const sound = DeviceType._(r'Sound'); + static const plug = DeviceType._(r'Plug'); + static const multiplug = DeviceType._(r'Multiplug'); + static const thermostat = DeviceType._(r'Thermostat'); + static const valve = DeviceType._(r'Valve'); + static const door = DeviceType._(r'Door'); + static const environment = DeviceType._(r'Environment'); + static const motion = DeviceType._(r'Motion'); + static const gateway = DeviceType._(r'Gateway'); + static const unknown = DeviceType._(r'Unknown'); + + /// List of all possible values in this [enum][DeviceType]. + static const values = [ + sensor, + actuator, + camera, + switch_, + light, + sound, + plug, + multiplug, + thermostat, + valve, + door, + environment, + motion, + gateway, + unknown, + ]; + + static DeviceType fromJson(dynamic value) => + DeviceTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => DeviceType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [DeviceType] to String, +/// and [decode] dynamic data back to [DeviceType]. +class DeviceTypeTypeTransformer { + const DeviceTypeTypeTransformer._(); + + factory DeviceTypeTypeTransformer() => _instance ??= DeviceTypeTypeTransformer._(); + + String encode(DeviceType data) => data.value; + + /// Decodes a [dynamic value][data] to a DeviceType. + /// + /// 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. + DeviceType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Sensor': return DeviceType.sensor; + case r'Actuator': return DeviceType.actuator; + case r'Camera': return DeviceType.camera; + case r'Switch': return DeviceType.switch_; + case r'Light': return DeviceType.light; + case r'Sound': return DeviceType.sound; + case r'Plug': return DeviceType.plug; + case r'Multiplug': return DeviceType.multiplug; + case r'Thermostat': return DeviceType.thermostat; + case r'Valve': return DeviceType.valve; + case r'Door': return DeviceType.door; + case r'Environment': return DeviceType.environment; + case r'Motion': return DeviceType.motion; + case r'Gateway': return DeviceType.gateway; + case r'Unknown': return DeviceType.unknown; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [DeviceTypeTypeTransformer] instance. + static DeviceTypeTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/electricity_production.dart b/mycore_api_old/lib/model/electricity_production.dart new file mode 100644 index 0000000..372673c --- /dev/null +++ b/mycore_api_old/lib/model/electricity_production.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 ElectricityProduction { + /// Returns a new [ElectricityProduction] instance. + ElectricityProduction({ + this.id, + this.deviceId, + this.homeId, + this.watt, + this.ampere, + this.timestamp, + }); + + String id; + + String deviceId; + + String homeId; + + double watt; + + double ampere; + + DateTime timestamp; + + @override + bool operator ==(Object other) => identical(this, other) || other is ElectricityProduction && + other.id == id && + other.deviceId == deviceId && + other.homeId == homeId && + other.watt == watt && + other.ampere == ampere && + other.timestamp == timestamp; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (watt == null ? 0 : watt.hashCode) + + (ampere == null ? 0 : ampere.hashCode) + + (timestamp == null ? 0 : timestamp.hashCode); + + @override + String toString() => 'ElectricityProduction[id=$id, deviceId=$deviceId, homeId=$homeId, watt=$watt, ampere=$ampere, timestamp=$timestamp]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (watt != null) { + json[r'watt'] = watt; + } + if (ampere != null) { + json[r'ampere'] = ampere; + } + if (timestamp != null) { + json[r'timestamp'] = timestamp.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [ElectricityProduction] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ElectricityProduction fromJson(Map json) => json == null + ? null + : ElectricityProduction( + id: json[r'id'], + deviceId: json[r'deviceId'], + homeId: json[r'homeId'], + watt: json[r'watt'], + ampere: json[r'ampere'], + timestamp: json[r'timestamp'] == null + ? null + : DateTime.parse(json[r'timestamp']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ElectricityProduction.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] = ElectricityProduction.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ElectricityProduction-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] = ElectricityProduction.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_detail_dto.dart b/mycore_api_old/lib/model/event_detail_dto.dart new file mode 100644 index 0000000..23d7689 --- /dev/null +++ b/mycore_api_old/lib/model/event_detail_dto.dart @@ -0,0 +1,136 @@ +// +// 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 EventDetailDTO { + /// Returns a new [EventDetailDTO] instance. + EventDetailDTO({ + this.id, + this.homeId, + this.date, + this.type, + this.roomId, + this.deviceState, + this.automationTriggered, + this.alarmTriggered, + }); + + String id; + + String homeId; + + DateTime date; + + EventType type; + + String roomId; + + DeviceState deviceState; + + AutomationTriggered automationTriggered; + + AlarmTriggered alarmTriggered; + + @override + bool operator ==(Object other) => identical(this, other) || other is EventDetailDTO && + other.id == id && + other.homeId == homeId && + other.date == date && + other.type == type && + other.roomId == roomId && + other.deviceState == deviceState && + other.automationTriggered == automationTriggered && + other.alarmTriggered == alarmTriggered; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (date == null ? 0 : date.hashCode) + + (type == null ? 0 : type.hashCode) + + (roomId == null ? 0 : roomId.hashCode) + + (deviceState == null ? 0 : deviceState.hashCode) + + (automationTriggered == null ? 0 : automationTriggered.hashCode) + + (alarmTriggered == null ? 0 : alarmTriggered.hashCode); + + @override + String toString() => 'EventDetailDTO[id=$id, homeId=$homeId, date=$date, type=$type, roomId=$roomId, deviceState=$deviceState, automationTriggered=$automationTriggered, alarmTriggered=$alarmTriggered]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (date != null) { + json[r'date'] = date.toUtc().toIso8601String(); + } + if (type != null) { + json[r'type'] = type; + } + if (roomId != null) { + json[r'roomId'] = roomId; + } + if (deviceState != null) { + json[r'deviceState'] = deviceState; + } + if (automationTriggered != null) { + json[r'automationTriggered'] = automationTriggered; + } + if (alarmTriggered != null) { + json[r'alarmTriggered'] = alarmTriggered; + } + return json; + } + + /// Returns a new [EventDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static EventDetailDTO fromJson(Map json) => json == null + ? null + : EventDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + date: json[r'date'] == null + ? null + : DateTime.parse(json[r'date']), + type: EventType.fromJson(json[r'type']), + roomId: json[r'roomId'], + deviceState: DeviceState.fromJson(json[r'deviceState']), + automationTriggered: AutomationTriggered.fromJson(json[r'automationTriggered']), + alarmTriggered: AlarmTriggered.fromJson(json[r'alarmTriggered']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => EventDetailDTO.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] = EventDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of EventDetailDTO-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] = EventDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_detail_dto_all_of.dart b/mycore_api_old/lib/model/event_detail_dto_all_of.dart new file mode 100644 index 0000000..ce7227d --- /dev/null +++ b/mycore_api_old/lib/model/event_detail_dto_all_of.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 EventDetailDTOAllOf { + /// Returns a new [EventDetailDTOAllOf] instance. + EventDetailDTOAllOf({ + this.deviceState, + this.automationTriggered, + this.alarmTriggered, + }); + + DeviceState deviceState; + + AutomationTriggered automationTriggered; + + AlarmTriggered alarmTriggered; + + @override + bool operator ==(Object other) => identical(this, other) || other is EventDetailDTOAllOf && + other.deviceState == deviceState && + other.automationTriggered == automationTriggered && + other.alarmTriggered == alarmTriggered; + + @override + int get hashCode => + (deviceState == null ? 0 : deviceState.hashCode) + + (automationTriggered == null ? 0 : automationTriggered.hashCode) + + (alarmTriggered == null ? 0 : alarmTriggered.hashCode); + + @override + String toString() => 'EventDetailDTOAllOf[deviceState=$deviceState, automationTriggered=$automationTriggered, alarmTriggered=$alarmTriggered]'; + + Map toJson() { + final json = {}; + if (deviceState != null) { + json[r'deviceState'] = deviceState; + } + if (automationTriggered != null) { + json[r'automationTriggered'] = automationTriggered; + } + if (alarmTriggered != null) { + json[r'alarmTriggered'] = alarmTriggered; + } + return json; + } + + /// Returns a new [EventDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static EventDetailDTOAllOf fromJson(Map json) => json == null + ? null + : EventDetailDTOAllOf( + deviceState: DeviceState.fromJson(json[r'deviceState']), + automationTriggered: AutomationTriggered.fromJson(json[r'automationTriggered']), + alarmTriggered: AlarmTriggered.fromJson(json[r'alarmTriggered']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => EventDetailDTOAllOf.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] = EventDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of EventDetailDTOAllOf-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] = EventDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_dto.dart b/mycore_api_old/lib/model/event_dto.dart new file mode 100644 index 0000000..5b946e8 --- /dev/null +++ b/mycore_api_old/lib/model/event_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 EventDTO { + /// Returns a new [EventDTO] instance. + EventDTO({ + this.id, + this.homeId, + this.date, + this.type, + this.roomId, + }); + + String id; + + String homeId; + + DateTime date; + + EventType type; + + String roomId; + + @override + bool operator ==(Object other) => identical(this, other) || other is EventDTO && + other.id == id && + other.homeId == homeId && + other.date == date && + other.type == type && + other.roomId == roomId; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (date == null ? 0 : date.hashCode) + + (type == null ? 0 : type.hashCode) + + (roomId == null ? 0 : roomId.hashCode); + + @override + String toString() => 'EventDTO[id=$id, homeId=$homeId, date=$date, type=$type, roomId=$roomId]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (date != null) { + json[r'date'] = date.toUtc().toIso8601String(); + } + if (type != null) { + json[r'type'] = type; + } + if (roomId != null) { + json[r'roomId'] = roomId; + } + return json; + } + + /// Returns a new [EventDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static EventDTO fromJson(Map json) => json == null + ? null + : EventDTO( + id: json[r'id'], + homeId: json[r'homeId'], + date: json[r'date'] == null + ? null + : DateTime.parse(json[r'date']), + type: EventType.fromJson(json[r'type']), + roomId: json[r'roomId'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => EventDTO.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] = EventDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of EventDTO-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] = EventDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_filter.dart b/mycore_api_old/lib/model/event_filter.dart new file mode 100644 index 0000000..5e383ae --- /dev/null +++ b/mycore_api_old/lib/model/event_filter.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 EventFilter { + /// Returns a new [EventFilter] instance. + EventFilter({ + this.startIndex, + this.count, + this.dateStart, + this.dateEnd, + this.eventType, + this.deviceType, + }); + + int startIndex; + + int count; + + DateTime dateStart; + + DateTime dateEnd; + + EventType eventType; + + DeviceType deviceType; + + @override + bool operator ==(Object other) => identical(this, other) || other is EventFilter && + other.startIndex == startIndex && + other.count == count && + other.dateStart == dateStart && + other.dateEnd == dateEnd && + other.eventType == eventType && + other.deviceType == deviceType; + + @override + int get hashCode => + (startIndex == null ? 0 : startIndex.hashCode) + + (count == null ? 0 : count.hashCode) + + (dateStart == null ? 0 : dateStart.hashCode) + + (dateEnd == null ? 0 : dateEnd.hashCode) + + (eventType == null ? 0 : eventType.hashCode) + + (deviceType == null ? 0 : deviceType.hashCode); + + @override + String toString() => 'EventFilter[startIndex=$startIndex, count=$count, dateStart=$dateStart, dateEnd=$dateEnd, eventType=$eventType, deviceType=$deviceType]'; + + Map toJson() { + final json = {}; + if (startIndex != null) { + json[r'startIndex'] = startIndex; + } + if (count != null) { + json[r'count'] = count; + } + if (dateStart != null) { + json[r'dateStart'] = dateStart.toUtc().toIso8601String(); + } + if (dateEnd != null) { + json[r'dateEnd'] = dateEnd.toUtc().toIso8601String(); + } + if (eventType != null) { + json[r'eventType'] = eventType; + } + if (deviceType != null) { + json[r'deviceType'] = deviceType; + } + return json; + } + + /// Returns a new [EventFilter] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static EventFilter fromJson(Map json) => json == null + ? null + : EventFilter( + startIndex: json[r'startIndex'], + count: json[r'count'], + dateStart: json[r'dateStart'] == null + ? null + : DateTime.parse(json[r'dateStart']), + dateEnd: json[r'dateEnd'] == null + ? null + : DateTime.parse(json[r'dateEnd']), + eventType: EventType.fromJson(json[r'eventType']), + deviceType: DeviceType.fromJson(json[r'deviceType']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => EventFilter.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] = EventFilter.fromJson(v)); + } + return map; + } + + // maps a json object with a list of EventFilter-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] = EventFilter.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_home_filter.dart b/mycore_api_old/lib/model/event_home_filter.dart new file mode 100644 index 0000000..6b135dd --- /dev/null +++ b/mycore_api_old/lib/model/event_home_filter.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 EventHomeFilter { + /// Returns a new [EventHomeFilter] instance. + EventHomeFilter({ + this.startIndex, + this.count, + this.dateStart, + this.dateEnd, + this.eventType, + this.deviceType, + this.deviceId, + this.roomId, + }); + + int startIndex; + + int count; + + DateTime dateStart; + + DateTime dateEnd; + + EventType eventType; + + DeviceType deviceType; + + String deviceId; + + String roomId; + + @override + bool operator ==(Object other) => identical(this, other) || other is EventHomeFilter && + other.startIndex == startIndex && + other.count == count && + other.dateStart == dateStart && + other.dateEnd == dateEnd && + other.eventType == eventType && + other.deviceType == deviceType && + other.deviceId == deviceId && + other.roomId == roomId; + + @override + int get hashCode => + (startIndex == null ? 0 : startIndex.hashCode) + + (count == null ? 0 : count.hashCode) + + (dateStart == null ? 0 : dateStart.hashCode) + + (dateEnd == null ? 0 : dateEnd.hashCode) + + (eventType == null ? 0 : eventType.hashCode) + + (deviceType == null ? 0 : deviceType.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (roomId == null ? 0 : roomId.hashCode); + + @override + String toString() => 'EventHomeFilter[startIndex=$startIndex, count=$count, dateStart=$dateStart, dateEnd=$dateEnd, eventType=$eventType, deviceType=$deviceType, deviceId=$deviceId, roomId=$roomId]'; + + Map toJson() { + final json = {}; + if (startIndex != null) { + json[r'startIndex'] = startIndex; + } + if (count != null) { + json[r'count'] = count; + } + if (dateStart != null) { + json[r'dateStart'] = dateStart.toUtc().toIso8601String(); + } + if (dateEnd != null) { + json[r'dateEnd'] = dateEnd.toUtc().toIso8601String(); + } + if (eventType != null) { + json[r'eventType'] = eventType; + } + if (deviceType != null) { + json[r'deviceType'] = deviceType; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (roomId != null) { + json[r'roomId'] = roomId; + } + return json; + } + + /// Returns a new [EventHomeFilter] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static EventHomeFilter fromJson(Map json) => json == null + ? null + : EventHomeFilter( + startIndex: json[r'startIndex'], + count: json[r'count'], + dateStart: json[r'dateStart'] == null + ? null + : DateTime.parse(json[r'dateStart']), + dateEnd: json[r'dateEnd'] == null + ? null + : DateTime.parse(json[r'dateEnd']), + eventType: EventType.fromJson(json[r'eventType']), + deviceType: DeviceType.fromJson(json[r'deviceType']), + deviceId: json[r'deviceId'], + roomId: json[r'roomId'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => EventHomeFilter.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] = EventHomeFilter.fromJson(v)); + } + return map; + } + + // maps a json object with a list of EventHomeFilter-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] = EventHomeFilter.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_home_filter_all_of.dart b/mycore_api_old/lib/model/event_home_filter_all_of.dart new file mode 100644 index 0000000..d38c19f --- /dev/null +++ b/mycore_api_old/lib/model/event_home_filter_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 EventHomeFilterAllOf { + /// Returns a new [EventHomeFilterAllOf] instance. + EventHomeFilterAllOf({ + this.deviceId, + this.roomId, + }); + + String deviceId; + + String roomId; + + @override + bool operator ==(Object other) => identical(this, other) || other is EventHomeFilterAllOf && + other.deviceId == deviceId && + other.roomId == roomId; + + @override + int get hashCode => + (deviceId == null ? 0 : deviceId.hashCode) + + (roomId == null ? 0 : roomId.hashCode); + + @override + String toString() => 'EventHomeFilterAllOf[deviceId=$deviceId, roomId=$roomId]'; + + Map toJson() { + final json = {}; + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (roomId != null) { + json[r'roomId'] = roomId; + } + return json; + } + + /// Returns a new [EventHomeFilterAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static EventHomeFilterAllOf fromJson(Map json) => json == null + ? null + : EventHomeFilterAllOf( + deviceId: json[r'deviceId'], + roomId: json[r'roomId'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => EventHomeFilterAllOf.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] = EventHomeFilterAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of EventHomeFilterAllOf-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] = EventHomeFilterAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/event_type.dart b/mycore_api_old/lib/model/event_type.dart new file mode 100644 index 0000000..40bbe60 --- /dev/null +++ b/mycore_api_old/lib/model/event_type.dart @@ -0,0 +1,79 @@ +// +// 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 EventType { + /// Instantiate a new enum with the provided [value]. + const EventType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const deviceState = EventType._(r'DeviceState'); + static const automationTriggered = EventType._(r'AutomationTriggered'); + static const alarmTriggered = EventType._(r'AlarmTriggered'); + + /// List of all possible values in this [enum][EventType]. + static const values = [ + deviceState, + automationTriggered, + alarmTriggered, + ]; + + static EventType fromJson(dynamic value) => + EventTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => EventType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [EventType] to String, +/// and [decode] dynamic data back to [EventType]. +class EventTypeTypeTransformer { + const EventTypeTypeTransformer._(); + + factory EventTypeTypeTransformer() => _instance ??= EventTypeTypeTransformer._(); + + String encode(EventType data) => data.value; + + /// Decodes a [dynamic value][data] to a EventType. + /// + /// 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. + EventType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'DeviceState': return EventType.deviceState; + case r'AutomationTriggered': return EventType.automationTriggered; + case r'AlarmTriggered': return EventType.alarmTriggered; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [EventTypeTypeTransformer] instance. + static EventTypeTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/facebook_auth_model.dart b/mycore_api_old/lib/model/facebook_auth_model.dart new file mode 100644 index 0000000..f4b35f2 --- /dev/null +++ b/mycore_api_old/lib/model/facebook_auth_model.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 FacebookAuthModel { + /// Returns a new [FacebookAuthModel] instance. + FacebookAuthModel({ + this.userAccessToken, + }); + + String userAccessToken; + + @override + bool operator ==(Object other) => identical(this, other) || other is FacebookAuthModel && + other.userAccessToken == userAccessToken; + + @override + int get hashCode => + (userAccessToken == null ? 0 : userAccessToken.hashCode); + + @override + String toString() => 'FacebookAuthModel[userAccessToken=$userAccessToken]'; + + Map toJson() { + final json = {}; + if (userAccessToken != null) { + json[r'userAccessToken'] = userAccessToken; + } + return json; + } + + /// Returns a new [FacebookAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static FacebookAuthModel fromJson(Map json) => json == null + ? null + : FacebookAuthModel( + userAccessToken: json[r'userAccessToken'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => FacebookAuthModel.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] = FacebookAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of FacebookAuthModel-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] = FacebookAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/geolocalized_mode.dart b/mycore_api_old/lib/model/geolocalized_mode.dart new file mode 100644 index 0000000..e67fc94 --- /dev/null +++ b/mycore_api_old/lib/model/geolocalized_mode.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 GeolocalizedMode { + /// Returns a new [GeolocalizedMode] instance. + GeolocalizedMode({ + this.latitude, + this.longitude, + this.homeMode, + this.absentMode, + }); + + String latitude; + + String longitude; + + AlarmMode homeMode; + + AlarmMode absentMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is GeolocalizedMode && + other.latitude == latitude && + other.longitude == longitude && + other.homeMode == homeMode && + other.absentMode == absentMode; + + @override + int get hashCode => + (latitude == null ? 0 : latitude.hashCode) + + (longitude == null ? 0 : longitude.hashCode) + + (homeMode == null ? 0 : homeMode.hashCode) + + (absentMode == null ? 0 : absentMode.hashCode); + + @override + String toString() => 'GeolocalizedMode[latitude=$latitude, longitude=$longitude, homeMode=$homeMode, absentMode=$absentMode]'; + + Map toJson() { + final json = {}; + if (latitude != null) { + json[r'latitude'] = latitude; + } + if (longitude != null) { + json[r'longitude'] = longitude; + } + if (homeMode != null) { + json[r'homeMode'] = homeMode; + } + if (absentMode != null) { + json[r'absentMode'] = absentMode; + } + return json; + } + + /// Returns a new [GeolocalizedMode] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GeolocalizedMode fromJson(Map json) => json == null + ? null + : GeolocalizedMode( + latitude: json[r'latitude'], + longitude: json[r'longitude'], + homeMode: AlarmMode.fromJson(json[r'homeMode']), + absentMode: AlarmMode.fromJson(json[r'absentMode']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GeolocalizedMode.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] = GeolocalizedMode.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GeolocalizedMode-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] = GeolocalizedMode.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/google_auth_model.dart b/mycore_api_old/lib/model/google_auth_model.dart new file mode 100644 index 0000000..3f55cfa --- /dev/null +++ b/mycore_api_old/lib/model/google_auth_model.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 GoogleAuthModel { + /// Returns a new [GoogleAuthModel] instance. + GoogleAuthModel({ + this.authorizationCode, + this.apiKey, + }); + + String authorizationCode; + + String apiKey; + + @override + bool operator ==(Object other) => identical(this, other) || other is GoogleAuthModel && + other.authorizationCode == authorizationCode && + other.apiKey == apiKey; + + @override + int get hashCode => + (authorizationCode == null ? 0 : authorizationCode.hashCode) + + (apiKey == null ? 0 : apiKey.hashCode); + + @override + String toString() => 'GoogleAuthModel[authorizationCode=$authorizationCode, apiKey=$apiKey]'; + + Map toJson() { + final json = {}; + if (authorizationCode != null) { + json[r'authorizationCode'] = authorizationCode; + } + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + return json; + } + + /// Returns a new [GoogleAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GoogleAuthModel fromJson(Map json) => json == null + ? null + : GoogleAuthModel( + authorizationCode: json[r'authorizationCode'], + apiKey: json[r'apiKey'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GoogleAuthModel.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] = GoogleAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GoogleAuthModel-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] = GoogleAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group.dart b/mycore_api_old/lib/model/group.dart similarity index 100% rename from mycore_api/lib/model/group.dart rename to mycore_api_old/lib/model/group.dart diff --git a/mycore_api_old/lib/model/group_create_or_update_detail_dto.dart b/mycore_api_old/lib/model/group_create_or_update_detail_dto.dart new file mode 100644 index 0000000..fd468a0 --- /dev/null +++ b/mycore_api_old/lib/model/group_create_or_update_detail_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 GroupCreateOrUpdateDetailDTO { + /// Returns a new [GroupCreateOrUpdateDetailDTO] instance. + GroupCreateOrUpdateDetailDTO({ + this.id, + this.homeId, + this.name, + this.type, + this.isAlarm, + this.deviceIds, + }); + + String id; + + String homeId; + + String name; + + String type; + + bool isAlarm; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupCreateOrUpdateDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.type == type && + other.isAlarm == isAlarm && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'GroupCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, isAlarm=$isAlarm, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [GroupCreateOrUpdateDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupCreateOrUpdateDetailDTO fromJson(Map json) => json == null + ? null + : GroupCreateOrUpdateDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + type: json[r'type'], + isAlarm: json[r'isAlarm'], + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupCreateOrUpdateDetailDTO.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] = GroupCreateOrUpdateDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupCreateOrUpdateDetailDTO-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] = GroupCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/group_create_or_update_detail_dto_all_of.dart b/mycore_api_old/lib/model/group_create_or_update_detail_dto_all_of.dart new file mode 100644 index 0000000..e1cf089 --- /dev/null +++ b/mycore_api_old/lib/model/group_create_or_update_detail_dto_all_of.dart @@ -0,0 +1,73 @@ +// +// 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 GroupCreateOrUpdateDetailDTOAllOf { + /// Returns a new [GroupCreateOrUpdateDetailDTOAllOf] instance. + GroupCreateOrUpdateDetailDTOAllOf({ + this.deviceIds, + }); + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupCreateOrUpdateDetailDTOAllOf && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'GroupCreateOrUpdateDetailDTOAllOf[deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [GroupCreateOrUpdateDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupCreateOrUpdateDetailDTOAllOf fromJson(Map json) => json == null + ? null + : GroupCreateOrUpdateDetailDTOAllOf( + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupCreateOrUpdateDetailDTOAllOf.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] = GroupCreateOrUpdateDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupCreateOrUpdateDetailDTOAllOf-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] = GroupCreateOrUpdateDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/group_detail_dto.dart b/mycore_api_old/lib/model/group_detail_dto.dart new file mode 100644 index 0000000..af908d0 --- /dev/null +++ b/mycore_api_old/lib/model/group_detail_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 GroupDetailDTO { + /// Returns a new [GroupDetailDTO] instance. + GroupDetailDTO({ + this.id, + this.homeId, + this.name, + this.type, + this.isAlarm, + this.createdDate, + this.updatedDate, + this.devices, + }); + + String id; + + String homeId; + + String name; + + String type; + + bool isAlarm; + + DateTime createdDate; + + DateTime updatedDate; + + List devices; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.type == type && + other.isAlarm == isAlarm && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devices == devices; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devices == null ? 0 : devices.hashCode); + + @override + String toString() => 'GroupDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, isAlarm=$isAlarm, createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devices != null) { + json[r'devices'] = devices; + } + return json; + } + + /// Returns a new [GroupDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupDetailDTO fromJson(Map json) => json == null + ? null + : GroupDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + type: json[r'type'], + isAlarm: json[r'isAlarm'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupDetailDTO.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] = GroupDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupDetailDTO-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] = GroupDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/group_detail_dto_all_of.dart b/mycore_api_old/lib/model/group_detail_dto_all_of.dart new file mode 100644 index 0000000..1b10d52 --- /dev/null +++ b/mycore_api_old/lib/model/group_detail_dto_all_of.dart @@ -0,0 +1,93 @@ +// +// 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 GroupDetailDTOAllOf { + /// Returns a new [GroupDetailDTOAllOf] instance. + GroupDetailDTOAllOf({ + this.createdDate, + this.updatedDate, + this.devices, + }); + + DateTime createdDate; + + DateTime updatedDate; + + List devices; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupDetailDTOAllOf && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devices == devices; + + @override + int get hashCode => + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devices == null ? 0 : devices.hashCode); + + @override + String toString() => 'GroupDetailDTOAllOf[createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; + + Map toJson() { + final json = {}; + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devices != null) { + json[r'devices'] = devices; + } + return json; + } + + /// Returns a new [GroupDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupDetailDTOAllOf fromJson(Map json) => json == null + ? null + : GroupDetailDTOAllOf( + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupDetailDTOAllOf.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] = GroupDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupDetailDTOAllOf-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] = GroupDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/group_summary_dto.dart b/mycore_api_old/lib/model/group_summary_dto.dart new file mode 100644 index 0000000..9cd29b8 --- /dev/null +++ b/mycore_api_old/lib/model/group_summary_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 GroupSummaryDTO { + /// Returns a new [GroupSummaryDTO] instance. + GroupSummaryDTO({ + this.id, + this.homeId, + this.name, + this.type, + this.isAlarm, + }); + + String id; + + String homeId; + + String name; + + String type; + + bool isAlarm; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupSummaryDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.type == type && + other.isAlarm == isAlarm; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode); + + @override + String toString() => 'GroupSummaryDTO[id=$id, homeId=$homeId, name=$name, type=$type, isAlarm=$isAlarm]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + return json; + } + + /// Returns a new [GroupSummaryDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupSummaryDTO fromJson(Map json) => json == null + ? null + : GroupSummaryDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + type: json[r'type'], + isAlarm: json[r'isAlarm'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupSummaryDTO.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] = GroupSummaryDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupSummaryDTO-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] = GroupSummaryDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/home_detail_dto.dart b/mycore_api_old/lib/model/home_detail_dto.dart new file mode 100644 index 0000000..0c99b6c --- /dev/null +++ b/mycore_api_old/lib/model/home_detail_dto.dart @@ -0,0 +1,185 @@ +// +// 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 HomeDetailDTO { + /// Returns a new [HomeDetailDTO] instance. + HomeDetailDTO({ + this.id, + this.name, + this.isAlarm, + this.isDefault, + this.currentAlarmMode, + this.createdDate, + this.updatedDate, + this.usersIds, + this.users, + this.devices, + this.automations, + this.providers, + this.groups, + }); + + String id; + + String name; + + bool isAlarm; + + bool isDefault; + + AlarmModeDTO currentAlarmMode; + + DateTime createdDate; + + DateTime updatedDate; + + List usersIds; + + List users; + + List devices; + + List automations; + + List providers; + + List groups; + + @override + bool operator ==(Object other) => identical(this, other) || other is HomeDetailDTO && + other.id == id && + other.name == name && + other.isAlarm == isAlarm && + other.isDefault == isDefault && + other.currentAlarmMode == currentAlarmMode && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.usersIds == usersIds && + other.users == users && + other.devices == devices && + other.automations == automations && + other.providers == providers && + other.groups == groups; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (currentAlarmMode == null ? 0 : currentAlarmMode.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (usersIds == null ? 0 : usersIds.hashCode) + + (users == null ? 0 : users.hashCode) + + (devices == null ? 0 : devices.hashCode) + + (automations == null ? 0 : automations.hashCode) + + (providers == null ? 0 : providers.hashCode) + + (groups == null ? 0 : groups.hashCode); + + @override + String toString() => 'HomeDetailDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds, users=$users, devices=$devices, automations=$automations, providers=$providers, groups=$groups]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (currentAlarmMode != null) { + json[r'currentAlarmMode'] = currentAlarmMode; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (usersIds != null) { + json[r'usersIds'] = usersIds; + } + if (users != null) { + json[r'users'] = users; + } + if (devices != null) { + json[r'devices'] = devices; + } + if (automations != null) { + json[r'automations'] = automations; + } + if (providers != null) { + json[r'providers'] = providers; + } + if (groups != null) { + json[r'groups'] = groups; + } + return json; + } + + /// Returns a new [HomeDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static HomeDetailDTO fromJson(Map json) => json == null + ? null + : HomeDetailDTO( + id: json[r'id'], + name: json[r'name'], + isAlarm: json[r'isAlarm'], + isDefault: json[r'isDefault'], + currentAlarmMode: AlarmModeDTO.fromJson(json[r'currentAlarmMode']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + usersIds: json[r'usersIds'] == null + ? null + : (json[r'usersIds'] as List).cast(), + users: UserInfoDetailDTO.listFromJson(json[r'users']), + devices: DeviceSummaryDTO.listFromJson(json[r'devices']), + automations: AutomationDTO.listFromJson(json[r'automations']), + providers: ProviderDTO.listFromJson(json[r'providers']), + groups: GroupSummaryDTO.listFromJson(json[r'groups']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => HomeDetailDTO.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] = HomeDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of HomeDetailDTO-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] = HomeDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/home_detail_dto_all_of.dart b/mycore_api_old/lib/model/home_detail_dto_all_of.dart new file mode 100644 index 0000000..206bc6b --- /dev/null +++ b/mycore_api_old/lib/model/home_detail_dto_all_of.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 HomeDetailDTOAllOf { + /// Returns a new [HomeDetailDTOAllOf] instance. + HomeDetailDTOAllOf({ + this.users, + this.devices, + this.automations, + this.providers, + this.groups, + }); + + List users; + + List devices; + + List automations; + + List providers; + + List groups; + + @override + bool operator ==(Object other) => identical(this, other) || other is HomeDetailDTOAllOf && + other.users == users && + other.devices == devices && + other.automations == automations && + other.providers == providers && + other.groups == groups; + + @override + int get hashCode => + (users == null ? 0 : users.hashCode) + + (devices == null ? 0 : devices.hashCode) + + (automations == null ? 0 : automations.hashCode) + + (providers == null ? 0 : providers.hashCode) + + (groups == null ? 0 : groups.hashCode); + + @override + String toString() => 'HomeDetailDTOAllOf[users=$users, devices=$devices, automations=$automations, providers=$providers, groups=$groups]'; + + Map toJson() { + final json = {}; + if (users != null) { + json[r'users'] = users; + } + if (devices != null) { + json[r'devices'] = devices; + } + if (automations != null) { + json[r'automations'] = automations; + } + if (providers != null) { + json[r'providers'] = providers; + } + if (groups != null) { + json[r'groups'] = groups; + } + return json; + } + + /// Returns a new [HomeDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static HomeDetailDTOAllOf fromJson(Map json) => json == null + ? null + : HomeDetailDTOAllOf( + users: UserInfoDetailDTO.listFromJson(json[r'users']), + devices: DeviceSummaryDTO.listFromJson(json[r'devices']), + automations: AutomationDTO.listFromJson(json[r'automations']), + providers: ProviderDTO.listFromJson(json[r'providers']), + groups: GroupSummaryDTO.listFromJson(json[r'groups']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => HomeDetailDTOAllOf.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] = HomeDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of HomeDetailDTOAllOf-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] = HomeDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/home_dto.dart b/mycore_api_old/lib/model/home_dto.dart new file mode 100644 index 0000000..3c25def --- /dev/null +++ b/mycore_api_old/lib/model/home_dto.dart @@ -0,0 +1,140 @@ +// +// 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 HomeDTO { + /// Returns a new [HomeDTO] instance. + HomeDTO({ + this.id, + this.name, + this.isAlarm, + this.isDefault, + this.currentAlarmMode, + this.createdDate, + this.updatedDate, + this.usersIds, + }); + + String id; + + String name; + + bool isAlarm; + + bool isDefault; + + AlarmModeDTO currentAlarmMode; + + DateTime createdDate; + + DateTime updatedDate; + + List usersIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is HomeDTO && + other.id == id && + other.name == name && + other.isAlarm == isAlarm && + other.isDefault == isDefault && + other.currentAlarmMode == currentAlarmMode && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.usersIds == usersIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (currentAlarmMode == null ? 0 : currentAlarmMode.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (usersIds == null ? 0 : usersIds.hashCode); + + @override + String toString() => 'HomeDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (isDefault != null) { + json[r'isDefault'] = isDefault; + } + if (currentAlarmMode != null) { + json[r'currentAlarmMode'] = currentAlarmMode; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (usersIds != null) { + json[r'usersIds'] = usersIds; + } + return json; + } + + /// Returns a new [HomeDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static HomeDTO fromJson(Map json) => json == null + ? null + : HomeDTO( + id: json[r'id'], + name: json[r'name'], + isAlarm: json[r'isAlarm'], + isDefault: json[r'isDefault'], + currentAlarmMode: AlarmModeDTO.fromJson(json[r'currentAlarmMode']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + usersIds: json[r'usersIds'] == null + ? null + : (json[r'usersIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => HomeDTO.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] = HomeDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of HomeDTO-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] = HomeDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart b/mycore_api_old/lib/model/list_response_of_event_detail_dto_and_event_home_filter.dart new file mode 100644 index 0000000..9beee20 --- /dev/null +++ b/mycore_api_old/lib/model/list_response_of_event_detail_dto_and_event_home_filter.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 ListResponseOfEventDetailDTOAndEventHomeFilter { + /// Returns a new [ListResponseOfEventDetailDTOAndEventHomeFilter] instance. + ListResponseOfEventDetailDTOAndEventHomeFilter({ + this.values, + this.requestParameters, + this.totalCount, + this.actualCount, + }); + + List values; + + EventHomeFilter requestParameters; + + int totalCount; + + int actualCount; + + @override + bool operator ==(Object other) => identical(this, other) || other is ListResponseOfEventDetailDTOAndEventHomeFilter && + other.values == values && + other.requestParameters == requestParameters && + other.totalCount == totalCount && + other.actualCount == actualCount; + + @override + int get hashCode => + (values == null ? 0 : values.hashCode) + + (requestParameters == null ? 0 : requestParameters.hashCode) + + (totalCount == null ? 0 : totalCount.hashCode) + + (actualCount == null ? 0 : actualCount.hashCode); + + @override + String toString() => 'ListResponseOfEventDetailDTOAndEventHomeFilter[values=$values, requestParameters=$requestParameters, totalCount=$totalCount, actualCount=$actualCount]'; + + Map toJson() { + final json = {}; + if (values != null) { + json[r'values'] = values; + } + if (requestParameters != null) { + json[r'requestParameters'] = requestParameters; + } + if (totalCount != null) { + json[r'totalCount'] = totalCount; + } + if (actualCount != null) { + json[r'actualCount'] = actualCount; + } + return json; + } + + /// Returns a new [ListResponseOfEventDetailDTOAndEventHomeFilter] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ListResponseOfEventDetailDTOAndEventHomeFilter fromJson(Map json) => json == null + ? null + : ListResponseOfEventDetailDTOAndEventHomeFilter( + values: EventDetailDTO.listFromJson(json[r'values']), + requestParameters: EventHomeFilter.fromJson(json[r'requestParameters']), + totalCount: json[r'totalCount'], + actualCount: json[r'actualCount'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ListResponseOfEventDetailDTOAndEventHomeFilter.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] = ListResponseOfEventDetailDTOAndEventHomeFilter.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ListResponseOfEventDetailDTOAndEventHomeFilter-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] = ListResponseOfEventDetailDTOAndEventHomeFilter.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/location_dto.dart b/mycore_api_old/lib/model/location_dto.dart similarity index 100% rename from mycore_api/lib/model/location_dto.dart rename to mycore_api_old/lib/model/location_dto.dart diff --git a/mycore_api_old/lib/model/login_dto.dart b/mycore_api_old/lib/model/login_dto.dart new file mode 100644 index 0000000..ff0bed5 --- /dev/null +++ b/mycore_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/mycore_api_old/lib/model/means_of_communication.dart b/mycore_api_old/lib/model/means_of_communication.dart new file mode 100644 index 0000000..b5ea770 --- /dev/null +++ b/mycore_api_old/lib/model/means_of_communication.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 MeansOfCommunication { + /// Instantiate a new enum with the provided [value]. + const MeansOfCommunication._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const wifi = MeansOfCommunication._(r'Wifi'); + static const bluetooth = MeansOfCommunication._(r'Bluetooth'); + static const zigbee = MeansOfCommunication._(r'Zigbee'); + static const zwave = MeansOfCommunication._(r'Zwave'); + + /// List of all possible values in this [enum][MeansOfCommunication]. + static const values = [ + wifi, + bluetooth, + zigbee, + zwave, + ]; + + static MeansOfCommunication fromJson(dynamic value) => + MeansOfCommunicationTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => MeansOfCommunication.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [MeansOfCommunication] to String, +/// and [decode] dynamic data back to [MeansOfCommunication]. +class MeansOfCommunicationTypeTransformer { + const MeansOfCommunicationTypeTransformer._(); + + factory MeansOfCommunicationTypeTransformer() => _instance ??= MeansOfCommunicationTypeTransformer._(); + + String encode(MeansOfCommunication data) => data.value; + + /// Decodes a [dynamic value][data] to a MeansOfCommunication. + /// + /// 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. + MeansOfCommunication decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Wifi': return MeansOfCommunication.wifi; + case r'Bluetooth': return MeansOfCommunication.bluetooth; + case r'Zigbee': return MeansOfCommunication.zigbee; + case r'Zwave': return MeansOfCommunication.zwave; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [MeansOfCommunicationTypeTransformer] instance. + static MeansOfCommunicationTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/mqtt_message_dto.dart b/mycore_api_old/lib/model/mqtt_message_dto.dart new file mode 100644 index 0000000..e76235d --- /dev/null +++ b/mycore_api_old/lib/model/mqtt_message_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 MqttMessageDTO { + /// Returns a new [MqttMessageDTO] instance. + MqttMessageDTO({ + this.topic, + this.message, + this.online, + }); + + String topic; + + String message; + + bool online; + + @override + bool operator ==(Object other) => identical(this, other) || other is MqttMessageDTO && + other.topic == topic && + other.message == message && + other.online == online; + + @override + int get hashCode => + (topic == null ? 0 : topic.hashCode) + + (message == null ? 0 : message.hashCode) + + (online == null ? 0 : online.hashCode); + + @override + String toString() => 'MqttMessageDTO[topic=$topic, message=$message, online=$online]'; + + Map toJson() { + final json = {}; + if (topic != null) { + json[r'topic'] = topic; + } + if (message != null) { + json[r'message'] = message; + } + if (online != null) { + json[r'online'] = online; + } + return json; + } + + /// Returns a new [MqttMessageDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static MqttMessageDTO fromJson(Map json) => json == null + ? null + : MqttMessageDTO( + topic: json[r'topic'], + message: json[r'message'], + online: json[r'online'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => MqttMessageDTO.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] = MqttMessageDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of MqttMessageDTO-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] = MqttMessageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/odd_nice.dart b/mycore_api_old/lib/model/odd_nice.dart new file mode 100644 index 0000000..71390a4 --- /dev/null +++ b/mycore_api_old/lib/model/odd_nice.dart @@ -0,0 +1,100 @@ +// +// 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 OddNice { + /// Returns a new [OddNice] instance. + OddNice({ + this.teams, + this.commenceTime, + this.homeTeam, + this.odds, + }); + + List teams; + + int commenceTime; + + String homeTeam; + + OddObject odds; + + @override + bool operator ==(Object other) => identical(this, other) || other is OddNice && + other.teams == teams && + other.commenceTime == commenceTime && + other.homeTeam == homeTeam && + other.odds == odds; + + @override + int get hashCode => + (teams == null ? 0 : teams.hashCode) + + (commenceTime == null ? 0 : commenceTime.hashCode) + + (homeTeam == null ? 0 : homeTeam.hashCode) + + (odds == null ? 0 : odds.hashCode); + + @override + String toString() => 'OddNice[teams=$teams, commenceTime=$commenceTime, homeTeam=$homeTeam, odds=$odds]'; + + Map toJson() { + final json = {}; + if (teams != null) { + json[r'teams'] = teams; + } + if (commenceTime != null) { + json[r'commence_time'] = commenceTime; + } + if (homeTeam != null) { + json[r'home_team'] = homeTeam; + } + if (odds != null) { + json[r'odds'] = odds; + } + return json; + } + + /// Returns a new [OddNice] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static OddNice fromJson(Map json) => json == null + ? null + : OddNice( + teams: json[r'teams'] == null + ? null + : (json[r'teams'] as List).cast(), + commenceTime: json[r'commence_time'], + homeTeam: json[r'home_team'], + odds: OddObject.fromJson(json[r'odds']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => OddNice.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] = OddNice.fromJson(v)); + } + return map; + } + + // maps a json object with a list of OddNice-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] = OddNice.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/odd_object.dart b/mycore_api_old/lib/model/odd_object.dart new file mode 100644 index 0000000..72a301d --- /dev/null +++ b/mycore_api_old/lib/model/odd_object.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 OddObject { + /// Returns a new [OddObject] instance. + OddObject({ + this.homeOdd, + this.drawOdd, + this.visitOdd, + }); + + double homeOdd; + + double drawOdd; + + double visitOdd; + + @override + bool operator ==(Object other) => identical(this, other) || other is OddObject && + other.homeOdd == homeOdd && + other.drawOdd == drawOdd && + other.visitOdd == visitOdd; + + @override + int get hashCode => + (homeOdd == null ? 0 : homeOdd.hashCode) + + (drawOdd == null ? 0 : drawOdd.hashCode) + + (visitOdd == null ? 0 : visitOdd.hashCode); + + @override + String toString() => 'OddObject[homeOdd=$homeOdd, drawOdd=$drawOdd, visitOdd=$visitOdd]'; + + Map toJson() { + final json = {}; + if (homeOdd != null) { + json[r'homeOdd'] = homeOdd; + } + if (drawOdd != null) { + json[r'drawOdd'] = drawOdd; + } + if (visitOdd != null) { + json[r'visitOdd'] = visitOdd; + } + return json; + } + + /// Returns a new [OddObject] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static OddObject fromJson(Map json) => json == null + ? null + : OddObject( + homeOdd: json[r'homeOdd'], + drawOdd: json[r'drawOdd'], + visitOdd: json[r'visitOdd'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => OddObject.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] = OddObject.fromJson(v)); + } + return map; + } + + // maps a json object with a list of OddObject-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] = OddObject.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/panel_menu_item.dart b/mycore_api_old/lib/model/panel_menu_item.dart new file mode 100644 index 0000000..83f9c42 --- /dev/null +++ b/mycore_api_old/lib/model/panel_menu_item.dart @@ -0,0 +1,125 @@ +// +// 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 PanelMenuItem { + /// Returns a new [PanelMenuItem] instance. + PanelMenuItem({ + this.label, + this.route, + this.icon, + this.color, + this.badgeValue, + this.badgeType, + this.children, + }); + + String label; + + String route; + + String icon; + + String color; + + int badgeValue; + + String badgeType; + + List children; + + @override + bool operator ==(Object other) => identical(this, other) || other is PanelMenuItem && + other.label == label && + other.route == route && + other.icon == icon && + other.color == color && + other.badgeValue == badgeValue && + other.badgeType == badgeType && + other.children == children; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (route == null ? 0 : route.hashCode) + + (icon == null ? 0 : icon.hashCode) + + (color == null ? 0 : color.hashCode) + + (badgeValue == null ? 0 : badgeValue.hashCode) + + (badgeType == null ? 0 : badgeType.hashCode) + + (children == null ? 0 : children.hashCode); + + @override + String toString() => 'PanelMenuItem[label=$label, route=$route, icon=$icon, color=$color, badgeValue=$badgeValue, badgeType=$badgeType, children=$children]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (route != null) { + json[r'route'] = route; + } + if (icon != null) { + json[r'icon'] = icon; + } + if (color != null) { + json[r'color'] = color; + } + if (badgeValue != null) { + json[r'badgeValue'] = badgeValue; + } + if (badgeType != null) { + json[r'badgeType'] = badgeType; + } + if (children != null) { + json[r'children'] = children; + } + return json; + } + + /// Returns a new [PanelMenuItem] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static PanelMenuItem fromJson(Map json) => json == null + ? null + : PanelMenuItem( + label: json[r'label'], + route: json[r'route'], + icon: json[r'icon'], + color: json[r'color'], + badgeValue: json[r'badgeValue'], + badgeType: json[r'badgeType'], + children: PanelMenuItem.listFromJson(json[r'children']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => PanelMenuItem.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] = PanelMenuItem.fromJson(v)); + } + return map; + } + + // maps a json object with a list of PanelMenuItem-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] = PanelMenuItem.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/panel_section.dart b/mycore_api_old/lib/model/panel_section.dart new file mode 100644 index 0000000..e612c49 --- /dev/null +++ b/mycore_api_old/lib/model/panel_section.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 PanelSection { + /// Returns a new [PanelSection] instance. + PanelSection({ + this.label, + this.icon, + this.color, + this.defaultRoute, + this.children, + }); + + String label; + + String icon; + + String color; + + String defaultRoute; + + List children; + + @override + bool operator ==(Object other) => identical(this, other) || other is PanelSection && + other.label == label && + other.icon == icon && + other.color == color && + other.defaultRoute == defaultRoute && + other.children == children; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (icon == null ? 0 : icon.hashCode) + + (color == null ? 0 : color.hashCode) + + (defaultRoute == null ? 0 : defaultRoute.hashCode) + + (children == null ? 0 : children.hashCode); + + @override + String toString() => 'PanelSection[label=$label, icon=$icon, color=$color, defaultRoute=$defaultRoute, children=$children]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (icon != null) { + json[r'icon'] = icon; + } + if (color != null) { + json[r'color'] = color; + } + if (defaultRoute != null) { + json[r'defaultRoute'] = defaultRoute; + } + if (children != null) { + json[r'children'] = children; + } + return json; + } + + /// Returns a new [PanelSection] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static PanelSection fromJson(Map json) => json == null + ? null + : PanelSection( + label: json[r'label'], + icon: json[r'icon'], + color: json[r'color'], + defaultRoute: json[r'defaultRoute'], + children: PanelMenuItem.listFromJson(json[r'children']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => PanelSection.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] = PanelSection.fromJson(v)); + } + return map; + } + + // maps a json object with a list of PanelSection-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] = PanelSection.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/place_dto.dart b/mycore_api_old/lib/model/place_dto.dart similarity index 100% rename from mycore_api/lib/model/place_dto.dart rename to mycore_api_old/lib/model/place_dto.dart diff --git a/mycore_api_old/lib/model/programmed_mode.dart b/mycore_api_old/lib/model/programmed_mode.dart new file mode 100644 index 0000000..04796b3 --- /dev/null +++ b/mycore_api_old/lib/model/programmed_mode.dart @@ -0,0 +1,125 @@ +// +// 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 ProgrammedMode { + /// Returns a new [ProgrammedMode] instance. + ProgrammedMode({ + this.monday, + this.tuesday, + this.wednesday, + this.thursday, + this.friday, + this.saturday, + this.sunday, + }); + + List monday; + + List tuesday; + + List wednesday; + + List thursday; + + List friday; + + List saturday; + + List sunday; + + @override + bool operator ==(Object other) => identical(this, other) || other is ProgrammedMode && + other.monday == monday && + other.tuesday == tuesday && + other.wednesday == wednesday && + other.thursday == thursday && + other.friday == friday && + other.saturday == saturday && + other.sunday == sunday; + + @override + int get hashCode => + (monday == null ? 0 : monday.hashCode) + + (tuesday == null ? 0 : tuesday.hashCode) + + (wednesday == null ? 0 : wednesday.hashCode) + + (thursday == null ? 0 : thursday.hashCode) + + (friday == null ? 0 : friday.hashCode) + + (saturday == null ? 0 : saturday.hashCode) + + (sunday == null ? 0 : sunday.hashCode); + + @override + String toString() => 'ProgrammedMode[monday=$monday, tuesday=$tuesday, wednesday=$wednesday, thursday=$thursday, friday=$friday, saturday=$saturday, sunday=$sunday]'; + + Map toJson() { + final json = {}; + if (monday != null) { + json[r'monday'] = monday; + } + if (tuesday != null) { + json[r'tuesday'] = tuesday; + } + if (wednesday != null) { + json[r'wednesday'] = wednesday; + } + if (thursday != null) { + json[r'thursday'] = thursday; + } + if (friday != null) { + json[r'friday'] = friday; + } + if (saturday != null) { + json[r'saturday'] = saturday; + } + if (sunday != null) { + json[r'sunday'] = sunday; + } + return json; + } + + /// Returns a new [ProgrammedMode] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ProgrammedMode fromJson(Map json) => json == null + ? null + : ProgrammedMode( + monday: TimePeriodAlarm.listFromJson(json[r'monday']), + tuesday: TimePeriodAlarm.listFromJson(json[r'tuesday']), + wednesday: TimePeriodAlarm.listFromJson(json[r'wednesday']), + thursday: TimePeriodAlarm.listFromJson(json[r'thursday']), + friday: TimePeriodAlarm.listFromJson(json[r'friday']), + saturday: TimePeriodAlarm.listFromJson(json[r'saturday']), + sunday: TimePeriodAlarm.listFromJson(json[r'sunday']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ProgrammedMode.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] = ProgrammedMode.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ProgrammedMode-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] = ProgrammedMode.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/provider.dart b/mycore_api_old/lib/model/provider.dart similarity index 100% rename from mycore_api/lib/model/provider.dart rename to mycore_api_old/lib/model/provider.dart diff --git a/mycore_api_old/lib/model/provider_dto.dart b/mycore_api_old/lib/model/provider_dto.dart new file mode 100644 index 0000000..6941fe4 --- /dev/null +++ b/mycore_api_old/lib/model/provider_dto.dart @@ -0,0 +1,143 @@ +// +// 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 ProviderDTO { + /// Returns a new [ProviderDTO] instance. + ProviderDTO({ + this.id, + this.name, + this.type, + this.homeId, + this.endpoint, + this.username, + this.password, + this.apiKey, + this.active, + }); + + String id; + + String name; + + ProviderType type; + + String homeId; + + String endpoint; + + String username; + + String password; + + String apiKey; + + bool active; + + @override + bool operator ==(Object other) => identical(this, other) || other is ProviderDTO && + other.id == id && + other.name == name && + other.type == type && + other.homeId == homeId && + other.endpoint == endpoint && + other.username == username && + other.password == password && + other.apiKey == apiKey && + other.active == active; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (endpoint == null ? 0 : endpoint.hashCode) + + (username == null ? 0 : username.hashCode) + + (password == null ? 0 : password.hashCode) + + (apiKey == null ? 0 : apiKey.hashCode) + + (active == null ? 0 : active.hashCode); + + @override + String toString() => 'ProviderDTO[id=$id, name=$name, type=$type, homeId=$homeId, endpoint=$endpoint, username=$username, password=$password, apiKey=$apiKey, active=$active]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (endpoint != null) { + json[r'endpoint'] = endpoint; + } + if (username != null) { + json[r'username'] = username; + } + if (password != null) { + json[r'password'] = password; + } + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + if (active != null) { + json[r'active'] = active; + } + return json; + } + + /// Returns a new [ProviderDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ProviderDTO fromJson(Map json) => json == null + ? null + : ProviderDTO( + id: json[r'id'], + name: json[r'name'], + type: ProviderType.fromJson(json[r'type']), + homeId: json[r'homeId'], + endpoint: json[r'endpoint'], + username: json[r'username'], + password: json[r'password'], + apiKey: json[r'apiKey'], + active: json[r'active'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ProviderDTO.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] = ProviderDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ProviderDTO-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] = ProviderDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/provider_type.dart b/mycore_api_old/lib/model/provider_type.dart new file mode 100644 index 0000000..67f806b --- /dev/null +++ b/mycore_api_old/lib/model/provider_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 ProviderType { + /// Instantiate a new enum with the provided [value]. + const ProviderType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const arlo = ProviderType._(r'arlo'); + static const meross = ProviderType._(r'meross'); + static const yeelight = ProviderType._(r'yeelight'); + static const zigbee2mqtt = ProviderType._(r'zigbee2mqtt'); + + /// List of all possible values in this [enum][ProviderType]. + static const values = [ + arlo, + meross, + yeelight, + zigbee2mqtt, + ]; + + static ProviderType fromJson(dynamic value) => + ProviderTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ProviderType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ProviderType] to String, +/// and [decode] dynamic data back to [ProviderType]. +class ProviderTypeTypeTransformer { + const ProviderTypeTypeTransformer._(); + + factory ProviderTypeTypeTransformer() => _instance ??= ProviderTypeTypeTransformer._(); + + String encode(ProviderType data) => data.value; + + /// Decodes a [dynamic value][data] to a ProviderType. + /// + /// 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. + ProviderType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'arlo': return ProviderType.arlo; + case r'meross': return ProviderType.meross; + case r'yeelight': return ProviderType.yeelight; + case r'zigbee2mqtt': return ProviderType.zigbee2mqtt; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ProviderTypeTypeTransformer] instance. + static ProviderTypeTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/room_create_or_update_detail_dto.dart b/mycore_api_old/lib/model/room_create_or_update_detail_dto.dart new file mode 100644 index 0000000..f953861 --- /dev/null +++ b/mycore_api_old/lib/model/room_create_or_update_detail_dto.dart @@ -0,0 +1,100 @@ +// +// 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 RoomCreateOrUpdateDetailDTO { + /// Returns a new [RoomCreateOrUpdateDetailDTO] instance. + RoomCreateOrUpdateDetailDTO({ + this.id, + this.homeId, + this.name, + this.deviceIds, + }); + + String id; + + String homeId; + + String name; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomCreateOrUpdateDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'RoomCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [RoomCreateOrUpdateDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomCreateOrUpdateDetailDTO fromJson(Map json) => json == null + ? null + : RoomCreateOrUpdateDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomCreateOrUpdateDetailDTO.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] = RoomCreateOrUpdateDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomCreateOrUpdateDetailDTO-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] = RoomCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/room_detail_dto.dart b/mycore_api_old/lib/model/room_detail_dto.dart new file mode 100644 index 0000000..cc0b387 --- /dev/null +++ b/mycore_api_old/lib/model/room_detail_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 RoomDetailDTO { + /// Returns a new [RoomDetailDTO] instance. + RoomDetailDTO({ + this.id, + this.homeId, + this.name, + this.createdDate, + this.updatedDate, + this.devices, + }); + + String id; + + String homeId; + + String name; + + DateTime createdDate; + + DateTime updatedDate; + + List devices; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devices == devices; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devices == null ? 0 : devices.hashCode); + + @override + String toString() => 'RoomDetailDTO[id=$id, homeId=$homeId, name=$name, createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devices != null) { + json[r'devices'] = devices; + } + return json; + } + + /// Returns a new [RoomDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomDetailDTO fromJson(Map json) => json == null + ? null + : RoomDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomDetailDTO.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] = RoomDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomDetailDTO-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] = RoomDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/room_main_detail_dto.dart b/mycore_api_old/lib/model/room_main_detail_dto.dart new file mode 100644 index 0000000..2a98d46 --- /dev/null +++ b/mycore_api_old/lib/model/room_main_detail_dto.dart @@ -0,0 +1,201 @@ +// +// 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 RoomMainDetailDTO { + /// Returns a new [RoomMainDetailDTO] instance. + RoomMainDetailDTO({ + this.id, + this.homeId, + this.name, + this.createdDate, + this.updatedDate, + this.isTemperature, + this.temperature, + this.isHumidity, + this.humidity, + this.isMotion, + this.motion, + this.isDoor, + this.door, + this.environmentalDevices, + this.securityDevices, + }); + + String id; + + String homeId; + + String name; + + DateTime createdDate; + + DateTime updatedDate; + + bool isTemperature; + + String temperature; + + bool isHumidity; + + String humidity; + + bool isMotion; + + bool motion; + + bool isDoor; + + bool door; + + List environmentalDevices; + + List securityDevices; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomMainDetailDTO && + other.id == id && + other.homeId == homeId && + other.name == name && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.isTemperature == isTemperature && + other.temperature == temperature && + other.isHumidity == isHumidity && + other.humidity == humidity && + other.isMotion == isMotion && + other.motion == motion && + other.isDoor == isDoor && + other.door == door && + other.environmentalDevices == environmentalDevices && + other.securityDevices == securityDevices; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (isTemperature == null ? 0 : isTemperature.hashCode) + + (temperature == null ? 0 : temperature.hashCode) + + (isHumidity == null ? 0 : isHumidity.hashCode) + + (humidity == null ? 0 : humidity.hashCode) + + (isMotion == null ? 0 : isMotion.hashCode) + + (motion == null ? 0 : motion.hashCode) + + (isDoor == null ? 0 : isDoor.hashCode) + + (door == null ? 0 : door.hashCode) + + (environmentalDevices == null ? 0 : environmentalDevices.hashCode) + + (securityDevices == null ? 0 : securityDevices.hashCode); + + @override + String toString() => 'RoomMainDetailDTO[id=$id, homeId=$homeId, name=$name, createdDate=$createdDate, updatedDate=$updatedDate, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isMotion=$isMotion, motion=$motion, isDoor=$isDoor, door=$door, environmentalDevices=$environmentalDevices, securityDevices=$securityDevices]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (isTemperature != null) { + json[r'isTemperature'] = isTemperature; + } + if (temperature != null) { + json[r'temperature'] = temperature; + } + if (isHumidity != null) { + json[r'isHumidity'] = isHumidity; + } + if (humidity != null) { + json[r'humidity'] = humidity; + } + if (isMotion != null) { + json[r'isMotion'] = isMotion; + } + if (motion != null) { + json[r'motion'] = motion; + } + if (isDoor != null) { + json[r'isDoor'] = isDoor; + } + if (door != null) { + json[r'door'] = door; + } + if (environmentalDevices != null) { + json[r'environmentalDevices'] = environmentalDevices; + } + if (securityDevices != null) { + json[r'securityDevices'] = securityDevices; + } + return json; + } + + /// Returns a new [RoomMainDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomMainDetailDTO fromJson(Map json) => json == null + ? null + : RoomMainDetailDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + isTemperature: json[r'isTemperature'], + temperature: json[r'temperature'], + isHumidity: json[r'isHumidity'], + humidity: json[r'humidity'], + isMotion: json[r'isMotion'], + motion: json[r'motion'], + isDoor: json[r'isDoor'], + door: json[r'door'], + environmentalDevices: DeviceDetailDTO.listFromJson(json[r'environmentalDevices']), + securityDevices: DeviceDetailDTO.listFromJson(json[r'securityDevices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomMainDetailDTO.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] = RoomMainDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomMainDetailDTO-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] = RoomMainDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/room_main_detail_dto_all_of.dart b/mycore_api_old/lib/model/room_main_detail_dto_all_of.dart new file mode 100644 index 0000000..2176246 --- /dev/null +++ b/mycore_api_old/lib/model/room_main_detail_dto_all_of.dart @@ -0,0 +1,174 @@ +// +// 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 RoomMainDetailDTOAllOf { + /// Returns a new [RoomMainDetailDTOAllOf] instance. + RoomMainDetailDTOAllOf({ + this.createdDate, + this.updatedDate, + this.isTemperature, + this.temperature, + this.isHumidity, + this.humidity, + this.isMotion, + this.motion, + this.isDoor, + this.door, + this.environmentalDevices, + this.securityDevices, + }); + + DateTime createdDate; + + DateTime updatedDate; + + bool isTemperature; + + String temperature; + + bool isHumidity; + + String humidity; + + bool isMotion; + + bool motion; + + bool isDoor; + + bool door; + + List environmentalDevices; + + List securityDevices; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomMainDetailDTOAllOf && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.isTemperature == isTemperature && + other.temperature == temperature && + other.isHumidity == isHumidity && + other.humidity == humidity && + other.isMotion == isMotion && + other.motion == motion && + other.isDoor == isDoor && + other.door == door && + other.environmentalDevices == environmentalDevices && + other.securityDevices == securityDevices; + + @override + int get hashCode => + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (isTemperature == null ? 0 : isTemperature.hashCode) + + (temperature == null ? 0 : temperature.hashCode) + + (isHumidity == null ? 0 : isHumidity.hashCode) + + (humidity == null ? 0 : humidity.hashCode) + + (isMotion == null ? 0 : isMotion.hashCode) + + (motion == null ? 0 : motion.hashCode) + + (isDoor == null ? 0 : isDoor.hashCode) + + (door == null ? 0 : door.hashCode) + + (environmentalDevices == null ? 0 : environmentalDevices.hashCode) + + (securityDevices == null ? 0 : securityDevices.hashCode); + + @override + String toString() => 'RoomMainDetailDTOAllOf[createdDate=$createdDate, updatedDate=$updatedDate, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isMotion=$isMotion, motion=$motion, isDoor=$isDoor, door=$door, environmentalDevices=$environmentalDevices, securityDevices=$securityDevices]'; + + Map toJson() { + final json = {}; + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (isTemperature != null) { + json[r'isTemperature'] = isTemperature; + } + if (temperature != null) { + json[r'temperature'] = temperature; + } + if (isHumidity != null) { + json[r'isHumidity'] = isHumidity; + } + if (humidity != null) { + json[r'humidity'] = humidity; + } + if (isMotion != null) { + json[r'isMotion'] = isMotion; + } + if (motion != null) { + json[r'motion'] = motion; + } + if (isDoor != null) { + json[r'isDoor'] = isDoor; + } + if (door != null) { + json[r'door'] = door; + } + if (environmentalDevices != null) { + json[r'environmentalDevices'] = environmentalDevices; + } + if (securityDevices != null) { + json[r'securityDevices'] = securityDevices; + } + return json; + } + + /// Returns a new [RoomMainDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomMainDetailDTOAllOf fromJson(Map json) => json == null + ? null + : RoomMainDetailDTOAllOf( + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + isTemperature: json[r'isTemperature'], + temperature: json[r'temperature'], + isHumidity: json[r'isHumidity'], + humidity: json[r'humidity'], + isMotion: json[r'isMotion'], + motion: json[r'motion'], + isDoor: json[r'isDoor'], + door: json[r'door'], + environmentalDevices: DeviceDetailDTO.listFromJson(json[r'environmentalDevices']), + securityDevices: DeviceDetailDTO.listFromJson(json[r'securityDevices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomMainDetailDTOAllOf.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] = RoomMainDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomMainDetailDTOAllOf-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] = RoomMainDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/room_summary_dto.dart b/mycore_api_old/lib/model/room_summary_dto.dart new file mode 100644 index 0000000..ea9ca95 --- /dev/null +++ b/mycore_api_old/lib/model/room_summary_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 RoomSummaryDTO { + /// Returns a new [RoomSummaryDTO] instance. + RoomSummaryDTO({ + this.id, + this.homeId, + this.name, + }); + + String id; + + String homeId; + + String name; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomSummaryDTO && + other.id == id && + other.homeId == homeId && + other.name == name; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (homeId == null ? 0 : homeId.hashCode) + + (name == null ? 0 : name.hashCode); + + @override + String toString() => 'RoomSummaryDTO[id=$id, homeId=$homeId, name=$name]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (homeId != null) { + json[r'homeId'] = homeId; + } + if (name != null) { + json[r'name'] = name; + } + return json; + } + + /// Returns a new [RoomSummaryDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomSummaryDTO fromJson(Map json) => json == null + ? null + : RoomSummaryDTO( + id: json[r'id'], + homeId: json[r'homeId'], + name: json[r'name'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomSummaryDTO.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] = RoomSummaryDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomSummaryDTO-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] = RoomSummaryDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/screen_configuration.dart b/mycore_api_old/lib/model/screen_configuration.dart similarity index 100% rename from mycore_api/lib/model/screen_configuration.dart rename to mycore_api_old/lib/model/screen_configuration.dart diff --git a/mycore_api_old/lib/model/screen_device.dart b/mycore_api_old/lib/model/screen_device.dart new file mode 100644 index 0000000..9ed497a --- /dev/null +++ b/mycore_api_old/lib/model/screen_device.dart @@ -0,0 +1,125 @@ +// +// 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 ScreenDevice { + /// Returns a new [ScreenDevice] instance. + ScreenDevice({ + this.id, + this.name, + this.type, + this.location, + this.locationExplanation, + this.height, + this.width, + }); + + String id; + + String name; + + String type; + + String location; + + String locationExplanation; + + int height; + + int width; + + @override + bool operator ==(Object other) => identical(this, other) || other is ScreenDevice && + other.id == id && + other.name == name && + other.type == type && + other.location == location && + other.locationExplanation == locationExplanation && + other.height == height && + other.width == width; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (location == null ? 0 : location.hashCode) + + (locationExplanation == null ? 0 : locationExplanation.hashCode) + + (height == null ? 0 : height.hashCode) + + (width == null ? 0 : width.hashCode); + + @override + String toString() => 'ScreenDevice[id=$id, name=$name, type=$type, location=$location, locationExplanation=$locationExplanation, height=$height, width=$width]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (location != null) { + json[r'location'] = location; + } + if (locationExplanation != null) { + json[r'locationExplanation'] = locationExplanation; + } + if (height != null) { + json[r'height'] = height; + } + if (width != null) { + json[r'width'] = width; + } + return json; + } + + /// Returns a new [ScreenDevice] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ScreenDevice fromJson(Map json) => json == null + ? null + : ScreenDevice( + id: json[r'id'], + name: json[r'name'], + type: json[r'type'], + location: json[r'location'], + locationExplanation: json[r'locationExplanation'], + height: json[r'height'], + width: json[r'width'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ScreenDevice.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] = ScreenDevice.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ScreenDevice-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] = ScreenDevice.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/screen_widget.dart b/mycore_api_old/lib/model/screen_widget.dart similarity index 100% rename from mycore_api/lib/model/screen_widget.dart rename to mycore_api_old/lib/model/screen_widget.dart diff --git a/mycore_api_old/lib/model/smart_garden_message.dart b/mycore_api_old/lib/model/smart_garden_message.dart new file mode 100644 index 0000000..342aa1b --- /dev/null +++ b/mycore_api_old/lib/model/smart_garden_message.dart @@ -0,0 +1,134 @@ +// +// 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 SmartGardenMessage { + /// Returns a new [SmartGardenMessage] instance. + SmartGardenMessage({ + this.id, + this.type, + this.time, + this.temperature, + this.pressure, + this.humidity, + this.water, + this.light, + }); + + String id; + + String type; + + String time; + + double temperature; + + double pressure; + + double humidity; + + int water; + + int light; + + @override + bool operator ==(Object other) => identical(this, other) || other is SmartGardenMessage && + other.id == id && + other.type == type && + other.time == time && + other.temperature == temperature && + other.pressure == pressure && + other.humidity == humidity && + other.water == water && + other.light == light; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (type == null ? 0 : type.hashCode) + + (time == null ? 0 : time.hashCode) + + (temperature == null ? 0 : temperature.hashCode) + + (pressure == null ? 0 : pressure.hashCode) + + (humidity == null ? 0 : humidity.hashCode) + + (water == null ? 0 : water.hashCode) + + (light == null ? 0 : light.hashCode); + + @override + String toString() => 'SmartGardenMessage[id=$id, type=$type, time=$time, temperature=$temperature, pressure=$pressure, humidity=$humidity, water=$water, light=$light]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (type != null) { + json[r'type'] = type; + } + if (time != null) { + json[r'time'] = time; + } + if (temperature != null) { + json[r'temperature'] = temperature; + } + if (pressure != null) { + json[r'pressure'] = pressure; + } + if (humidity != null) { + json[r'humidity'] = humidity; + } + if (water != null) { + json[r'water'] = water; + } + if (light != null) { + json[r'light'] = light; + } + return json; + } + + /// Returns a new [SmartGardenMessage] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static SmartGardenMessage fromJson(Map json) => json == null + ? null + : SmartGardenMessage( + id: json[r'id'], + type: json[r'type'], + time: json[r'time'], + temperature: json[r'temperature'], + pressure: json[r'pressure'], + humidity: json[r'humidity'], + water: json[r'water'], + light: json[r'light'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => SmartGardenMessage.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] = SmartGardenMessage.fromJson(v)); + } + return map; + } + + // maps a json object with a list of SmartGardenMessage-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] = SmartGardenMessage.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/smart_printer_message.dart b/mycore_api_old/lib/model/smart_printer_message.dart new file mode 100644 index 0000000..49a04c7 --- /dev/null +++ b/mycore_api_old/lib/model/smart_printer_message.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 SmartPrinterMessage { + /// Returns a new [SmartPrinterMessage] instance. + SmartPrinterMessage({ + this.id, + this.type, + this.time, + this.temperature, + this.pressure, + this.smoke, + }); + + String id; + + String type; + + String time; + + double temperature; + + double pressure; + + int smoke; + + @override + bool operator ==(Object other) => identical(this, other) || other is SmartPrinterMessage && + other.id == id && + other.type == type && + other.time == time && + other.temperature == temperature && + other.pressure == pressure && + other.smoke == smoke; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (type == null ? 0 : type.hashCode) + + (time == null ? 0 : time.hashCode) + + (temperature == null ? 0 : temperature.hashCode) + + (pressure == null ? 0 : pressure.hashCode) + + (smoke == null ? 0 : smoke.hashCode); + + @override + String toString() => 'SmartPrinterMessage[id=$id, type=$type, time=$time, temperature=$temperature, pressure=$pressure, smoke=$smoke]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (type != null) { + json[r'type'] = type; + } + if (time != null) { + json[r'time'] = time; + } + if (temperature != null) { + json[r'temperature'] = temperature; + } + if (pressure != null) { + json[r'pressure'] = pressure; + } + if (smoke != null) { + json[r'smoke'] = smoke; + } + return json; + } + + /// Returns a new [SmartPrinterMessage] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static SmartPrinterMessage fromJson(Map json) => json == null + ? null + : SmartPrinterMessage( + id: json[r'id'], + type: json[r'type'], + time: json[r'time'], + temperature: json[r'temperature'], + pressure: json[r'pressure'], + smoke: json[r'smoke'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => SmartPrinterMessage.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] = SmartPrinterMessage.fromJson(v)); + } + return map; + } + + // maps a json object with a list of SmartPrinterMessage-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] = SmartPrinterMessage.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/time_period_alarm.dart b/mycore_api_old/lib/model/time_period_alarm.dart new file mode 100644 index 0000000..d0f3505 --- /dev/null +++ b/mycore_api_old/lib/model/time_period_alarm.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 TimePeriodAlarm { + /// Returns a new [TimePeriodAlarm] instance. + TimePeriodAlarm({ + this.start, + this.end, + this.alarmMode, + }); + + String start; + + String end; + + AlarmMode alarmMode; + + @override + bool operator ==(Object other) => identical(this, other) || other is TimePeriodAlarm && + other.start == start && + other.end == end && + other.alarmMode == alarmMode; + + @override + int get hashCode => + (start == null ? 0 : start.hashCode) + + (end == null ? 0 : end.hashCode) + + (alarmMode == null ? 0 : alarmMode.hashCode); + + @override + String toString() => 'TimePeriodAlarm[start=$start, end=$end, alarmMode=$alarmMode]'; + + Map toJson() { + final json = {}; + if (start != null) { + json[r'start'] = start; + } + if (end != null) { + json[r'end'] = end; + } + if (alarmMode != null) { + json[r'alarmMode'] = alarmMode; + } + return json; + } + + /// Returns a new [TimePeriodAlarm] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static TimePeriodAlarm fromJson(Map json) => json == null + ? null + : TimePeriodAlarm( + start: json[r'start'], + end: json[r'end'], + alarmMode: AlarmMode.fromJson(json[r'alarmMode']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => TimePeriodAlarm.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] = TimePeriodAlarm.fromJson(v)); + } + return map; + } + + // maps a json object with a list of TimePeriodAlarm-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] = TimePeriodAlarm.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/token_dto.dart b/mycore_api_old/lib/model/token_dto.dart new file mode 100644 index 0000000..5ef4e57 --- /dev/null +++ b/mycore_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/mycore_api_old/lib/model/trigger.dart b/mycore_api_old/lib/model/trigger.dart new file mode 100644 index 0000000..d471689 --- /dev/null +++ b/mycore_api_old/lib/model/trigger.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 Trigger { + /// Returns a new [Trigger] instance. + Trigger({ + this.providerId, + this.deviceId, + this.stateName, + this.stateValue, + this.type, + }); + + String providerId; + + String deviceId; + + String stateName; + + String stateValue; + + TriggerType type; + + @override + bool operator ==(Object other) => identical(this, other) || other is Trigger && + other.providerId == providerId && + other.deviceId == deviceId && + other.stateName == stateName && + other.stateValue == stateValue && + other.type == type; + + @override + int get hashCode => + (providerId == null ? 0 : providerId.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (stateName == null ? 0 : stateName.hashCode) + + (stateValue == null ? 0 : stateValue.hashCode) + + (type == null ? 0 : type.hashCode); + + @override + String toString() => 'Trigger[providerId=$providerId, deviceId=$deviceId, stateName=$stateName, stateValue=$stateValue, type=$type]'; + + Map toJson() { + final json = {}; + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (stateName != null) { + json[r'stateName'] = stateName; + } + if (stateValue != null) { + json[r'stateValue'] = stateValue; + } + if (type != null) { + json[r'type'] = type; + } + return json; + } + + /// Returns a new [Trigger] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Trigger fromJson(Map json) => json == null + ? null + : Trigger( + providerId: json[r'providerId'], + deviceId: json[r'deviceId'], + stateName: json[r'stateName'], + stateValue: json[r'stateValue'], + type: TriggerType.fromJson(json[r'type']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Trigger.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] = Trigger.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Trigger-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] = Trigger.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/trigger_type.dart b/mycore_api_old/lib/model/trigger_type.dart new file mode 100644 index 0000000..b2e9bac --- /dev/null +++ b/mycore_api_old/lib/model/trigger_type.dart @@ -0,0 +1,79 @@ +// +// 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 TriggerType { + /// Instantiate a new enum with the provided [value]. + const TriggerType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const MQTT = TriggerType._(r'MQTT'); + static const WEB = TriggerType._(r'WEB'); + static const TIME = TriggerType._(r'TIME'); + + /// List of all possible values in this [enum][TriggerType]. + static const values = [ + MQTT, + WEB, + TIME, + ]; + + static TriggerType fromJson(dynamic value) => + TriggerTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => TriggerType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [TriggerType] to String, +/// and [decode] dynamic data back to [TriggerType]. +class TriggerTypeTypeTransformer { + const TriggerTypeTypeTransformer._(); + + factory TriggerTypeTypeTransformer() => _instance ??= TriggerTypeTypeTransformer._(); + + String encode(TriggerType data) => data.value; + + /// Decodes a [dynamic value][data] to a TriggerType. + /// + /// 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. + TriggerType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'MQTT': return TriggerType.MQTT; + case r'WEB': return TriggerType.WEB; + case r'TIME': return TriggerType.TIME; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [TriggerTypeTypeTransformer] instance. + static TriggerTypeTypeTransformer _instance; +} diff --git a/mycore_api_old/lib/model/twitter_auth_model.dart b/mycore_api_old/lib/model/twitter_auth_model.dart new file mode 100644 index 0000000..c9c8c76 --- /dev/null +++ b/mycore_api_old/lib/model/twitter_auth_model.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 TwitterAuthModel { + /// Returns a new [TwitterAuthModel] instance. + TwitterAuthModel({ + this.apiKey, + }); + + String apiKey; + + @override + bool operator ==(Object other) => identical(this, other) || other is TwitterAuthModel && + other.apiKey == apiKey; + + @override + int get hashCode => + (apiKey == null ? 0 : apiKey.hashCode); + + @override + String toString() => 'TwitterAuthModel[apiKey=$apiKey]'; + + Map toJson() { + final json = {}; + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + return json; + } + + /// Returns a new [TwitterAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static TwitterAuthModel fromJson(Map json) => json == null + ? null + : TwitterAuthModel( + apiKey: json[r'apiKey'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => TwitterAuthModel.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] = TwitterAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of TwitterAuthModel-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] = TwitterAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/user.dart b/mycore_api_old/lib/model/user.dart new file mode 100644 index 0000000..5a7e287 --- /dev/null +++ b/mycore_api_old/lib/model/user.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 User { + /// Returns a new [User] instance. + User({ + this.id, + this.password, + }); + + String id; + + String password; + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.password == password; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (password == null ? 0 : password.hashCode); + + @override + String toString() => 'User[id=$id, password=$password]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (password != null) { + json[r'password'] = password; + } + 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'], + password: json[r'password'], + ); + + 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/mycore_api_old/lib/model/user_info.dart b/mycore_api_old/lib/model/user_info.dart new file mode 100644 index 0000000..81876bd --- /dev/null +++ b/mycore_api_old/lib/model/user_info.dart @@ -0,0 +1,221 @@ +// +// 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 UserInfo { + /// Returns a new [UserInfo] instance. + UserInfo({ + this.id, + this.role, + this.email, + this.password, + this.firstName, + this.lastName, + this.token, + this.birthday, + this.homeIds, + this.dateCreation, + this.address, + this.city, + this.state, + this.country, + this.language, + this.timeZone, + this.postalCode, + }); + + String id; + + String role; + + String email; + + String password; + + String firstName; + + String lastName; + + String token; + + DateTime birthday; + + List homeIds; + + DateTime dateCreation; + + String address; + + String city; + + String state; + + String country; + + String language; + + String timeZone; + + int postalCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is UserInfo && + other.id == id && + other.role == role && + other.email == email && + other.password == password && + other.firstName == firstName && + other.lastName == lastName && + other.token == token && + other.birthday == birthday && + other.homeIds == homeIds && + other.dateCreation == dateCreation && + other.address == address && + other.city == city && + other.state == state && + other.country == country && + other.language == language && + other.timeZone == timeZone && + other.postalCode == postalCode; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (role == null ? 0 : role.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) + + (birthday == null ? 0 : birthday.hashCode) + + (homeIds == null ? 0 : homeIds.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (address == null ? 0 : address.hashCode) + + (city == null ? 0 : city.hashCode) + + (state == null ? 0 : state.hashCode) + + (country == null ? 0 : country.hashCode) + + (language == null ? 0 : language.hashCode) + + (timeZone == null ? 0 : timeZone.hashCode) + + (postalCode == null ? 0 : postalCode.hashCode); + + @override + String toString() => 'UserInfo[id=$id, role=$role, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, birthday=$birthday, homeIds=$homeIds, dateCreation=$dateCreation, address=$address, city=$city, state=$state, country=$country, language=$language, timeZone=$timeZone, postalCode=$postalCode]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (role != null) { + json[r'role'] = role; + } + 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 (birthday != null) { + json[r'birthday'] = birthday.toUtc().toIso8601String(); + } + if (homeIds != null) { + json[r'homeIds'] = homeIds; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (address != null) { + json[r'address'] = address; + } + if (city != null) { + json[r'city'] = city; + } + if (state != null) { + json[r'state'] = state; + } + if (country != null) { + json[r'country'] = country; + } + if (language != null) { + json[r'language'] = language; + } + if (timeZone != null) { + json[r'timeZone'] = timeZone; + } + if (postalCode != null) { + json[r'postalCode'] = postalCode; + } + return json; + } + + /// Returns a new [UserInfo] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static UserInfo fromJson(Map json) => json == null + ? null + : UserInfo( + id: json[r'id'], + role: json[r'role'], + email: json[r'email'], + password: json[r'password'], + firstName: json[r'firstName'], + lastName: json[r'lastName'], + token: json[r'token'], + birthday: json[r'birthday'] == null + ? null + : DateTime.parse(json[r'birthday']), + homeIds: json[r'homeIds'] == null + ? null + : (json[r'homeIds'] as List).cast(), + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + address: json[r'address'], + city: json[r'city'], + state: json[r'state'], + country: json[r'country'], + language: json[r'language'], + timeZone: json[r'timeZone'], + postalCode: json[r'postalCode'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => UserInfo.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] = UserInfo.fromJson(v)); + } + return map; + } + + // maps a json object with a list of UserInfo-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] = UserInfo.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/user_info_detail_dto.dart b/mycore_api_old/lib/model/user_info_detail_dto.dart new file mode 100644 index 0000000..d56fe54 --- /dev/null +++ b/mycore_api_old/lib/model/user_info_detail_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 UserInfoDetailDTO { + /// Returns a new [UserInfoDetailDTO] instance. + UserInfoDetailDTO({ + this.id, + this.email, + this.firstName, + this.lastName, + this.language, + this.homeIds, + }); + + String id; + + String email; + + String firstName; + + String lastName; + + String language; + + List homeIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is UserInfoDetailDTO && + other.id == id && + other.email == email && + other.firstName == firstName && + other.lastName == lastName && + other.language == language && + other.homeIds == homeIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (email == null ? 0 : email.hashCode) + + (firstName == null ? 0 : firstName.hashCode) + + (lastName == null ? 0 : lastName.hashCode) + + (language == null ? 0 : language.hashCode) + + (homeIds == null ? 0 : homeIds.hashCode); + + @override + String toString() => 'UserInfoDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName, language=$language, homeIds=$homeIds]'; + + 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; + } + if (language != null) { + json[r'language'] = language; + } + if (homeIds != null) { + json[r'homeIds'] = homeIds; + } + return json; + } + + /// Returns a new [UserInfoDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static UserInfoDetailDTO fromJson(Map json) => json == null + ? null + : UserInfoDetailDTO( + id: json[r'id'], + email: json[r'email'], + firstName: json[r'firstName'], + lastName: json[r'lastName'], + language: json[r'language'], + homeIds: json[r'homeIds'] == null + ? null + : (json[r'homeIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => UserInfoDetailDTO.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] = UserInfoDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of UserInfoDetailDTO-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] = UserInfoDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api_old/lib/model/view_by.dart b/mycore_api_old/lib/model/view_by.dart new file mode 100644 index 0000000..f61f4cc --- /dev/null +++ b/mycore_api_old/lib/model/view_by.dart @@ -0,0 +1,79 @@ +// +// 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 ViewBy { + /// Instantiate a new enum with the provided [value]. + const ViewBy._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const year = ViewBy._(r'Year'); + static const month = ViewBy._(r'Month'); + static const day = ViewBy._(r'Day'); + + /// List of all possible values in this [enum][ViewBy]. + static const values = [ + year, + month, + day, + ]; + + static ViewBy fromJson(dynamic value) => + ViewByTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ViewBy.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ViewBy] to String, +/// and [decode] dynamic data back to [ViewBy]. +class ViewByTypeTransformer { + const ViewByTypeTransformer._(); + + factory ViewByTypeTransformer() => _instance ??= ViewByTypeTransformer._(); + + String encode(ViewBy data) => data.value; + + /// Decodes a [dynamic value][data] to a ViewBy. + /// + /// 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. + ViewBy decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Year': return ViewBy.year; + case r'Month': return ViewBy.month; + case r'Day': return ViewBy.day; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ViewByTypeTransformer] instance. + static ViewByTypeTransformer _instance; +} diff --git a/mycore_api/openapi-dart-generator-4.2.jar b/mycore_api_old/openapi-dart-generator-4.2.jar similarity index 100% rename from mycore_api/openapi-dart-generator-4.2.jar rename to mycore_api_old/openapi-dart-generator-4.2.jar diff --git a/mycore_api/openapi-generator-cli-5.1.0.jar b/mycore_api_old/openapi-generator-cli-5.1.0.jar similarity index 100% rename from mycore_api/openapi-generator-cli-5.1.0.jar rename to mycore_api_old/openapi-generator-cli-5.1.0.jar diff --git a/mycore_api_old/pubspec.yaml b/mycore_api_old/pubspec.yaml new file mode 100644 index 0000000..2a260d4 --- /dev/null +++ b/mycore_api_old/pubspec.yaml @@ -0,0 +1,20 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# + +name: 'mycoreapi' +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/mycore_api/swagger.yaml b/mycore_api_old/swagger.yaml similarity index 100% rename from mycore_api/swagger.yaml rename to mycore_api_old/swagger.yaml diff --git a/mycore_api/swagger.yaml.bak b/mycore_api_old/swagger.yaml.bak similarity index 100% rename from mycore_api/swagger.yaml.bak rename to mycore_api_old/swagger.yaml.bak diff --git a/mycore_api_old/test/action_test.dart b/mycore_api_old/test/action_test.dart new file mode 100644 index 0000000..f3e6914 --- /dev/null +++ b/mycore_api_old/test/action_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Action +void main() { + final instance = Action(); + + group('test Action', () { + // String groupId + test('to test the property `groupId`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // List states (default value: const []) + test('to test the property `states`', () async { + // TODO + }); + + // String rawRequest + test('to test the property `rawRequest`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // ActionType type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/action_type_test.dart b/mycore_api_old/test/action_type_test.dart new file mode 100644 index 0000000..f0c08c3 --- /dev/null +++ b/mycore_api_old/test/action_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ActionType +void main() { + + group('test ActionType', () { + + }); + +} diff --git a/mycore_api_old/test/alarm_api_test.dart b/mycore_api_old/test/alarm_api_test.dart new file mode 100644 index 0000000..57c92e7 --- /dev/null +++ b/mycore_api_old/test/alarm_api_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AlarmApi +void main() { + final instance = AlarmApi(); + + group('tests for AlarmApi', () { + // Activate current alarm mode + // + //Future alarmActivate(String alarmModeId) async + test('test alarmActivate', () async { + // TODO + }); + + // Create an alarm mode + // + //Future alarmCreate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async + test('test alarmCreate', () async { + // TODO + }); + + // Create default alarm modes + // + //Future alarmCreateDefaultAlarms(String homeId) async + test('test alarmCreateDefaultAlarms', () async { + // TODO + }); + + // Delete an alarm mode + // + //Future alarmDelete(String alarmModeId) async + test('test alarmDelete', () async { + // TODO + }); + + // Delete all alarm mode for a specified home + // + //Future alarmDeleteAllForHome(String homeId) async + test('test alarmDeleteAllForHome', () async { + // TODO + }); + + // Get all alarm modes for the specified home + // + //Future> alarmGetAll(String homeId) async + test('test alarmGetAll', () async { + // TODO + }); + + // Get detail info of a specified alarm mode + // + //Future alarmGetDetail(String alarmId, { String alarmModeId }) async + test('test alarmGetDetail', () async { + // TODO + }); + + // Update an alarm mode + // + //Future alarmUpdate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async + test('test alarmUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/alarm_mode_create_or_update_detail_dto_all_of_test.dart b/mycore_api_old/test/alarm_mode_create_or_update_detail_dto_all_of_test.dart new file mode 100644 index 0000000..3152fe5 --- /dev/null +++ b/mycore_api_old/test/alarm_mode_create_or_update_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeCreateOrUpdateDetailDTOAllOf +void main() { + final instance = AlarmModeCreateOrUpdateDetailDTOAllOf(); + + group('test AlarmModeCreateOrUpdateDetailDTOAllOf', () { + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // OneOfProgrammedMode programmedMode + test('to test the property `programmedMode`', () async { + // TODO + }); + + // OneOfGeolocalizedMode geolocalizedMode + test('to test the property `geolocalizedMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_mode_create_or_update_detail_dto_test.dart b/mycore_api_old/test/alarm_mode_create_or_update_detail_dto_test.dart new file mode 100644 index 0000000..c3ffe13 --- /dev/null +++ b/mycore_api_old/test/alarm_mode_create_or_update_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeCreateOrUpdateDetailDTO +void main() { + final instance = AlarmModeCreateOrUpdateDetailDTO(); + + group('test AlarmModeCreateOrUpdateDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // bool notification + test('to test the property `notification`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // OneOfProgrammedMode programmedMode + test('to test the property `programmedMode`', () async { + // TODO + }); + + // OneOfGeolocalizedMode geolocalizedMode + test('to test the property `geolocalizedMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_mode_detail_dto_all_of_test.dart b/mycore_api_old/test/alarm_mode_detail_dto_all_of_test.dart new file mode 100644 index 0000000..c9776e5 --- /dev/null +++ b/mycore_api_old/test/alarm_mode_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeDetailDTOAllOf +void main() { + final instance = AlarmModeDetailDTOAllOf(); + + group('test AlarmModeDetailDTOAllOf', () { + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + // OneOfProgrammedMode programmedMode + test('to test the property `programmedMode`', () async { + // TODO + }); + + // OneOfGeolocalizedMode geolocalizedMode + test('to test the property `geolocalizedMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_mode_detail_dto_test.dart b/mycore_api_old/test/alarm_mode_detail_dto_test.dart new file mode 100644 index 0000000..8c886aa --- /dev/null +++ b/mycore_api_old/test/alarm_mode_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeDetailDTO +void main() { + final instance = AlarmModeDetailDTO(); + + group('test AlarmModeDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // bool notification + test('to test the property `notification`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + // OneOfProgrammedMode programmedMode + test('to test the property `programmedMode`', () async { + // TODO + }); + + // OneOfGeolocalizedMode geolocalizedMode + test('to test the property `geolocalizedMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_mode_dto_test.dart b/mycore_api_old/test/alarm_mode_dto_test.dart new file mode 100644 index 0000000..5ee6258 --- /dev/null +++ b/mycore_api_old/test/alarm_mode_dto_test.dart @@ -0,0 +1,66 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmModeDTO +void main() { + final instance = AlarmModeDTO(); + + group('test AlarmModeDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // bool notification + test('to test the property `notification`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_mode_test.dart b/mycore_api_old/test/alarm_mode_test.dart new file mode 100644 index 0000000..82856c2 --- /dev/null +++ b/mycore_api_old/test/alarm_mode_test.dart @@ -0,0 +1,91 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmMode +void main() { + final instance = AlarmMode(); + + group('test AlarmMode', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // bool notification + test('to test the property `notification`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + // OneOfProgrammedMode programmedMode + test('to test the property `programmedMode`', () async { + // TODO + }); + + // OneOfGeolocalizedMode geolocalizedMode + test('to test the property `geolocalizedMode`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_triggered_test.dart b/mycore_api_old/test/alarm_triggered_test.dart new file mode 100644 index 0000000..afb0001 --- /dev/null +++ b/mycore_api_old/test/alarm_triggered_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmTriggered +void main() { + final instance = AlarmTriggered(); + + group('test AlarmTriggered', () { + // String alarmModeId + test('to test the property `alarmModeId`', () async { + // TODO + }); + + // String alarmModeName + test('to test the property `alarmModeName`', () async { + // TODO + }); + + // AlarmType type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/alarm_type_test.dart b/mycore_api_old/test/alarm_type_test.dart new file mode 100644 index 0000000..a37cbb6 --- /dev/null +++ b/mycore_api_old/test/alarm_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AlarmType +void main() { + + group('test AlarmType', () { + + }); + +} diff --git a/mycore_api_old/test/authentication_api_test.dart b/mycore_api_old/test/authentication_api_test.dart new file mode 100644 index 0000000..ff8de62 --- /dev/null +++ b/mycore_api_old/test/authentication_api_test.dart @@ -0,0 +1,34 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AuthenticationApi +void main() { + final instance = AuthenticationApi(); + + group('tests for AuthenticationApi', () { + // Authenticate with form parameters (used by Swagger test client) + // + //Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async + test('test authenticationAuthenticateWithForm', () async { + // TODO + }); + + // Authenticate with Json parameters (used by most clients) + // + //Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async + test('test authenticationAuthenticateWithJson', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/automation_api_test.dart b/mycore_api_old/test/automation_api_test.dart new file mode 100644 index 0000000..cef701b --- /dev/null +++ b/mycore_api_old/test/automation_api_test.dart @@ -0,0 +1,60 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AutomationApi +void main() { + final instance = AutomationApi(); + + group('tests for AutomationApi', () { + //Future automationCreate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async + test('test automationCreate', () async { + // TODO + }); + + // Delete an automation + // + //Future automationDelete(String automationId) async + test('test automationDelete', () async { + // TODO + }); + + // Delete all automation for a specified + // + //Future automationDeleteAllForUser(String userId) async + test('test automationDeleteAllForUser', () async { + // TODO + }); + + // Get all automations for the specified user + // + //Future> automationGetAll(String userId) async + test('test automationGetAll', () async { + // TODO + }); + + // Get detail info of a specified automation + // + //Future automationGetDetail(String automationId) async + test('test automationGetDetail', () async { + // TODO + }); + + // Update an automation + // + //Future automationUpdate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async + test('test automationUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/automation_create_or_update_detail_dto_all_of_test.dart b/mycore_api_old/test/automation_create_or_update_detail_dto_all_of_test.dart similarity index 100% rename from mycore_api/test/automation_create_or_update_detail_dto_all_of_test.dart rename to mycore_api_old/test/automation_create_or_update_detail_dto_all_of_test.dart diff --git a/mycore_api/test/automation_create_or_update_detail_dto_test.dart b/mycore_api_old/test/automation_create_or_update_detail_dto_test.dart similarity index 100% rename from mycore_api/test/automation_create_or_update_detail_dto_test.dart rename to mycore_api_old/test/automation_create_or_update_detail_dto_test.dart diff --git a/mycore_api_old/test/automation_detail_dto_all_of_test.dart b/mycore_api_old/test/automation_detail_dto_all_of_test.dart new file mode 100644 index 0000000..cd53513 --- /dev/null +++ b/mycore_api_old/test/automation_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationDetailDTOAllOf +void main() { + final instance = AutomationDetailDTOAllOf(); + + group('test AutomationDetailDTOAllOf', () { + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/automation_detail_dto_test.dart b/mycore_api_old/test/automation_detail_dto_test.dart new file mode 100644 index 0000000..d5efa73 --- /dev/null +++ b/mycore_api_old/test/automation_detail_dto_test.dart @@ -0,0 +1,66 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationDetailDTO +void main() { + final instance = AutomationDetailDTO(); + + group('test AutomationDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/automation_dto_test.dart b/mycore_api_old/test/automation_dto_test.dart new file mode 100644 index 0000000..c3230e5 --- /dev/null +++ b/mycore_api_old/test/automation_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationDTO +void main() { + final instance = AutomationDTO(); + + group('test AutomationDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/automation_state_test.dart b/mycore_api_old/test/automation_state_test.dart new file mode 100644 index 0000000..c4880f7 --- /dev/null +++ b/mycore_api_old/test/automation_state_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationState +void main() { + final instance = AutomationState(); + + group('test AutomationState', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String value + test('to test the property `value`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/automation_test.dart b/mycore_api_old/test/automation_test.dart similarity index 100% rename from mycore_api/test/automation_test.dart rename to mycore_api_old/test/automation_test.dart diff --git a/mycore_api_old/test/automation_triggered_test.dart b/mycore_api_old/test/automation_triggered_test.dart new file mode 100644 index 0000000..7ead09b --- /dev/null +++ b/mycore_api_old/test/automation_triggered_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationTriggered +void main() { + final instance = AutomationTriggered(); + + group('test AutomationTriggered', () { + // String automationId + test('to test the property `automationId`', () async { + // TODO + }); + + // String automationName + test('to test the property `automationName`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/azure_ad_auth_model_test.dart b/mycore_api_old/test/azure_ad_auth_model_test.dart new file mode 100644 index 0000000..61e3f1d --- /dev/null +++ b/mycore_api_old/test/azure_ad_auth_model_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AzureADAuthModel +void main() { + final instance = AzureADAuthModel(); + + group('test AzureADAuthModel', () { + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/azure_api_test.dart b/mycore_api_old/test/azure_api_test.dart new file mode 100644 index 0000000..06fb54d --- /dev/null +++ b/mycore_api_old/test/azure_api_test.dart @@ -0,0 +1,25 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AzureApi +void main() { + final instance = AzureApi(); + + group('tests for AzureApi', () { + //Future azureCreate(AzureADAuthModel azureADAuthModel) async + test('test azureCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/book_test.dart b/mycore_api_old/test/book_test.dart new file mode 100644 index 0000000..5099f95 --- /dev/null +++ b/mycore_api_old/test/book_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Book +void main() { + final instance = Book(); + + group('test Book', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String bookName + test('to test the property `bookName`', () async { + // TODO + }); + + // num price + test('to test the property `price`', () async { + // TODO + }); + + // String category + test('to test the property `category`', () async { + // TODO + }); + + // String author + test('to test the property `author`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/books_api_test.dart b/mycore_api_old/test/books_api_test.dart new file mode 100644 index 0000000..53ddc9a --- /dev/null +++ b/mycore_api_old/test/books_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for BooksApi +void main() { + final instance = BooksApi(); + + group('tests for BooksApi', () { + //Future booksCreate(Book book) async + test('test booksCreate', () async { + // TODO + }); + + //Future booksDelete(String id) async + test('test booksDelete', () async { + // TODO + }); + + //Future booksGet(String id) async + test('test booksGet', () async { + // TODO + }); + + //Future> booksGetAll() async + test('test booksGetAll', () async { + // TODO + }); + + //Future booksUpdate(String id, Book book) async + test('test booksUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/condition_test.dart b/mycore_api_old/test/condition_test.dart new file mode 100644 index 0000000..82ae0fb --- /dev/null +++ b/mycore_api_old/test/condition_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Condition +void main() { + final instance = Condition(); + + group('test Condition', () { + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // OneOfState state + test('to test the property `state`', () async { + // TODO + }); + + // String startTime + test('to test the property `startTime`', () async { + // TODO + }); + + // String endTime + test('to test the property `endTime`', () async { + // TODO + }); + + // ConditionType type + test('to test the property `type`', () async { + // TODO + }); + + // ConditionValue value + test('to test the property `value`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/condition_type_test.dart b/mycore_api_old/test/condition_type_test.dart new file mode 100644 index 0000000..acdff11 --- /dev/null +++ b/mycore_api_old/test/condition_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConditionType +void main() { + + group('test ConditionType', () { + + }); + +} diff --git a/mycore_api_old/test/condition_value_test.dart b/mycore_api_old/test/condition_value_test.dart new file mode 100644 index 0000000..efb3270 --- /dev/null +++ b/mycore_api_old/test/condition_value_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConditionValue +void main() { + + group('test ConditionValue', () { + + }); + +} diff --git a/mycore_api_old/test/connection_status_test.dart b/mycore_api_old/test/connection_status_test.dart new file mode 100644 index 0000000..b5e0825 --- /dev/null +++ b/mycore_api_old/test/connection_status_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConnectionStatus +void main() { + + group('test ConnectionStatus', () { + + }); + +} diff --git a/mycore_api_old/test/create_or_update_home_dto_all_of_test.dart b/mycore_api_old/test/create_or_update_home_dto_all_of_test.dart new file mode 100644 index 0000000..32e11d2 --- /dev/null +++ b/mycore_api_old/test/create_or_update_home_dto_all_of_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateOrUpdateHomeDTOAllOf +void main() { + final instance = CreateOrUpdateHomeDTOAllOf(); + + group('test CreateOrUpdateHomeDTOAllOf', () { + // List usersIds (default value: const []) + test('to test the property `usersIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/create_or_update_home_dto_test.dart b/mycore_api_old/test/create_or_update_home_dto_test.dart new file mode 100644 index 0000000..c4e08bc --- /dev/null +++ b/mycore_api_old/test/create_or_update_home_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateOrUpdateHomeDTO +void main() { + final instance = CreateOrUpdateHomeDTO(); + + group('test CreateOrUpdateHomeDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // OneOfAlarmModeDTO currentAlarmMode + test('to test the property `currentAlarmMode`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List usersIds (default value: const []) + test('to test the property `usersIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/device_api_test.dart b/mycore_api_old/test/device_api_test.dart new file mode 100644 index 0000000..7f0c599 --- /dev/null +++ b/mycore_api_old/test/device_api_test.dart @@ -0,0 +1,97 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for DeviceApi +void main() { + final instance = DeviceApi(); + + group('tests for DeviceApi', () { + // Create a device + // + //Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async + test('test deviceCreate', () async { + // TODO + }); + + // Create devices from provider + // + //Future> deviceCreateDevicesFromProvider(String userId, String providerId) async + test('test deviceCreateDevicesFromProvider', () async { + // TODO + }); + + // Delete a device + // + //Future deviceDelete(String deviceId) async + test('test deviceDelete', () async { + // TODO + }); + + // Delete all device for a specified + // + //Future deviceDeleteAllForUser(String userId) async + test('test deviceDeleteAllForUser', () async { + // TODO + }); + + // Delete devices from provider + // + //Future deviceDeleteDevicesFromProvider(String userId, String providerId) async + test('test deviceDeleteDevicesFromProvider', () async { + // TODO + }); + + // Get all devices summary + // + //Future> deviceGetAll(String userId) async + test('test deviceGetAll', () async { + // TODO + }); + + // Get a specific device info + // + //Future deviceGetDetail(String deviceId) async + test('test deviceGetDetail', () async { + // TODO + }); + + // Get list of devices from a type + // + //Future> deviceGetDevicesByType(String userId, DeviceType type) async + test('test deviceGetDevicesByType', () async { + // TODO + }); + + // Get devices from provider + // + //Future> deviceGetDevicesFromProvider(String userId, String providerId) async + test('test deviceGetDevicesFromProvider', () async { + // TODO + }); + + // Get all zigbee2Mqtt devices + // + //Future> deviceGetDevicesFromZigbee2Mqtt(String userId) async + test('test deviceGetDevicesFromZigbee2Mqtt', () async { + // TODO + }); + + // Update a device + // + //Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO) async + test('test deviceUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/device_detail_dto_all_of_test.dart b/mycore_api_old/test/device_detail_dto_all_of_test.dart new file mode 100644 index 0000000..0f33460 --- /dev/null +++ b/mycore_api_old/test/device_detail_dto_all_of_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTOAllOf +void main() { + final instance = DeviceDetailDTOAllOf(); + + group('test DeviceDetailDTOAllOf', () { + // String firmwareVersion + test('to test the property `firmwareVersion`', () async { + // TODO + }); + + // String hardwareVersion + test('to test the property `hardwareVersion`', () async { + // TODO + }); + + // int port + test('to test the property `port`', () async { + // TODO + }); + + // List meansOfCommunications (default value: const []) + test('to test the property `meansOfCommunications`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // String lastState + test('to test the property `lastState`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String serviceIdentification + test('to test the property `serviceIdentification`', () async { + // TODO + }); + + // String manufacturerName + test('to test the property `manufacturerName`', () async { + // TODO + }); + + // List groupIds (default value: const []) + test('to test the property `groupIds`', () async { + // TODO + }); + + // Map properties (default value: const {}) + test('to test the property `properties`', () async { + // TODO + }); + + // List supportedOperations (default value: const []) + test('to test the property `supportedOperations`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/device_detail_dto_test.dart b/mycore_api_old/test/device_detail_dto_test.dart new file mode 100644 index 0000000..6e6d788 --- /dev/null +++ b/mycore_api_old/test/device_detail_dto_test.dart @@ -0,0 +1,161 @@ +// +// 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:mycoreapi/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 userId + test('to test the property `userId`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String model + test('to test the property `model`', () async { + // TODO + }); + + // DeviceType type + test('to test the property `type`', () async { + // TODO + }); + + // bool status + test('to test the property `status`', () async { + // TODO + }); + + // ConnectionStatus connectionStatus + test('to test the property `connectionStatus`', () async { + // TODO + }); + + // String locationId + test('to test the property `locationId`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String providerName + test('to test the property `providerName`', () async { + // TODO + }); + + // OneOfLocationDTO location + test('to test the property `location`', () async { + // TODO + }); + + // DateTime lastStateDate + test('to test the property `lastStateDate`', () async { + // TODO + }); + + // bool battery + test('to test the property `battery`', () async { + // TODO + }); + + // int batteryStatus + test('to test the property `batteryStatus`', () async { + // TODO + }); + + // String firmwareVersion + test('to test the property `firmwareVersion`', () async { + // TODO + }); + + // String hardwareVersion + test('to test the property `hardwareVersion`', () async { + // TODO + }); + + // int port + test('to test the property `port`', () async { + // TODO + }); + + // List meansOfCommunications (default value: const []) + test('to test the property `meansOfCommunications`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // String lastState + test('to test the property `lastState`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String serviceIdentification + test('to test the property `serviceIdentification`', () async { + // TODO + }); + + // String manufacturerName + test('to test the property `manufacturerName`', () async { + // TODO + }); + + // List groupIds (default value: const []) + test('to test the property `groupIds`', () async { + // TODO + }); + + // Map properties (default value: const {}) + test('to test the property `properties`', () async { + // TODO + }); + + // List supportedOperations (default value: const []) + test('to test the property `supportedOperations`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/device_state_test.dart b/mycore_api_old/test/device_state_test.dart new file mode 100644 index 0000000..fcb572f --- /dev/null +++ b/mycore_api_old/test/device_state_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceState +void main() { + final instance = DeviceState(); + + group('test DeviceState', () { + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String deviceName + test('to test the property `deviceName`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + // DeviceType deviceType + test('to test the property `deviceType`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/device_summary_dto_test.dart b/mycore_api_old/test/device_summary_dto_test.dart new file mode 100644 index 0000000..fd43725 --- /dev/null +++ b/mycore_api_old/test/device_summary_dto_test.dart @@ -0,0 +1,96 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceSummaryDTO +void main() { + final instance = DeviceSummaryDTO(); + + group('test DeviceSummaryDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String model + test('to test the property `model`', () async { + // TODO + }); + + // DeviceType type + test('to test the property `type`', () async { + // TODO + }); + + // bool status + test('to test the property `status`', () async { + // TODO + }); + + // ConnectionStatus connectionStatus + test('to test the property `connectionStatus`', () async { + // TODO + }); + + // String locationId + test('to test the property `locationId`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String providerName + test('to test the property `providerName`', () async { + // TODO + }); + + // OneOfLocationDTO location + test('to test the property `location`', () async { + // TODO + }); + + // DateTime lastStateDate + test('to test the property `lastStateDate`', () async { + // TODO + }); + + // bool battery + test('to test the property `battery`', () async { + // TODO + }); + + // int batteryStatus + test('to test the property `batteryStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/device_test.dart b/mycore_api_old/test/device_test.dart similarity index 100% rename from mycore_api/test/device_test.dart rename to mycore_api_old/test/device_test.dart diff --git a/mycore_api_old/test/device_type_test.dart b/mycore_api_old/test/device_type_test.dart new file mode 100644 index 0000000..ad3d2e4 --- /dev/null +++ b/mycore_api_old/test/device_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceType +void main() { + + group('test DeviceType', () { + + }); + +} diff --git a/mycore_api_old/test/electricity_production_test.dart b/mycore_api_old/test/electricity_production_test.dart new file mode 100644 index 0000000..e366f6e --- /dev/null +++ b/mycore_api_old/test/electricity_production_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ElectricityProduction +void main() { + final instance = ElectricityProduction(); + + group('test ElectricityProduction', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // double watt + test('to test the property `watt`', () async { + // TODO + }); + + // double ampere + test('to test the property `ampere`', () async { + // TODO + }); + + // DateTime timestamp + test('to test the property `timestamp`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/energy_api_test.dart b/mycore_api_old/test/energy_api_test.dart new file mode 100644 index 0000000..3b3e5ad --- /dev/null +++ b/mycore_api_old/test/energy_api_test.dart @@ -0,0 +1,27 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for EnergyApi +void main() { + final instance = EnergyApi(); + + group('tests for EnergyApi', () { + // Get summary production of Kwh/Year + // + //Future> energyGetElectricityProduction({ String userId, ViewBy viewBy }) async + test('test energyGetElectricityProduction', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/event_api_test.dart b/mycore_api_old/test/event_api_test.dart new file mode 100644 index 0000000..3c7170a --- /dev/null +++ b/mycore_api_old/test/event_api_test.dart @@ -0,0 +1,48 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for EventApi +void main() { + final instance = EventApi(); + + group('tests for EventApi', () { + // Delete an event + // + //Future eventDelete(String eventId) async + test('test eventDelete', () async { + // TODO + }); + + // Delete all events for a specified home + // + //Future eventDeleteAllForHome(String homeId) async + test('test eventDeleteAllForHome', () async { + // TODO + }); + + // Get events for the specified home + // + //Future> eventGet(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, OneOfEventType eventType, OneOfDeviceType deviceType }) async + test('test eventGet', () async { + // TODO + }); + + // Get detail info of a specified event + // + //Future eventGetDetail(String eventId) async + test('test eventGetDetail', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/event_detail_dto_all_of_test.dart b/mycore_api_old/test/event_detail_dto_all_of_test.dart new file mode 100644 index 0000000..535224d --- /dev/null +++ b/mycore_api_old/test/event_detail_dto_all_of_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventDetailDTOAllOf +void main() { + final instance = EventDetailDTOAllOf(); + + group('test EventDetailDTOAllOf', () { + // OneOfDeviceState deviceState + test('to test the property `deviceState`', () async { + // TODO + }); + + // OneOfAutomationTriggered automationTriggered + test('to test the property `automationTriggered`', () async { + // TODO + }); + + // OneOfAlarmTriggered alarmTriggered + test('to test the property `alarmTriggered`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/event_detail_dto_test.dart b/mycore_api_old/test/event_detail_dto_test.dart new file mode 100644 index 0000000..5bebf78 --- /dev/null +++ b/mycore_api_old/test/event_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventDetailDTO +void main() { + final instance = EventDetailDTO(); + + group('test EventDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // EventType type + test('to test the property `type`', () async { + // TODO + }); + + // String roomId + test('to test the property `roomId`', () async { + // TODO + }); + + // OneOfDeviceState deviceState + test('to test the property `deviceState`', () async { + // TODO + }); + + // OneOfAutomationTriggered automationTriggered + test('to test the property `automationTriggered`', () async { + // TODO + }); + + // OneOfAlarmTriggered alarmTriggered + test('to test the property `alarmTriggered`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/event_dto_test.dart b/mycore_api_old/test/event_dto_test.dart new file mode 100644 index 0000000..8f33ab0 --- /dev/null +++ b/mycore_api_old/test/event_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventDTO +void main() { + final instance = EventDTO(); + + group('test EventDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // EventType type + test('to test the property `type`', () async { + // TODO + }); + + // String roomId + test('to test the property `roomId`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/event_filter_test.dart b/mycore_api_old/test/event_filter_test.dart new file mode 100644 index 0000000..23372b7 --- /dev/null +++ b/mycore_api_old/test/event_filter_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventFilter +void main() { + final instance = EventFilter(); + + group('test EventFilter', () { + // int startIndex + test('to test the property `startIndex`', () async { + // TODO + }); + + // int count + test('to test the property `count`', () async { + // TODO + }); + + // DateTime dateStart + test('to test the property `dateStart`', () async { + // TODO + }); + + // DateTime dateEnd + test('to test the property `dateEnd`', () async { + // TODO + }); + + // OneOfEventType eventType + test('to test the property `eventType`', () async { + // TODO + }); + + // OneOfDeviceType deviceType + test('to test the property `deviceType`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/event_home_filter_all_of_test.dart b/mycore_api_old/test/event_home_filter_all_of_test.dart new file mode 100644 index 0000000..3ce0036 --- /dev/null +++ b/mycore_api_old/test/event_home_filter_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventHomeFilterAllOf +void main() { + final instance = EventHomeFilterAllOf(); + + group('test EventHomeFilterAllOf', () { + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String roomId + test('to test the property `roomId`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/event_home_filter_test.dart b/mycore_api_old/test/event_home_filter_test.dart new file mode 100644 index 0000000..199f1c0 --- /dev/null +++ b/mycore_api_old/test/event_home_filter_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventHomeFilter +void main() { + final instance = EventHomeFilter(); + + group('test EventHomeFilter', () { + // int startIndex + test('to test the property `startIndex`', () async { + // TODO + }); + + // int count + test('to test the property `count`', () async { + // TODO + }); + + // DateTime dateStart + test('to test the property `dateStart`', () async { + // TODO + }); + + // DateTime dateEnd + test('to test the property `dateEnd`', () async { + // TODO + }); + + // OneOfEventType eventType + test('to test the property `eventType`', () async { + // TODO + }); + + // OneOfDeviceType deviceType + test('to test the property `deviceType`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String roomId + test('to test the property `roomId`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/event_type_test.dart b/mycore_api_old/test/event_type_test.dart new file mode 100644 index 0000000..4cf4c36 --- /dev/null +++ b/mycore_api_old/test/event_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for EventType +void main() { + + group('test EventType', () { + + }); + +} diff --git a/mycore_api_old/test/facebook_api_test.dart b/mycore_api_old/test/facebook_api_test.dart new file mode 100644 index 0000000..5c125fb --- /dev/null +++ b/mycore_api_old/test/facebook_api_test.dart @@ -0,0 +1,25 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for FacebookApi +void main() { + final instance = FacebookApi(); + + group('tests for FacebookApi', () { + //Future facebookCreate(FacebookAuthModel facebookAuthModel) async + test('test facebookCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/facebook_auth_model_test.dart b/mycore_api_old/test/facebook_auth_model_test.dart new file mode 100644 index 0000000..052e505 --- /dev/null +++ b/mycore_api_old/test/facebook_auth_model_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for FacebookAuthModel +void main() { + final instance = FacebookAuthModel(); + + group('test FacebookAuthModel', () { + // String userAccessToken + test('to test the property `userAccessToken`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/geolocalized_mode_test.dart b/mycore_api_old/test/geolocalized_mode_test.dart new file mode 100644 index 0000000..80de9be --- /dev/null +++ b/mycore_api_old/test/geolocalized_mode_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GeolocalizedMode +void main() { + final instance = GeolocalizedMode(); + + group('test GeolocalizedMode', () { + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // OneOfAlarmMode homeMode + test('to test the property `homeMode`', () async { + // TODO + }); + + // OneOfAlarmMode absentMode + test('to test the property `absentMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/google_api_test.dart b/mycore_api_old/test/google_api_test.dart new file mode 100644 index 0000000..552b71e --- /dev/null +++ b/mycore_api_old/test/google_api_test.dart @@ -0,0 +1,25 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for GoogleApi +void main() { + final instance = GoogleApi(); + + group('tests for GoogleApi', () { + //Future googleCreate(GoogleAuthModel googleAuthModel) async + test('test googleCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/google_auth_model_test.dart b/mycore_api_old/test/google_auth_model_test.dart new file mode 100644 index 0000000..3fee505 --- /dev/null +++ b/mycore_api_old/test/google_auth_model_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GoogleAuthModel +void main() { + final instance = GoogleAuthModel(); + + group('test GoogleAuthModel', () { + // String authorizationCode + test('to test the property `authorizationCode`', () async { + // TODO + }); + + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/group_api_test.dart b/mycore_api_old/test/group_api_test.dart new file mode 100644 index 0000000..6e44a50 --- /dev/null +++ b/mycore_api_old/test/group_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for GroupApi +void main() { + final instance = GroupApi(); + + group('tests for GroupApi', () { + // Create a group + // + //Future groupCreate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async + test('test groupCreate', () async { + // TODO + }); + + // Create groups from provider + // + //Future> groupCreateDevicesFromZigbee2Mqtt(String userId) async + test('test groupCreateDevicesFromZigbee2Mqtt', () async { + // TODO + }); + + // Delete device from a group + // + //Future groupDelete(String deviceId, String groupId) async + test('test groupDelete', () async { + // TODO + }); + + // Delete a group + // + //Future groupDelete2(String groupId) async + test('test groupDelete2', () async { + // TODO + }); + + // Delete all group for a specified + // + //Future groupDeleteAllForUser(String userId) async + test('test groupDeleteAllForUser', () async { + // TODO + }); + + // Get all groups for the specified user + // + //Future> groupGetAll(String userId) async + test('test groupGetAll', () async { + // TODO + }); + + // Get detail info of a specified group + // + //Future groupGetDetail(String groupId, { String userId }) async + test('test groupGetDetail', () async { + // TODO + }); + + // Get list of group from a type + // + //Future> groupGetGroupsByType(String userId, String type) async + test('test groupGetGroupsByType', () async { + // TODO + }); + + // Get all zigbee2Mqtt groups + // + //Future> groupGetGroupsFromZigbee2Mqtt(String userId) async + test('test groupGetGroupsFromZigbee2Mqtt', () async { + // TODO + }); + + // Update a group + // + //Future groupUpdate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async + test('test groupUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/group_create_or_update_detail_dto_all_of_test.dart b/mycore_api_old/test/group_create_or_update_detail_dto_all_of_test.dart new file mode 100644 index 0000000..3977a0c --- /dev/null +++ b/mycore_api_old/test/group_create_or_update_detail_dto_all_of_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupCreateOrUpdateDetailDTOAllOf +void main() { + final instance = GroupCreateOrUpdateDetailDTOAllOf(); + + group('test GroupCreateOrUpdateDetailDTOAllOf', () { + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/group_create_or_update_detail_dto_test.dart b/mycore_api_old/test/group_create_or_update_detail_dto_test.dart new file mode 100644 index 0000000..fbf296f --- /dev/null +++ b/mycore_api_old/test/group_create_or_update_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupCreateOrUpdateDetailDTO +void main() { + final instance = GroupCreateOrUpdateDetailDTO(); + + group('test GroupCreateOrUpdateDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/group_detail_dto_all_of_test.dart b/mycore_api_old/test/group_detail_dto_all_of_test.dart new file mode 100644 index 0000000..4690916 --- /dev/null +++ b/mycore_api_old/test/group_detail_dto_all_of_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupDetailDTOAllOf +void main() { + final instance = GroupDetailDTOAllOf(); + + group('test GroupDetailDTOAllOf', () { + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/group_detail_dto_test.dart b/mycore_api_old/test/group_detail_dto_test.dart new file mode 100644 index 0000000..854395b --- /dev/null +++ b/mycore_api_old/test/group_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupDetailDTO +void main() { + final instance = GroupDetailDTO(); + + group('test GroupDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/group_summary_dto_test.dart b/mycore_api_old/test/group_summary_dto_test.dart new file mode 100644 index 0000000..56cf15f --- /dev/null +++ b/mycore_api_old/test/group_summary_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupSummaryDTO +void main() { + final instance = GroupSummaryDTO(); + + group('test GroupSummaryDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_test.dart b/mycore_api_old/test/group_test.dart similarity index 100% rename from mycore_api/test/group_test.dart rename to mycore_api_old/test/group_test.dart diff --git a/mycore_api_old/test/home_api_test.dart b/mycore_api_old/test/home_api_test.dart new file mode 100644 index 0000000..134e5ed --- /dev/null +++ b/mycore_api_old/test/home_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for HomeApi +void main() { + final instance = HomeApi(); + + group('tests for HomeApi', () { + // Create a home + // + //Future homeCreate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async + test('test homeCreate', () async { + // TODO + }); + + // Delete a home + // + //Future homeDelete(String homeId) async + test('test homeDelete', () async { + // TODO + }); + + // Get all home for specified user + // + //Future> homeGetAll(String userId) async + test('test homeGetAll', () async { + // TODO + }); + + // Get detail info of a specified home + // + //Future homeGetDetail(String homeId) async + test('test homeGetDetail', () async { + // TODO + }); + + // Update a home + // + //Future homeUpdate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async + test('test homeUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/home_detail_dto_all_of_test.dart b/mycore_api_old/test/home_detail_dto_all_of_test.dart new file mode 100644 index 0000000..018efe6 --- /dev/null +++ b/mycore_api_old/test/home_detail_dto_all_of_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for HomeDetailDTOAllOf +void main() { + final instance = HomeDetailDTOAllOf(); + + group('test HomeDetailDTOAllOf', () { + // List users (default value: const []) + test('to test the property `users`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + // List automations (default value: const []) + test('to test the property `automations`', () async { + // TODO + }); + + // List providers (default value: const []) + test('to test the property `providers`', () async { + // TODO + }); + + // List groups (default value: const []) + test('to test the property `groups`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/home_detail_dto_test.dart b/mycore_api_old/test/home_detail_dto_test.dart new file mode 100644 index 0000000..d99cd0a --- /dev/null +++ b/mycore_api_old/test/home_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for HomeDetailDTO +void main() { + final instance = HomeDetailDTO(); + + group('test HomeDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // OneOfAlarmModeDTO currentAlarmMode + test('to test the property `currentAlarmMode`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List usersIds (default value: const []) + test('to test the property `usersIds`', () async { + // TODO + }); + + // List users (default value: const []) + test('to test the property `users`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + // List automations (default value: const []) + test('to test the property `automations`', () async { + // TODO + }); + + // List providers (default value: const []) + test('to test the property `providers`', () async { + // TODO + }); + + // List groups (default value: const []) + test('to test the property `groups`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/home_dto_test.dart b/mycore_api_old/test/home_dto_test.dart new file mode 100644 index 0000000..33474fa --- /dev/null +++ b/mycore_api_old/test/home_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for HomeDTO +void main() { + final instance = HomeDTO(); + + group('test HomeDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // OneOfAlarmModeDTO currentAlarmMode + test('to test the property `currentAlarmMode`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List usersIds (default value: const []) + test('to test the property `usersIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/iot_api_test.dart b/mycore_api_old/test/iot_api_test.dart new file mode 100644 index 0000000..eb6b467 --- /dev/null +++ b/mycore_api_old/test/iot_api_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for IOTApi +void main() { + final instance = IOTApi(); + + group('tests for IOTApi', () { + // Retrieve all SmartPrinterMessage + // + //Future> iOTGetSmartPrinterMessages(String idDevice, { int id }) async + test('test iOTGetSmartPrinterMessages', () async { + // TODO + }); + + // It's the method to post data from mqtt broker to Database (Thanks Rpi!) + // + //Future iOTPostToDBPrinter(int idDevice, List smartPrinterMessage) async + test('test iOTPostToDBPrinter', () async { + // TODO + }); + + // It's the method to post data from mqtt broker to Database (Thanks Rpi!) + // + //Future iOTPostToDBSmartGarden(int idDevice, List smartGardenMessage) async + test('test iOTPostToDBSmartGarden', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/layout_api_test.dart b/mycore_api_old/test/layout_api_test.dart new file mode 100644 index 0000000..dfe6a96 --- /dev/null +++ b/mycore_api_old/test/layout_api_test.dart @@ -0,0 +1,27 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for LayoutApi +void main() { + final instance = LayoutApi(); + + group('tests for LayoutApi', () { + // It's a test ! :) + // + //Future> layoutGet() async + test('test layoutGet', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/list_response_of_event_detail_dto_and_event_home_filter_test.dart b/mycore_api_old/test/list_response_of_event_detail_dto_and_event_home_filter_test.dart new file mode 100644 index 0000000..e8735b7 --- /dev/null +++ b/mycore_api_old/test/list_response_of_event_detail_dto_and_event_home_filter_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ListResponseOfEventDetailDTOAndEventHomeFilter +void main() { + final instance = ListResponseOfEventDetailDTOAndEventHomeFilter(); + + group('test ListResponseOfEventDetailDTOAndEventHomeFilter', () { + // List values (default value: const []) + test('to test the property `values`', () async { + // TODO + }); + + // OneOfEventHomeFilter requestParameters + test('to test the property `requestParameters`', () async { + // TODO + }); + + // int totalCount + test('to test the property `totalCount`', () async { + // TODO + }); + + // int actualCount + test('to test the property `actualCount`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/location_dto_test.dart b/mycore_api_old/test/location_dto_test.dart similarity index 100% rename from mycore_api/test/location_dto_test.dart rename to mycore_api_old/test/location_dto_test.dart diff --git a/mycore_api_old/test/login_dto_test.dart b/mycore_api_old/test/login_dto_test.dart new file mode 100644 index 0000000..39508e0 --- /dev/null +++ b/mycore_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:mycoreapi/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/mycore_api_old/test/means_of_communication_test.dart b/mycore_api_old/test/means_of_communication_test.dart new file mode 100644 index 0000000..87dd1a1 --- /dev/null +++ b/mycore_api_old/test/means_of_communication_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MeansOfCommunication +void main() { + + group('test MeansOfCommunication', () { + + }); + +} diff --git a/mycore_api_old/test/mqtt_api_test.dart b/mycore_api_old/test/mqtt_api_test.dart new file mode 100644 index 0000000..fe8f38b --- /dev/null +++ b/mycore_api_old/test/mqtt_api_test.dart @@ -0,0 +1,27 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for MQTTApi +void main() { + final instance = MQTTApi(); + + group('tests for MQTTApi', () { + // Publish mqtt test + // + //Future mQTTPublishMessage(MqttMessageDTO mqttMessageDTO) async + test('test mQTTPublishMessage', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/mqtt_message_dto_test.dart b/mycore_api_old/test/mqtt_message_dto_test.dart new file mode 100644 index 0000000..e53dbe5 --- /dev/null +++ b/mycore_api_old/test/mqtt_message_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MqttMessageDTO +void main() { + final instance = MqttMessageDTO(); + + group('test MqttMessageDTO', () { + // String topic + test('to test the property `topic`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + // bool online + test('to test the property `online`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/odd_api_test.dart b/mycore_api_old/test/odd_api_test.dart new file mode 100644 index 0000000..8a147f5 --- /dev/null +++ b/mycore_api_old/test/odd_api_test.dart @@ -0,0 +1,34 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for OddApi +void main() { + final instance = OddApi(); + + group('tests for OddApi', () { + // Get odds for one country and one odd value maximum + // + //Future> oddGetAll(double oddRequest) async + test('test oddGetAll', () async { + // TODO + }); + + // Get odds for one country and one odd value maximum + // + //Future> oddGetForCountry(String id, double oddRequest) async + test('test oddGetForCountry', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/odd_h2_h_test.dart b/mycore_api_old/test/odd_h2_h_test.dart similarity index 100% rename from mycore_api/test/odd_h2_h_test.dart rename to mycore_api_old/test/odd_h2_h_test.dart diff --git a/mycore_api_old/test/odd_nice_test.dart b/mycore_api_old/test/odd_nice_test.dart new file mode 100644 index 0000000..3cbc6e4 --- /dev/null +++ b/mycore_api_old/test/odd_nice_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for OddNice +void main() { + final instance = OddNice(); + + group('test OddNice', () { + // List teams (default value: const []) + test('to test the property `teams`', () async { + // TODO + }); + + // int commenceTime + test('to test the property `commenceTime`', () async { + // TODO + }); + + // String homeTeam + test('to test the property `homeTeam`', () async { + // TODO + }); + + // OneOfOddH2H odds + test('to test the property `odds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/odd_object_test.dart b/mycore_api_old/test/odd_object_test.dart new file mode 100644 index 0000000..b0d8599 --- /dev/null +++ b/mycore_api_old/test/odd_object_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for OddObject +void main() { + final instance = OddObject(); + + group('test OddObject', () { + // double homeOdd + test('to test the property `homeOdd`', () async { + // TODO + }); + + // double drawOdd + test('to test the property `drawOdd`', () async { + // TODO + }); + + // double visitOdd + test('to test the property `visitOdd`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/panel_menu_item_test.dart b/mycore_api_old/test/panel_menu_item_test.dart new file mode 100644 index 0000000..c6866c1 --- /dev/null +++ b/mycore_api_old/test/panel_menu_item_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PanelMenuItem +void main() { + final instance = PanelMenuItem(); + + group('test PanelMenuItem', () { + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String route + test('to test the property `route`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + + // String color + test('to test the property `color`', () async { + // TODO + }); + + // int badgeValue + test('to test the property `badgeValue`', () async { + // TODO + }); + + // String badgeType + test('to test the property `badgeType`', () async { + // TODO + }); + + // List children (default value: const []) + test('to test the property `children`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/panel_section_test.dart b/mycore_api_old/test/panel_section_test.dart new file mode 100644 index 0000000..9070dd6 --- /dev/null +++ b/mycore_api_old/test/panel_section_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PanelSection +void main() { + final instance = PanelSection(); + + group('test PanelSection', () { + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String defaultRoute + test('to test the property `defaultRoute`', () async { + // TODO + }); + + // List children (default value: const []) + test('to test the property `children`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/place_dto_test.dart b/mycore_api_old/test/place_dto_test.dart similarity index 100% rename from mycore_api/test/place_dto_test.dart rename to mycore_api_old/test/place_dto_test.dart diff --git a/mycore_api_old/test/programmed_mode_test.dart b/mycore_api_old/test/programmed_mode_test.dart new file mode 100644 index 0000000..ba6ed2d --- /dev/null +++ b/mycore_api_old/test/programmed_mode_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ProgrammedMode +void main() { + final instance = ProgrammedMode(); + + group('test ProgrammedMode', () { + // List monday (default value: const []) + test('to test the property `monday`', () async { + // TODO + }); + + // List tuesday (default value: const []) + test('to test the property `tuesday`', () async { + // TODO + }); + + // List wednesday (default value: const []) + test('to test the property `wednesday`', () async { + // TODO + }); + + // List thursday (default value: const []) + test('to test the property `thursday`', () async { + // TODO + }); + + // List friday (default value: const []) + test('to test the property `friday`', () async { + // TODO + }); + + // List saturday (default value: const []) + test('to test the property `saturday`', () async { + // TODO + }); + + // List sunday (default value: const []) + test('to test the property `sunday`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/provider_api_test.dart b/mycore_api_old/test/provider_api_test.dart new file mode 100644 index 0000000..4d48437 --- /dev/null +++ b/mycore_api_old/test/provider_api_test.dart @@ -0,0 +1,48 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ProviderApi +void main() { + final instance = ProviderApi(); + + group('tests for ProviderApi', () { + // Create a provider + // + //Future providerCreate(ProviderDTO providerDTO) async + test('test providerCreate', () async { + // TODO + }); + + // Delete a provider + // + //Future providerDelete(String providerId) async + test('test providerDelete', () async { + // TODO + }); + + // Get all user providers + // + //Future> providerGetAll(String userId) async + test('test providerGetAll', () async { + // TODO + }); + + // Update a provider + // + //Future providerUpdate(ProviderDTO providerDTO) async + test('test providerUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/provider_dto_test.dart b/mycore_api_old/test/provider_dto_test.dart new file mode 100644 index 0000000..e08b953 --- /dev/null +++ b/mycore_api_old/test/provider_dto_test.dart @@ -0,0 +1,66 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ProviderDTO +void main() { + final instance = ProviderDTO(); + + group('test ProviderDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String endpoint + test('to test the property `endpoint`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + // bool active + test('to test the property `active`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/provider_test.dart b/mycore_api_old/test/provider_test.dart similarity index 100% rename from mycore_api/test/provider_test.dart rename to mycore_api_old/test/provider_test.dart diff --git a/mycore_api_old/test/provider_type_test.dart b/mycore_api_old/test/provider_type_test.dart new file mode 100644 index 0000000..ef2c296 --- /dev/null +++ b/mycore_api_old/test/provider_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ProviderType +void main() { + + group('test ProviderType', () { + + }); + +} diff --git a/mycore_api_old/test/room_api_test.dart b/mycore_api_old/test/room_api_test.dart new file mode 100644 index 0000000..84ae05c --- /dev/null +++ b/mycore_api_old/test/room_api_test.dart @@ -0,0 +1,69 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for RoomApi +void main() { + final instance = RoomApi(); + + group('tests for RoomApi', () { + // Create a room + // + //Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async + test('test roomCreate', () async { + // TODO + }); + + // Delete device from a room + // + //Future roomDelete(String deviceId, String roomId) async + test('test roomDelete', () async { + // TODO + }); + + // Delete a room + // + //Future roomDelete2(String roomId) async + test('test roomDelete2', () async { + // TODO + }); + + // Delete all room for a specified + // + //Future roomDeleteAllForUser(String userId) async + test('test roomDeleteAllForUser', () async { + // TODO + }); + + // Get all rooms for the specified user + // + //Future> roomGetAll(String userId) async + test('test roomGetAll', () async { + // TODO + }); + + // Get detail info of a specified room + // + //Future roomGetDetail(String roomId, { String userId }) async + test('test roomGetDetail', () async { + // TODO + }); + + // Update a room + // + //Future roomUpdate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async + test('test roomUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/room_create_or_update_detail_dto_test.dart b/mycore_api_old/test/room_create_or_update_detail_dto_test.dart new file mode 100644 index 0000000..3956473 --- /dev/null +++ b/mycore_api_old/test/room_create_or_update_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomCreateOrUpdateDetailDTO +void main() { + final instance = RoomCreateOrUpdateDetailDTO(); + + group('test RoomCreateOrUpdateDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/room_detail_dto_test.dart b/mycore_api_old/test/room_detail_dto_test.dart new file mode 100644 index 0000000..2dd6b4a --- /dev/null +++ b/mycore_api_old/test/room_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomDetailDTO +void main() { + final instance = RoomDetailDTO(); + + group('test RoomDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/room_main_detail_dto_all_of_test.dart b/mycore_api_old/test/room_main_detail_dto_all_of_test.dart new file mode 100644 index 0000000..ba2bc74 --- /dev/null +++ b/mycore_api_old/test/room_main_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomMainDetailDTOAllOf +void main() { + final instance = RoomMainDetailDTOAllOf(); + + group('test RoomMainDetailDTOAllOf', () { + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List environmentalDevices (default value: const []) + test('to test the property `environmentalDevices`', () async { + // TODO + }); + + // List securityDevices (default value: const []) + test('to test the property `securityDevices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/room_main_detail_dto_test.dart b/mycore_api_old/test/room_main_detail_dto_test.dart new file mode 100644 index 0000000..18cb4e6 --- /dev/null +++ b/mycore_api_old/test/room_main_detail_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomMainDetailDTO +void main() { + final instance = RoomMainDetailDTO(); + + group('test RoomMainDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String homeId + test('to test the property `homeId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List environmentalDevices (default value: const []) + test('to test the property `environmentalDevices`', () async { + // TODO + }); + + // List securityDevices (default value: const []) + test('to test the property `securityDevices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/room_summary_dto_test.dart b/mycore_api_old/test/room_summary_dto_test.dart new file mode 100644 index 0000000..5f0819d --- /dev/null +++ b/mycore_api_old/test/room_summary_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomSummaryDTO +void main() { + final instance = RoomSummaryDTO(); + + group('test RoomSummaryDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/screen_configuration_test.dart b/mycore_api_old/test/screen_configuration_test.dart similarity index 100% rename from mycore_api/test/screen_configuration_test.dart rename to mycore_api_old/test/screen_configuration_test.dart diff --git a/mycore_api_old/test/screen_device_api_test.dart b/mycore_api_old/test/screen_device_api_test.dart new file mode 100644 index 0000000..bed3157 --- /dev/null +++ b/mycore_api_old/test/screen_device_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ScreenDeviceApi +void main() { + final instance = ScreenDeviceApi(); + + group('tests for ScreenDeviceApi', () { + //Future screenDeviceCreateDevice(ScreenDevice screenDevice) async + test('test screenDeviceCreateDevice', () async { + // TODO + }); + + //Future screenDeviceDeleteDevice(String deviceId) async + test('test screenDeviceDeleteDevice', () async { + // TODO + }); + + //Future> screenDeviceGetAllScreenDevices() async + test('test screenDeviceGetAllScreenDevices', () async { + // TODO + }); + + //Future screenDeviceGetDeviceInfo(String screenDeviceId) async + test('test screenDeviceGetDeviceInfo', () async { + // TODO + }); + + //Future screenDeviceUpdateDevice(int screenDeviceId, ScreenDevice screenDevice) async + test('test screenDeviceUpdateDevice', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/screen_device_test.dart b/mycore_api_old/test/screen_device_test.dart new file mode 100644 index 0000000..68cc588 --- /dev/null +++ b/mycore_api_old/test/screen_device_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ScreenDevice +void main() { + final instance = ScreenDevice(); + + group('test ScreenDevice', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String location + test('to test the property `location`', () async { + // TODO + }); + + // String locationExplanation + test('to test the property `locationExplanation`', () async { + // TODO + }); + + // int height + test('to test the property `height`', () async { + // TODO + }); + + // int width + test('to test the property `width`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/screen_widget_test.dart b/mycore_api_old/test/screen_widget_test.dart similarity index 100% rename from mycore_api/test/screen_widget_test.dart rename to mycore_api_old/test/screen_widget_test.dart diff --git a/mycore_api_old/test/smart_garden_message_test.dart b/mycore_api_old/test/smart_garden_message_test.dart new file mode 100644 index 0000000..6a4e8ae --- /dev/null +++ b/mycore_api_old/test/smart_garden_message_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SmartGardenMessage +void main() { + final instance = SmartGardenMessage(); + + group('test SmartGardenMessage', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String time + test('to test the property `time`', () async { + // TODO + }); + + // double temperature + test('to test the property `temperature`', () async { + // TODO + }); + + // double pressure + test('to test the property `pressure`', () async { + // TODO + }); + + // double humidity + test('to test the property `humidity`', () async { + // TODO + }); + + // int water + test('to test the property `water`', () async { + // TODO + }); + + // int light + test('to test the property `light`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/smart_printer_message_test.dart b/mycore_api_old/test/smart_printer_message_test.dart new file mode 100644 index 0000000..808e06d --- /dev/null +++ b/mycore_api_old/test/smart_printer_message_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SmartPrinterMessage +void main() { + final instance = SmartPrinterMessage(); + + group('test SmartPrinterMessage', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String time + test('to test the property `time`', () async { + // TODO + }); + + // double temperature + test('to test the property `temperature`', () async { + // TODO + }); + + // double pressure + test('to test the property `pressure`', () async { + // TODO + }); + + // int smoke + test('to test the property `smoke`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/state_test.dart b/mycore_api_old/test/state_test.dart similarity index 100% rename from mycore_api/test/state_test.dart rename to mycore_api_old/test/state_test.dart diff --git a/mycore_api_old/test/time_period_alarm_test.dart b/mycore_api_old/test/time_period_alarm_test.dart new file mode 100644 index 0000000..624d417 --- /dev/null +++ b/mycore_api_old/test/time_period_alarm_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TimePeriodAlarm +void main() { + final instance = TimePeriodAlarm(); + + group('test TimePeriodAlarm', () { + // String start + test('to test the property `start`', () async { + // TODO + }); + + // String end + test('to test the property `end`', () async { + // TODO + }); + + // OneOfAlarmMode alarmMode + test('to test the property `alarmMode`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/token_api_test.dart b/mycore_api_old/test/token_api_test.dart new file mode 100644 index 0000000..5c9b601 --- /dev/null +++ b/mycore_api_old/test/token_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for TokenApi +void main() { + final instance = TokenApi(); + + group('tests for TokenApi', () { + //Future tokenConnectUser(LoginDTO loginDTO) async + test('test tokenConnectUser', () async { + // TODO + }); + + //Future tokenCreate(User user) async + test('test tokenCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/token_dto_test.dart b/mycore_api_old/test/token_dto_test.dart new file mode 100644 index 0000000..fcc9ced --- /dev/null +++ b/mycore_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:mycoreapi/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/mycore_api_old/test/trigger_test.dart b/mycore_api_old/test/trigger_test.dart new file mode 100644 index 0000000..419d2bc --- /dev/null +++ b/mycore_api_old/test/trigger_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Trigger +void main() { + final instance = Trigger(); + + group('test Trigger', () { + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String stateName + test('to test the property `stateName`', () async { + // TODO + }); + + // String stateValue + test('to test the property `stateValue`', () async { + // TODO + }); + + // TriggerType type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/trigger_type_test.dart b/mycore_api_old/test/trigger_type_test.dart new file mode 100644 index 0000000..78cfc13 --- /dev/null +++ b/mycore_api_old/test/trigger_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TriggerType +void main() { + + group('test TriggerType', () { + + }); + +} diff --git a/mycore_api_old/test/twitter_api_test.dart b/mycore_api_old/test/twitter_api_test.dart new file mode 100644 index 0000000..84709f7 --- /dev/null +++ b/mycore_api_old/test/twitter_api_test.dart @@ -0,0 +1,25 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for TwitterApi +void main() { + final instance = TwitterApi(); + + group('tests for TwitterApi', () { + //Future twitterCreate(TwitterAuthModel twitterAuthModel) async + test('test twitterCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/twitter_auth_model_test.dart b/mycore_api_old/test/twitter_auth_model_test.dart new file mode 100644 index 0000000..71e0971 --- /dev/null +++ b/mycore_api_old/test/twitter_auth_model_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TwitterAuthModel +void main() { + final instance = TwitterAuthModel(); + + group('test TwitterAuthModel', () { + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/user_api_test.dart b/mycore_api_old/test/user_api_test.dart new file mode 100644 index 0000000..cc8f2f4 --- /dev/null +++ b/mycore_api_old/test/user_api_test.dart @@ -0,0 +1,49 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + final instance = UserApi(); + + group('tests for UserApi', () { + //Future userCreateUser(UserInfo userInfo) async + test('test userCreateUser', () async { + // TODO + }); + + //Future userDeleteUser(String id) async + test('test userDeleteUser', () async { + // TODO + }); + + // Get a list of user + // + //Future userGet() async + test('test userGet', () async { + // TODO + }); + + // Get a specific user + // + //Future userGet2(String id) async + test('test userGet2', () async { + // TODO + }); + + //Future userUpdateUser(UserInfo userInfo) async + test('test userUpdateUser', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/user_info_detail_dto_test.dart b/mycore_api_old/test/user_info_detail_dto_test.dart new file mode 100644 index 0000000..bea7c7e --- /dev/null +++ b/mycore_api_old/test/user_info_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for UserInfoDetailDTO +void main() { + final instance = UserInfoDetailDTO(); + + group('test UserInfoDetailDTO', () { + // 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/mycore_api_old/test/user_info_test.dart b/mycore_api_old/test/user_info_test.dart new file mode 100644 index 0000000..7554b95 --- /dev/null +++ b/mycore_api_old/test/user_info_test.dart @@ -0,0 +1,131 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for UserInfo +void main() { + final instance = UserInfo(); + + group('test UserInfo', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String role + test('to test the property `role`', () 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 birthday + test('to test the property `birthday`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // String address + test('to test the property `address`', () async { + // TODO + }); + + // String city + test('to test the property `city`', () async { + // TODO + }); + + // String state + test('to test the property `state`', () async { + // TODO + }); + + // String country + test('to test the property `country`', () async { + // TODO + }); + + // String language + test('to test the property `language`', () async { + // TODO + }); + + // String timeZone + test('to test the property `timeZone`', () async { + // TODO + }); + + // int postalCode + test('to test the property `postalCode`', () async { + // TODO + }); + + // List automations (default value: const []) + test('to test the property `automations`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + // List providers (default value: const []) + test('to test the property `providers`', () async { + // TODO + }); + + // List groups (default value: const []) + test('to test the property `groups`', () async { + // TODO + }); + + // List screenConfigurationIds (default value: const []) + test('to test the property `screenConfigurationIds`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/user_test.dart b/mycore_api_old/test/user_test.dart new file mode 100644 index 0000000..d66f7b6 --- /dev/null +++ b/mycore_api_old/test/user_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:mycoreapi/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 password + test('to test the property `password`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api_old/test/values_api_test.dart b/mycore_api_old/test/values_api_test.dart new file mode 100644 index 0000000..30725b1 --- /dev/null +++ b/mycore_api_old/test/values_api_test.dart @@ -0,0 +1,47 @@ +// +// 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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ValuesApi +void main() { + final instance = ValuesApi(); + + group('tests for ValuesApi', () { + //Future valuesDelete(int id) async + test('test valuesDelete', () async { + // TODO + }); + + //Future valuesGet(int id) async + test('test valuesGet', () async { + // TODO + }); + + // It's a test ! :) + // + //Future> valuesGetAll() async + test('test valuesGetAll', () async { + // TODO + }); + + //Future valuesPost(String body) async + test('test valuesPost', () async { + // TODO + }); + + //Future valuesPut(int id, String body) async + test('test valuesPut', () async { + // TODO + }); + + }); +} diff --git a/mycore_api_old/test/view_by_test.dart b/mycore_api_old/test/view_by_test.dart new file mode 100644 index 0000000..6be97a1 --- /dev/null +++ b/mycore_api_old/test/view_by_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:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ViewBy +void main() { + + group('test ViewBy', () { + + }); + +} diff --git a/mycore_api/test/widget_test.dart b/mycore_api_old/test/widget_test.dart similarity index 100% rename from mycore_api/test/widget_test.dart rename to mycore_api_old/test/widget_test.dart diff --git a/pubspec.lock b/pubspec.lock index e2503bc..a084fd9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,95 +1,228 @@ # 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" + args: + dependency: transitive + description: + name: args + sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + url: "https://pub.dev" + source: hosted + version: "2.4.0" 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" 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: "757153e5d9cd88253cb13f28c2fb55a537dc31fefd98137549895b5beb7c6169" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + 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: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727 + url: "https://pub.dev" + source: hosted + version: "2.3.3" + 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: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0" + url: "https://pub.dev" + source: hosted + version: "8.4.4" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: + version: "1.2.1" + checked_yaml: dependency: transitive description: - name: charcode - url: "https://pub.dartlang.org" + name: checked_yaml + sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "2.0.2" 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.15.0" + version: "1.17.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "3.0.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.4" + version: "1.0.5" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" + url: "https://pub.dev" + source: hosted + version: "2.2.4" 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: "1.1.1" + 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.2.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: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" 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: @@ -101,9 +234,10 @@ packages: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + sha256: "12006889e2987c549c4c1ec1a5ba4ec4b24d34d2469ee5f9476c926dcecff266" + url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "2.0.4" flutter_test: dependency: "direct dev" description: flutter @@ -118,66 +252,139 @@ packages: dependency: "direct main" description: name: fluttertoast - url: "https://pub.dartlang.org" + sha256: "2f9c4d3f4836421f7067a28f8939814597b27614e021da9d63e5d3fb6e212d25" + url: "https://pub.dev" source: hosted - version: "8.0.8" + version: "8.2.1" + 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" + graphs: + dependency: transitive + description: + name: graphs + sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + url: "https://pub.dev" + source: hosted + version: "2.2.0" http: dependency: transitive 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" 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: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.5" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + logging: + dependency: transitive + description: + name: logging + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" + source: hosted + version: "1.1.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" 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.3" + 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: "53186347058f0eb84b6b5e0591f8442cb05183abb787afc4d95a3c7a494068df" + url: "https://pub.dev" source: hosted - version: "8.2.0" - mycoreapi: + version: "9.8.0" + mycore_api: dependency: "direct main" description: path: mycore_api @@ -188,154 +395,303 @@ packages: 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: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1+1" + version: "1.8.2" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" source: hosted - version: "0.1.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" + version: "1.0.1" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "5.1.0" + 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: "5.0.0" + 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: ec85d7d55339d85f44ec2b682a82fea340071e8978257e5a43e69f79e98ef50c + url: "https://pub.dev" + source: hosted + version: "1.2.2" rxdart: dependency: "direct main" description: name: rxdart - url: "https://pub.dartlang.org" + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" source: hosted - version: "0.22.0" + version: "0.27.7" + 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.1" + version: "1.9.1" sqflite: dependency: "direct main" description: name: sqflite - url: "https://pub.dartlang.org" + sha256: "500d6fec583d2c021f2d25a056d96654f910662c64f836cd2063167b8f1fa758" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.2.6" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "963dad8c4aa2f814ce7d2d5b1da2f36f31bd1a439d8f27e3dc189bb9d26bc684" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.3" 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.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted 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" + 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: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.8" + version: "0.4.16" + 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.0" + version: "1.3.1" uuid: dependency: "direct main" description: name: uuid - url: "https://pub.dartlang.org" + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "3.0.7" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "4cf8e60dbe4d3a693d37dff11255a172594c0793da542183cbfe7fe978ae4aaa" + url: "https://pub.dev" + source: hosted + version: "1.1.4" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "278ad5f816f58b1967396d1f78ced470e3e58c9fe4b27010102c0a595c764468" + url: "https://pub.dev" + source: hosted + version: "1.1.4" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "0bf61ad56e6fd6688a2865d3ceaea396bc6a0a90ea0d7ad5049b1b76c09d6163" + url: "https://pub.dev" + source: hosted + version: "1.1.4" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + 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" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" source: hosted - version: "4.5.1" + version: "6.2.2" + yaml: + dependency: transitive + description: + name: yaml + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" + source: hosted + version: "3.1.1" sdks: - dart: ">=2.15.0 <3.0.0" - flutter: ">=1.18.0-6.0.pre" + dart: ">=2.19.0 <3.0.0" + flutter: ">=3.7.0-0" diff --git a/pubspec.yaml b/pubspec.yaml index 7d60b8a..ff9b530 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,25 +15,28 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +version: 1.0.0+2 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.17.0 <3.0.0" dependencies: flutter: sdk: flutter fluttertoast: + openapi_generator_cli: ^4.0.0 + openapi_generator: ^4.0.0 + openapi_generator_annotations: ^4.0.0 sqflite: - provider: ^5.0.0 + provider: ^6.0.5 enum_to_string: ^2.0.1 - flutter_svg: ^0.18.0 - mqtt_client: ^8.1.0 - rxdart: 0.22.0 - flare_flutter: ^3.0.1 - uuid: ^2.2.2 - mycoreapi: + flutter_svg: ^2.0.4 + mqtt_client: ^9.8.0 + rxdart: ^0.27.7 + flare_flutter: ^3.0.2 + uuid: ^3.0.7 + mycore_api: path: mycore_api # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -42,6 +45,8 @@ dependencies: 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 @@ -52,6 +57,7 @@ flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. + generate: true uses-material-design: true # To add assets to your application, add an assets section, like this: diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 4d10c25..b93c4c3 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin)