From 6e2dac52d19101c767b361e802bb53337cd29b57 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 4 May 2021 19:13:09 +0200 Subject: [PATCH] Add device service generation (code + in client) + update devices screen + section icons + sectio detail screen (WIP) --- lib/Components/fetch_section_icon.dart | 24 ++ .../Section/section_detail_screen.dart | 170 ++++++++- .../configuration_detail_screen.dart | 62 ++-- .../Configurations/new_section_popup.dart | 5 +- lib/Screens/Devices/devices_screen.dart | 11 +- lib/Screens/login_screen.dart | 13 +- lib/client.dart | 4 + lib/constants.dart | 2 + manager_api/.openapi-generator/FILES | 8 + manager_api/README.md | 9 + manager_api/doc/DeviceApi.md | 229 ++++++++++++ manager_api/doc/DeviceDTO.md | 20 ++ manager_api/doc/DeviceDetailDTO.md | 24 ++ manager_api/doc/DeviceDetailDTOAllOf.md | 18 + manager_api/doc/SectionApi.md | 48 ++- manager_api/doc/SectionDTO.md | 1 + manager_api/lib/api.dart | 4 + manager_api/lib/api/device_api.dart | 325 ++++++++++++++++++ manager_api/lib/api/section_api.dart | 70 +++- manager_api/lib/api_client.dart | 6 + manager_api/lib/model/device_detail_dto.dart | 158 +++++++++ .../lib/model/device_detail_dto_all_of.dart | 102 ++++++ manager_api/lib/model/device_dto.dart | 118 +++++++ manager_api/lib/model/section_dto.dart | 11 +- manager_api/swagger.yaml | 252 +++++++++++++- manager_api/test/device_api_test.dart | 45 +++ .../test/device_detail_dto_all_of_test.dart | 41 +++ manager_api/test/device_detail_dto_test.dart | 71 ++++ manager_api/test/device_dto_test.dart | 51 +++ 29 files changed, 1841 insertions(+), 61 deletions(-) create mode 100644 lib/Components/fetch_section_icon.dart create mode 100644 manager_api/doc/DeviceApi.md create mode 100644 manager_api/doc/DeviceDTO.md create mode 100644 manager_api/doc/DeviceDetailDTO.md create mode 100644 manager_api/doc/DeviceDetailDTOAllOf.md create mode 100644 manager_api/lib/api/device_api.dart create mode 100644 manager_api/lib/model/device_detail_dto.dart create mode 100644 manager_api/lib/model/device_detail_dto_all_of.dart create mode 100644 manager_api/lib/model/device_dto.dart create mode 100644 manager_api/test/device_api_test.dart create mode 100644 manager_api/test/device_detail_dto_all_of_test.dart create mode 100644 manager_api/test/device_detail_dto_test.dart create mode 100644 manager_api/test/device_dto_test.dart diff --git a/lib/Components/fetch_section_icon.dart b/lib/Components/fetch_section_icon.dart new file mode 100644 index 0000000..ecf795f --- /dev/null +++ b/lib/Components/fetch_section_icon.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:managerapi/api.dart'; + +IconData getSectionIcon(elementType) { + print(elementType); + switch(elementType) { + case SectionType.map: + return Icons.location_on; + break; + case SectionType.slider: + return Icons.collections; // art_track + break; + case SectionType.video: + return Icons.ondemand_video_rounded; + break; + case SectionType.web: + return Icons.web; + break; + case SectionType.menu: + return Icons.apps_sharp; + break; + } + return Icons.menu; +} \ No newline at end of file diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index ed2fb4e..716275b 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -1,9 +1,15 @@ import 'package:flutter/material.dart'; +import 'package:manager_app/Components/confirmation_dialog.dart'; +import 'package:manager_app/Components/fetch_section_icon.dart'; +import 'package:manager_app/Components/multi_select_container.dart'; +import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/app_context.dart'; +import 'package:manager_app/client.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; +import 'package:overlay_support/overlay_support.dart'; import 'package:provider/provider.dart'; import 'package:intl/intl.dart'; @@ -28,8 +34,6 @@ class _SectionDetailScreenState extends State { future: getSection(widget.id, appContext.getContext().clientAPI), builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { - print("euh fuck ?"); - print(snapshot.data); return bodySection(snapshot.data, size, appContext, context); } else if (snapshot.connectionState == ConnectionState.none) { return Text("No data"); @@ -56,7 +60,20 @@ class _SectionDetailScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(sectionDTO.label, style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(sectionDTO.label, style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + getSectionIcon(sectionDTO.type), + color: kPrimaryColor, + size: 25, + ), + ) + ], + ), Padding( padding: const EdgeInsets.all(5.0), child: Text(DateFormat('dd/MM/yyyy').format(sectionDTO.dateCreation), style: TextStyle(fontSize: 15, fontWeight: FontWeight.w200)), @@ -72,7 +89,7 @@ class _SectionDetailScreenState extends State { child: InkWell( onTap: () { ManagerAppContext managerAppContext = appContext.getContext(); - managerAppContext.selectedConfiguration = null; + managerAppContext.selectedSection = null; appContext.setContext(managerAppContext); }, child: Container( @@ -111,11 +128,21 @@ class _SectionDetailScreenState extends State { sectionDTO.label = value; }, ), - StringContainer( - label: "Description :", - initialValue: sectionDTO.description, + MultiSelectContainer( + label: "Type :", + initialValue: [sectionDTO.type.toString()], + isMultiple: false, + values: section_types, onChanged: (value) { - sectionDTO.description = value; + var tempOutput = new List.from(value); + sectionDTO.type = SectionType.fromJson(tempOutput[0]); + }, + ), + StringContainer( + label: "Image :", + initialValue: sectionDTO.imageId, + onChanged: (value) { + sectionDTO.imageId = value; }, ), ], @@ -124,11 +151,19 @@ class _SectionDetailScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "Test :", + StringContainer( + label: "Titre :", + initialValue: sectionDTO.title, + onChanged: (value) { + sectionDTO.title = value; + }, ), - Text( - "Test :", + StringContainer( + label: "Description :", + initialValue: sectionDTO.description, + onChanged: (value) { + sectionDTO.description = value; + }, ), ], ) @@ -140,16 +175,117 @@ class _SectionDetailScreenState extends State { ), ), ),// FIELDS SECTION - //getButtons(configurationDTO, appContext), + getSpecificData(sectionDTO, appContext), + getButtons(sectionDTO, appContext), ], ); } + + getButtons(SectionDTO sectionDTO, AppContext appContext) { + return Align( + alignment: AlignmentDirectional.bottomCenter, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: RoundedButton( + text: "Annuler", + icon: Icons.undo, + color: Colors.grey, + textColor: Colors.white, + fontSize: 15, + press: () { + cancel(sectionDTO, appContext); + }, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: RoundedButton( + text: "Supprimer", + icon: Icons.delete, + color: kPrimaryColor, + textColor: Colors.white, + fontSize: 15, + press: () { + delete(sectionDTO, appContext); + }, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: RoundedButton( + text: "Sauvegarder", + icon: Icons.done, + color: Colors.lightGreen, + textColor: Colors.white, + fontSize: 15, + press: () { + save(sectionDTO, appContext); + }, + ), + ), + ], + ), + ); + } + + Future cancel(SectionDTO sectionDTO, AppContext appContext) async { + ManagerAppContext managerAppContext = appContext.getContext(); + SectionDTO section = await appContext.getContext().clientAPI.sectionApi.sectionGetDetail(sectionDTO.id); + managerAppContext.selectedSection = section; + appContext.setContext(managerAppContext); + } + + Future delete(SectionDTO sectionDTO, AppContext appContext) async { + showConfirmationDialog( + "Êtes-vous sûr de vouloir supprimer cette section ?", + () {}, + () async { + ManagerAppContext managerAppContext = appContext.getContext(); + await appContext.getContext().clientAPI.sectionApi.sectionDelete(sectionDTO.id); + managerAppContext.selectedSection = null; + appContext.setContext(managerAppContext); + }, + context + ); + } + + Future save(SectionDTO sectionDTO, AppContext appContext) async { + SectionDTO section = await appContext.getContext().clientAPI.sectionApi.sectionUpdate(sectionDTO); + ManagerAppContext managerAppContext = appContext.getContext(); + managerAppContext.selectedSection = section; + appContext.setContext(managerAppContext); + + // popup a toast. + toast('La section a été sauvegardée avec succès'); + + // show a notification at top of screen. + /*showSimpleNotification( + Text("La configuration a été sauvegardée avec succès"), + position: NotificationPosition.bottom, + background: Colors.green);*/ + } + + getSpecificData(SectionDTO sectionDTO, AppContext appContext) { + switch(sectionDTO.type) { + case SectionType.map: + return Text("map"); + case SectionType.slider: + return Text("slider"); + case SectionType.video: + return Text("video"); + case SectionType.web: + return Text("web"); + case SectionType.menu: + return Text("menu"); + } + } } -Future getSection(String sectionId, dynamic appContext) async { - print("YOULOU TEST GET SECTION"); - print(sectionId); - dynamic section = await appContext.getContext().clientAPI.sectionApi.sectionGetDetail(sectionId); +Future getSection(String sectionId, Client client) async { + SectionDTO section = await client.sectionApi.sectionGetDetail(sectionId); print("received section"); print(section); return section; diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index 5da9b99..8906771 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:manager_app/Components/color_picker_input_container.dart'; import 'package:manager_app/Components/confirmation_dialog.dart'; +import 'package:manager_app/Components/fetch_section_icon.dart'; import 'package:manager_app/Components/multi_select_container.dart'; import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/string_input_container.dart'; @@ -124,6 +125,7 @@ class _ConfigurationDetailScreenState extends State { label: "Langues :", initialValue: configurationDTO.languages != null ? configurationDTO.languages: [], values: languages, + isMultiple: true, onChanged: (value) { var tempOutput = new List.from(value); configurationDTO.languages = tempOutput; @@ -196,11 +198,20 @@ class _ConfigurationDetailScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Align( - alignment: Alignment.centerLeft, + alignment: Alignment.center, child: AutoSizeText( element.label, - style: new TextStyle(fontSize: 25), - maxLines: 1, + style: new TextStyle(fontSize: 15), + maxLines: 2, + textAlign: TextAlign.center, + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Icon( + getSectionIcon(element.type), + color: kPrimaryColor, + size: 30.0, ), ), ], @@ -246,7 +257,6 @@ class _ConfigurationDetailScreenState extends State { textColor: Colors.white, fontSize: 15, press: () { - print("Annuler pressed"); cancel(configurationDTO, appContext); }, ), @@ -260,7 +270,6 @@ class _ConfigurationDetailScreenState extends State { textColor: Colors.white, fontSize: 15, press: () { - print("Supprimer pressed"); delete(configurationDTO, appContext); }, ), @@ -275,7 +284,6 @@ class _ConfigurationDetailScreenState extends State { fontSize: 15, press: () { save(configurationDTO, appContext); - print("Sauvegarder pressed"); }, ), ), @@ -326,6 +334,27 @@ class _ConfigurationDetailScreenState extends State { ); } + Future cancel(ConfigurationDTO configurationDTO, AppContext appContext) async { + ManagerAppContext managerAppContext = appContext.getContext(); + ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationGetDetail(configurationDTO.id); + managerAppContext.selectedConfiguration = configuration; + appContext.setContext(managerAppContext); + } + + Future delete(ConfigurationDTO configurationDTO, AppContext appContext) async { + showConfirmationDialog( + "Êtes-vous sûr de vouloir supprimer cette configuration ?", + () {}, + () async { + ManagerAppContext managerAppContext = appContext.getContext(); + await appContext.getContext().clientAPI.configurationApi.configurationDelete(configurationDTO.id); + managerAppContext.selectedConfiguration = null; + appContext.setContext(managerAppContext); + }, + context + ); + } + Future save(ConfigurationDTO configurationDTO, AppContext appContext) async { ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationUpdate(configurationDTO); ManagerAppContext managerAppContext = appContext.getContext(); @@ -342,27 +371,6 @@ class _ConfigurationDetailScreenState extends State { background: Colors.green);*/ } - Future delete(ConfigurationDTO configurationDTO, AppContext appContext) async { - showConfirmationDialog( - "Êtes-vous sûr de vouloir supprimer cette configuration ?", - () {}, - () async { - ManagerAppContext managerAppContext = appContext.getContext(); - await appContext.getContext().clientAPI.configurationApi.configurationDelete(configurationDTO.id); - managerAppContext.selectedConfiguration = null; - appContext.setContext(managerAppContext); - }, - context - ); - } - - Future cancel(ConfigurationDTO configurationDTO, AppContext appContext) async { - ManagerAppContext managerAppContext = appContext.getContext(); - ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationGetDetail(configurationDTO.id); - managerAppContext.selectedConfiguration = configuration; - appContext.setContext(managerAppContext); - } - Future getConfiguration(ConfigurationDetailScreen widget, Client client) async { ConfigurationDTO configuration = await client.configurationApi.configurationGetDetail(widget.id); return configuration; diff --git a/lib/Screens/Configurations/new_section_popup.dart b/lib/Screens/Configurations/new_section_popup.dart index 544e14b..85dc847 100644 --- a/lib/Screens/Configurations/new_section_popup.dart +++ b/lib/Screens/Configurations/new_section_popup.dart @@ -9,8 +9,6 @@ import 'package:managerapi/api.dart'; import 'package:overlay_support/overlay_support.dart'; void showNewSection(ConfigurationDTO configurationDTO, AppContext appContext, BuildContext context) { - List types = ["Map", "Slider", "Video", "Web", "Menu"]; - SectionDTO sectionDTO = new SectionDTO(); sectionDTO.configurationId = configurationDTO.id; @@ -33,7 +31,7 @@ void showNewSection(ConfigurationDTO configurationDTO, AppContext appContext, Bu label: "Type :", initialValue: ["Map"], isMultiple: false, - values: types, + values: section_types, onChanged: (value) { var tempOutput = new List.from(value); sectionDTO.type = SectionType.fromJson(tempOutput[0]); @@ -93,6 +91,7 @@ void create(SectionDTO sectionDTO, AppContext appContext, BuildContext context) if (sectionDTO.label != null) { Navigator.of(context).pop(); + print(sectionDTO); SectionDTO newSection = await appContext.getContext().clientAPI.sectionApi.sectionCreate(sectionDTO); ManagerAppContext managerAppContext = appContext.getContext(); if (managerAppContext.selectedConfiguration.sectionIds == null) { diff --git a/lib/Screens/Devices/devices_screen.dart b/lib/Screens/Devices/devices_screen.dart index 79b0b50..113e036 100644 --- a/lib/Screens/Devices/devices_screen.dart +++ b/lib/Screens/Devices/devices_screen.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:manager_app/app_context.dart'; +import 'package:managerapi/api.dart'; import 'package:provider/provider.dart'; class DevicesScreen extends StatefulWidget { @@ -21,7 +22,7 @@ class _DevicesScreenState extends State { Text( "Devices" ), - /*FutureBuilder( + FutureBuilder( future: getDevices(appContext), builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { @@ -40,18 +41,18 @@ class _DevicesScreenState extends State { return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE'))); } } - ),*/ + ), ] ), ); } } -/*Future> getDevices(dynamic appContext) async { +Future> getDevices(dynamic appContext) async { List devices = await appContext.getContext().clientAPI.deviceApi.deviceGet(); - print("number of devices " + ressources.length.toString()); + print("number of devices " + devices.length.toString()); devices.forEach((element) { print(element); }); return devices; -}*/ +} diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index 747bc28..e1b9fe4 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -75,16 +75,25 @@ class _LoginScreenState extends State { print(element); }); - List sections = await clientAPI.sectionApi.sectionGetFromConfiguration(id); + /*List sections = await clientAPI.sectionApi.sectionGetFromConfiguration(id); print("number of sections " + sections.length.toString()); sections.forEach((element) { print(element); - }); + });*/ + + SectionDTO section = await clientAPI.sectionApi.sectionGetDetail("60916249494b9eaf283b44f7"); + print(section); List ressources = await clientAPI.ressourceApi.ressourceGet(); print("number of ressources " + ressources.length.toString()); ressources.forEach((element) { print(element); + }); + + List devices = await clientAPI.deviceApi.deviceGet(); + print("number of devices " + devices.length.toString()); + devices.forEach((element) { + print(element); });*/ } } diff --git a/lib/client.dart b/lib/client.dart index 5d6d066..44b1d8b 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -20,6 +20,9 @@ class Client { RessourceApi _ressourceApi; RessourceApi get ressourceApi => _ressourceApi; + DeviceApi _deviceApi; + DeviceApi get deviceApi => _deviceApi; + Client() { _apiClient = ApiClient( basePath: "http://192.168.31.96"); @@ -29,5 +32,6 @@ class Client { _configurationApi = ConfigurationApi(_apiClient); _sectionApi = SectionApi(_apiClient); _ressourceApi = RessourceApi(_apiClient); + _deviceApi = DeviceApi(_apiClient); } } \ No newline at end of file diff --git a/lib/constants.dart b/lib/constants.dart index 7cffbe9..db0aaab 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -13,6 +13,8 @@ const kSecond = Color(0xFFC2C9D6); const kWhite = Color(0xFFFFFFFF); const kBlack = Color(0xFF000000); +const List section_types = ["Map", "Slider", "Video", "Web", "Menu"]; + /* const kTextStyle = TextStyle( fontSize: 23, diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 478eaba..031cff7 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -4,6 +4,10 @@ README.md doc/AuthenticationApi.md doc/ConfigurationApi.md doc/ConfigurationDTO.md +doc/DeviceApi.md +doc/DeviceDTO.md +doc/DeviceDetailDTO.md +doc/DeviceDetailDTOAllOf.md doc/LoginDTO.md doc/RessourceApi.md doc/RessourceDTO.md @@ -20,6 +24,7 @@ git_push.sh lib/api.dart lib/api/authentication_api.dart lib/api/configuration_api.dart +lib/api/device_api.dart lib/api/ressource_api.dart lib/api/section_api.dart lib/api/user_api.dart @@ -32,6 +37,9 @@ lib/auth/http_basic_auth.dart lib/auth/http_bearer_auth.dart lib/auth/oauth.dart lib/model/configuration_dto.dart +lib/model/device_detail_dto.dart +lib/model/device_detail_dto_all_of.dart +lib/model/device_dto.dart lib/model/login_dto.dart lib/model/ressource_detail_dto.dart lib/model/ressource_dto.dart diff --git a/manager_api/README.md b/manager_api/README.md index 6881bfc..6160a7c 100644 --- a/manager_api/README.md +++ b/manager_api/README.md @@ -71,6 +71,11 @@ Class | Method | HTTP request | Description *ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | *ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | *ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | +*DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/Device | +*DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} | +*DeviceApi* | [**deviceGet**](doc\/DeviceApi.md#deviceget) | **GET** /api/Device | +*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | +*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | *RessourceApi* | [**ressourceCreate**](doc\/RessourceApi.md#ressourcecreate) | **POST** /api/Ressource | *RessourceApi* | [**ressourceDelete**](doc\/RessourceApi.md#ressourcedelete) | **DELETE** /api/Ressource/{id} | *RessourceApi* | [**ressourceGet**](doc\/RessourceApi.md#ressourceget) | **GET** /api/Ressource | @@ -79,6 +84,7 @@ Class | Method | HTTP request | Description *RessourceApi* | [**ressourceUpdate**](doc\/RessourceApi.md#ressourceupdate) | **PUT** /api/Ressource | *SectionApi* | [**sectionCreate**](doc\/SectionApi.md#sectioncreate) | **POST** /api/Section | *SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | +*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | @@ -94,6 +100,9 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ConfigurationDTO](doc\/ConfigurationDTO.md) + - [DeviceDTO](doc\/DeviceDTO.md) + - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) + - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) - [LoginDTO](doc\/LoginDTO.md) - [RessourceDTO](doc\/RessourceDTO.md) - [RessourceDetailDTO](doc\/RessourceDetailDTO.md) diff --git a/manager_api/doc/DeviceApi.md b/manager_api/doc/DeviceApi.md new file mode 100644 index 0000000..257a6c9 --- /dev/null +++ b/manager_api/doc/DeviceApi.md @@ -0,0 +1,229 @@ +# managerapi.api.DeviceApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.96* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/Device | +[**deviceDelete**](DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} | +[**deviceGet**](DeviceApi.md#deviceget) | **GET** /api/Device | +[**deviceGetDetail**](DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | +[**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/Device | + + +# **deviceCreate** +> DeviceDetailDTO deviceCreate(deviceDetailDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | + +try { + final result = api_instance.deviceCreate(deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceDelete** +> String deviceDelete(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final id = id_example; // String | + +try { + final result = api_instance.deviceDelete(id); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceGet** +> List deviceGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); + +try { + final result = api_instance.deviceGet(); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](DeviceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceGetDetail** +> DeviceDetailDTO deviceGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final id = id_example; // String | + +try { + final result = api_instance.deviceGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deviceUpdate** +> DeviceDetailDTO deviceUpdate(deviceDetailDTO) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | + +try { + final result = api_instance.deviceUpdate(deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api/doc/DeviceDTO.md b/manager_api/doc/DeviceDTO.md new file mode 100644 index 0000000..02e4be1 --- /dev/null +++ b/manager_api/doc/DeviceDTO.md @@ -0,0 +1,20 @@ +# managerapi.model.DeviceDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**ipAddress** | **String** | | [optional] +**configurationId** | **String** | | [optional] +**connected** | **bool** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/DeviceDetailDTO.md b/manager_api/doc/DeviceDetailDTO.md new file mode 100644 index 0000000..75c41f1 --- /dev/null +++ b/manager_api/doc/DeviceDetailDTO.md @@ -0,0 +1,24 @@ +# managerapi.model.DeviceDetailDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**ipAddress** | **String** | | [optional] +**configurationId** | **String** | | [optional] +**connected** | **bool** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**connectionLevel** | **String** | | [optional] +**lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] +**batteryLevel** | **String** | | [optional] +**lastBatteryLevel** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/DeviceDetailDTOAllOf.md b/manager_api/doc/DeviceDetailDTOAllOf.md new file mode 100644 index 0000000..0cc0886 --- /dev/null +++ b/manager_api/doc/DeviceDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# managerapi.model.DeviceDetailDTOAllOf + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connectionLevel** | **String** | | [optional] +**lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] +**batteryLevel** | **String** | | [optional] +**lastBatteryLevel** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/SectionApi.md b/manager_api/doc/SectionApi.md index 1636a66..708bd5a 100644 --- a/manager_api/doc/SectionApi.md +++ b/manager_api/doc/SectionApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**sectionCreate**](SectionApi.md#sectioncreate) | **POST** /api/Section | [**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | +[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | [**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | @@ -104,6 +105,49 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **sectionDeleteAllForConfiguration** +> String sectionDeleteAllForConfiguration(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); +final id = id_example; // String | + +try { + final result = api_instance.sectionDeleteAllForConfiguration(id); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionDeleteAllForConfiguration: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **sectionGet** > List sectionGet() @@ -187,7 +231,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **sectionGetDetail** -> Object sectionGetDetail(id) +> SectionDTO sectionGetDetail(id) @@ -216,7 +260,7 @@ Name | Type | Description | Notes ### Return type -[**Object**](Object.md) +[**SectionDTO**](SectionDTO.md) ### Authorization diff --git a/manager_api/doc/SectionDTO.md b/manager_api/doc/SectionDTO.md index 2cf32ee..e8086f9 100644 --- a/manager_api/doc/SectionDTO.md +++ b/manager_api/doc/SectionDTO.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | | [optional] **label** | **String** | | [optional] +**title** | **String** | | [optional] **description** | **String** | | [optional] **imageId** | **String** | | [optional] **configurationId** | **String** | | [optional] diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index 4459904..644396a 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -29,11 +29,15 @@ part 'auth/http_bearer_auth.dart'; part 'api/authentication_api.dart'; part 'api/configuration_api.dart'; +part 'api/device_api.dart'; part 'api/ressource_api.dart'; part 'api/section_api.dart'; part 'api/user_api.dart'; part 'model/configuration_dto.dart'; +part 'model/device_dto.dart'; +part 'model/device_detail_dto.dart'; +part 'model/device_detail_dto_all_of.dart'; part 'model/login_dto.dart'; part 'model/ressource_dto.dart'; part 'model/ressource_detail_dto.dart'; diff --git a/manager_api/lib/api/device_api.dart b/manager_api/lib/api/device_api.dart new file mode 100644 index 0000000..a8b4ed7 --- /dev/null +++ b/manager_api/lib/api/device_api.dart @@ -0,0 +1,325 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class DeviceApi { + DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Device' operation and returns the [Response]. + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/Device'; + + Object postBody = deviceDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceCreateWithHttpInfo(deviceDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future deviceDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Device/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future deviceDelete(String id) async { + final response = await deviceDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. + Future deviceGetWithHttpInfo() async { + final path = r'/api/Device'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> deviceGet() async { + final response = await deviceGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future deviceGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Device/{id}/detail' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future deviceGetDetail(String id) async { + final response = await deviceGetDetailWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Device' operation and returns the [Response]. + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/Device'; + + Object postBody = deviceDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + Future deviceUpdate(DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceUpdateWithHttpInfo(deviceDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } +} diff --git a/manager_api/lib/api/section_api.dart b/manager_api/lib/api/section_api.dart index 098a470..b074edd 100644 --- a/manager_api/lib/api/section_api.dart +++ b/manager_api/lib/api/section_api.dart @@ -142,6 +142,70 @@ class SectionApi { return Future.value(null); } + /// Performs an HTTP 'DELETE /api/Section/configuration/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future sectionDeleteAllForConfigurationWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Section/configuration/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future sectionDeleteAllForConfiguration(String id) async { + final response = await sectionDeleteAllForConfigurationWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + /// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. Future sectionGetWithHttpInfo() async { final path = r'/api/Section'; @@ -312,7 +376,7 @@ class SectionApi { /// Parameters: /// /// * [String] id (required): - Future sectionGetDetail(String id) async { + Future sectionGetDetail(String id) async { final response = await sectionGetDetailWithHttpInfo(id); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); @@ -321,9 +385,9 @@ class SectionApi { // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Object') as Object; + return apiClient.deserialize(_decodeBodyBytes(response), 'SectionDTO') as SectionDTO; } - return Future.value(null); + return Future.value(null); } /// Performs an HTTP 'GET /api/Section/configuration/{id}' operation and returns the [Response]. diff --git a/manager_api/lib/api_client.dart b/manager_api/lib/api_client.dart index 9013c84..0525784 100644 --- a/manager_api/lib/api_client.dart +++ b/manager_api/lib/api_client.dart @@ -158,6 +158,12 @@ class ApiClient { return value is double ? value : double.parse('$value'); case 'ConfigurationDTO': return ConfigurationDTO.fromJson(value); + case 'DeviceDTO': + return DeviceDTO.fromJson(value); + case 'DeviceDetailDTO': + return DeviceDetailDTO.fromJson(value); + case 'DeviceDetailDTOAllOf': + return DeviceDetailDTOAllOf.fromJson(value); case 'LoginDTO': return LoginDTO.fromJson(value); case 'RessourceDTO': diff --git a/manager_api/lib/model/device_detail_dto.dart b/manager_api/lib/model/device_detail_dto.dart new file mode 100644 index 0000000..6379db3 --- /dev/null +++ b/manager_api/lib/model/device_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 DeviceDetailDTO { + /// Returns a new [DeviceDetailDTO] instance. + DeviceDetailDTO({ + this.id, + this.name, + this.ipAddress, + this.configurationId, + this.connected, + this.dateCreation, + this.connectionLevel, + this.lastConnectionLevel, + this.batteryLevel, + this.lastBatteryLevel, + }); + + String id; + + String name; + + String ipAddress; + + String configurationId; + + bool connected; + + DateTime dateCreation; + + String connectionLevel; + + DateTime lastConnectionLevel; + + String batteryLevel; + + DateTime lastBatteryLevel; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && + other.id == id && + other.name == name && + other.ipAddress == ipAddress && + other.configurationId == configurationId && + other.connected == connected && + other.dateCreation == dateCreation && + other.connectionLevel == connectionLevel && + other.lastConnectionLevel == lastConnectionLevel && + other.batteryLevel == batteryLevel && + other.lastBatteryLevel == lastBatteryLevel; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (configurationId == null ? 0 : configurationId.hashCode) + + (connected == null ? 0 : connected.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (connectionLevel == null ? 0 : connectionLevel.hashCode) + + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + + (batteryLevel == null ? 0 : batteryLevel.hashCode) + + (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); + + @override + String toString() => 'DeviceDetailDTO[id=$id, name=$name, ipAddress=$ipAddress, configurationId=$configurationId, connected=$connected, dateCreation=$dateCreation, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (configurationId != null) { + json[r'configurationId'] = configurationId; + } + if (connected != null) { + json[r'connected'] = connected; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (connectionLevel != null) { + json[r'connectionLevel'] = connectionLevel; + } + if (lastConnectionLevel != null) { + json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); + } + if (batteryLevel != null) { + json[r'batteryLevel'] = batteryLevel; + } + if (lastBatteryLevel != null) { + json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [DeviceDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDetailDTO fromJson(Map json) => json == null + ? null + : DeviceDetailDTO( + id: json[r'id'], + name: json[r'name'], + ipAddress: json[r'ipAddress'], + configurationId: json[r'configurationId'], + connected: json[r'connected'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + connectionLevel: json[r'connectionLevel'], + lastConnectionLevel: json[r'lastConnectionLevel'] == null + ? null + : DateTime.parse(json[r'lastConnectionLevel']), + batteryLevel: json[r'batteryLevel'], + lastBatteryLevel: json[r'lastBatteryLevel'] == null + ? null + : DateTime.parse(json[r'lastBatteryLevel']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/device_detail_dto_all_of.dart b/manager_api/lib/model/device_detail_dto_all_of.dart new file mode 100644 index 0000000..9025552 --- /dev/null +++ b/manager_api/lib/model/device_detail_dto_all_of.dart @@ -0,0 +1,102 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceDetailDTOAllOf { + /// Returns a new [DeviceDetailDTOAllOf] instance. + DeviceDetailDTOAllOf({ + this.connectionLevel, + this.lastConnectionLevel, + this.batteryLevel, + this.lastBatteryLevel, + }); + + String connectionLevel; + + DateTime lastConnectionLevel; + + String batteryLevel; + + DateTime lastBatteryLevel; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && + other.connectionLevel == connectionLevel && + other.lastConnectionLevel == lastConnectionLevel && + other.batteryLevel == batteryLevel && + other.lastBatteryLevel == lastBatteryLevel; + + @override + int get hashCode => + (connectionLevel == null ? 0 : connectionLevel.hashCode) + + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + + (batteryLevel == null ? 0 : batteryLevel.hashCode) + + (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); + + @override + String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + + Map toJson() { + final json = {}; + if (connectionLevel != null) { + json[r'connectionLevel'] = connectionLevel; + } + if (lastConnectionLevel != null) { + json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); + } + if (batteryLevel != null) { + json[r'batteryLevel'] = batteryLevel; + } + if (lastBatteryLevel != null) { + json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDetailDTOAllOf fromJson(Map json) => json == null + ? null + : DeviceDetailDTOAllOf( + connectionLevel: json[r'connectionLevel'], + lastConnectionLevel: json[r'lastConnectionLevel'] == null + ? null + : DateTime.parse(json[r'lastConnectionLevel']), + batteryLevel: json[r'batteryLevel'], + lastBatteryLevel: json[r'lastBatteryLevel'] == null + ? null + : DateTime.parse(json[r'lastBatteryLevel']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/device_dto.dart b/manager_api/lib/model/device_dto.dart new file mode 100644 index 0000000..d803476 --- /dev/null +++ b/manager_api/lib/model/device_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 DeviceDTO { + /// Returns a new [DeviceDTO] instance. + DeviceDTO({ + this.id, + this.name, + this.ipAddress, + this.configurationId, + this.connected, + this.dateCreation, + }); + + String id; + + String name; + + String ipAddress; + + String configurationId; + + bool connected; + + DateTime dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDTO && + other.id == id && + other.name == name && + other.ipAddress == ipAddress && + other.configurationId == configurationId && + other.connected == connected && + other.dateCreation == dateCreation; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (configurationId == null ? 0 : configurationId.hashCode) + + (connected == null ? 0 : connected.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode); + + @override + String toString() => 'DeviceDTO[id=$id, name=$name, ipAddress=$ipAddress, configurationId=$configurationId, connected=$connected, dateCreation=$dateCreation]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (configurationId != null) { + json[r'configurationId'] = configurationId; + } + if (connected != null) { + json[r'connected'] = connected; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [DeviceDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDTO fromJson(Map json) => json == null + ? null + : DeviceDTO( + id: json[r'id'], + name: json[r'name'], + ipAddress: json[r'ipAddress'], + configurationId: json[r'configurationId'], + connected: json[r'connected'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/section_dto.dart b/manager_api/lib/model/section_dto.dart index 0f8a752..1fed082 100644 --- a/manager_api/lib/model/section_dto.dart +++ b/manager_api/lib/model/section_dto.dart @@ -14,6 +14,7 @@ class SectionDTO { SectionDTO({ this.id, this.label, + this.title, this.description, this.imageId, this.configurationId, @@ -28,6 +29,8 @@ class SectionDTO { String label; + String title; + String description; String imageId; @@ -48,6 +51,7 @@ class SectionDTO { bool operator ==(Object other) => identical(this, other) || other is SectionDTO && other.id == id && other.label == label && + other.title == title && other.description == description && other.imageId == imageId && other.configurationId == configurationId && @@ -61,6 +65,7 @@ class SectionDTO { int get hashCode => (id == null ? 0 : id.hashCode) + (label == null ? 0 : label.hashCode) + + (title == null ? 0 : title.hashCode) + (description == null ? 0 : description.hashCode) + (imageId == null ? 0 : imageId.hashCode) + (configurationId == null ? 0 : configurationId.hashCode) + @@ -71,7 +76,7 @@ class SectionDTO { (dateCreation == null ? 0 : dateCreation.hashCode); @override - String toString() => 'SectionDTO[id=$id, label=$label, description=$description, imageId=$imageId, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation]'; + String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation]'; Map toJson() { final json = {}; @@ -81,6 +86,9 @@ class SectionDTO { if (label != null) { json[r'label'] = label; } + if (title != null) { + json[r'title'] = title; + } if (description != null) { json[r'description'] = description; } @@ -115,6 +123,7 @@ class SectionDTO { : SectionDTO( id: json[r'id'], label: json[r'label'], + title: json[r'title'], description: json[r'description'], imageId: json[r'imageId'], configurationId: json[r'configurationId'], diff --git a/manager_api/swagger.yaml b/manager_api/swagger.yaml index ddeb389..597e2a5 100644 --- a/manager_api/swagger.yaml +++ b/manager_api/swagger.yaml @@ -178,6 +178,178 @@ paths: type: string security: - bearer: [] + /api/Device: + get: + tags: + - Device + operationId: Device_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Device + operationId: Device_Create + requestBody: + x-name: newDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Device + operationId: Device_Update + requestBody: + x-name: updatedDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + '/api/Device/{id}/detail': + get: + tags: + - Device + operationId: Device_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + '/api/Device/{id}': + delete: + tags: + - Device + operationId: Device_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] /api/Ressource: get: tags: @@ -518,6 +690,39 @@ paths: type: string security: - bearer: [] + delete: + tags: + - Section + operationId: Section_DeleteAllForConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] '/api/Section/{id}/subsections': get: tags: @@ -571,7 +776,8 @@ paths: description: '' content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/SectionDTO' '404': description: '' content: @@ -901,6 +1107,45 @@ components: dateCreation: type: string format: date-time + DeviceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + ipAddress: + type: string + nullable: true + configurationId: + type: string + nullable: true + connected: + type: boolean + dateCreation: + type: string + format: date-time + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceDTO' + - type: object + additionalProperties: false + properties: + connectionLevel: + type: string + nullable: true + lastConnectionLevel: + type: string + format: date-time + batteryLevel: + type: string + nullable: true + lastBatteryLevel: + type: string + format: date-time RessourceDTO: type: object additionalProperties: false @@ -954,6 +1199,9 @@ components: label: type: string nullable: true + title: + type: string + nullable: true description: type: string nullable: true @@ -1079,6 +1327,8 @@ security: tags: - name: Configuration description: Configuration management + - name: Device + description: Device management - name: Ressource description: Ressource management - name: Section diff --git a/manager_api/test/device_api_test.dart b/manager_api/test/device_api_test.dart new file mode 100644 index 0000000..5589d95 --- /dev/null +++ b/manager_api/test/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:managerapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for DeviceApi +void main() { + final instance = DeviceApi(); + + group('tests for DeviceApi', () { + //Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async + test('test deviceCreate', () async { + // TODO + }); + + //Future deviceDelete(String id) async + test('test deviceDelete', () async { + // TODO + }); + + //Future> deviceGet() async + test('test deviceGet', () async { + // TODO + }); + + //Future deviceGetDetail(String id) async + test('test deviceGetDetail', () async { + // TODO + }); + + //Future deviceUpdate(DeviceDetailDTO deviceDetailDTO) async + test('test deviceUpdate', () async { + // TODO + }); + + }); +} diff --git a/manager_api/test/device_detail_dto_all_of_test.dart b/manager_api/test/device_detail_dto_all_of_test.dart new file mode 100644 index 0000000..52e846c --- /dev/null +++ b/manager_api/test/device_detail_dto_all_of_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTOAllOf +void main() { + final instance = DeviceDetailDTOAllOf(); + + group('test DeviceDetailDTOAllOf', () { + // String connectionLevel + test('to test the property `connectionLevel`', () async { + // TODO + }); + + // DateTime lastConnectionLevel + test('to test the property `lastConnectionLevel`', () async { + // TODO + }); + + // String batteryLevel + test('to test the property `batteryLevel`', () async { + // TODO + }); + + // DateTime lastBatteryLevel + test('to test the property `lastBatteryLevel`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/device_detail_dto_test.dart b/manager_api/test/device_detail_dto_test.dart new file mode 100644 index 0000000..b9daed5 --- /dev/null +++ b/manager_api/test/device_detail_dto_test.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 + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTO +void main() { + final instance = DeviceDetailDTO(); + + group('test DeviceDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // bool connected + test('to test the property `connected`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // String connectionLevel + test('to test the property `connectionLevel`', () async { + // TODO + }); + + // DateTime lastConnectionLevel + test('to test the property `lastConnectionLevel`', () async { + // TODO + }); + + // String batteryLevel + test('to test the property `batteryLevel`', () async { + // TODO + }); + + // DateTime lastBatteryLevel + test('to test the property `lastBatteryLevel`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/device_dto_test.dart b/manager_api/test/device_dto_test.dart new file mode 100644 index 0000000..269d22e --- /dev/null +++ b/manager_api/test/device_dto_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDTO +void main() { + final instance = DeviceDTO(); + + group('test DeviceDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // bool connected + test('to test the property `connected`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +}