Add device service generation (code + in client) + update devices screen + section icons + sectio detail screen (WIP)

This commit is contained in:
Thomas Fransolet 2021-05-04 19:13:09 +02:00
parent 1c885e85e0
commit 6e2dac52d1
29 changed files with 1841 additions and 61 deletions

View File

@ -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;
}

View File

@ -1,9 +1,15 @@
import 'package:flutter/material.dart'; 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/Components/string_input_container.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/client.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
import 'package:overlay_support/overlay_support.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -28,8 +34,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
future: getSection(widget.id, appContext.getContext().clientAPI), future: getSection(widget.id, appContext.getContext().clientAPI),
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
print("euh fuck ?");
print(snapshot.data);
return bodySection(snapshot.data, size, appContext, context); return bodySection(snapshot.data, size, appContext, context);
} else if (snapshot.connectionState == ConnectionState.none) { } else if (snapshot.connectionState == ConnectionState.none) {
return Text("No data"); return Text("No data");
@ -55,8 +59,21 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(sectionDTO.label, style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)), 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(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Text(DateFormat('dd/MM/yyyy').format(sectionDTO.dateCreation), style: TextStyle(fontSize: 15, fontWeight: FontWeight.w200)), child: Text(DateFormat('dd/MM/yyyy').format(sectionDTO.dateCreation), style: TextStyle(fontSize: 15, fontWeight: FontWeight.w200)),
@ -72,7 +89,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.selectedConfiguration = null; managerAppContext.selectedSection = null;
appContext.setContext(managerAppContext); appContext.setContext(managerAppContext);
}, },
child: Container( child: Container(
@ -111,11 +128,21 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
sectionDTO.label = value; sectionDTO.label = value;
}, },
), ),
StringContainer( MultiSelectContainer(
label: "Description :", label: "Type :",
initialValue: sectionDTO.description, initialValue: [sectionDTO.type.toString()],
isMultiple: false,
values: section_types,
onChanged: (value) { onChanged: (value) {
sectionDTO.description = value; var tempOutput = new List<String>.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<SectionDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( StringContainer(
"Test :", label: "Titre :",
initialValue: sectionDTO.title,
onChanged: (value) {
sectionDTO.title = value;
},
), ),
Text( StringContainer(
"Test :", label: "Description :",
initialValue: sectionDTO.description,
onChanged: (value) {
sectionDTO.description = value;
},
), ),
], ],
) )
@ -140,16 +175,117 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
), ),
), ),
),// FIELDS SECTION ),// 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<void> 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<void> 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<void> 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<SectionDTO> getSection(String sectionId, dynamic appContext) async { Future<SectionDTO> getSection(String sectionId, Client client) async {
print("YOULOU TEST GET SECTION"); SectionDTO section = await client.sectionApi.sectionGetDetail(sectionId);
print(sectionId);
dynamic section = await appContext.getContext().clientAPI.sectionApi.sectionGetDetail(sectionId);
print("received section"); print("received section");
print(section); print(section);
return section; return section;

View File

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
import 'package:manager_app/Components/color_picker_input_container.dart'; import 'package:manager_app/Components/color_picker_input_container.dart';
import 'package:manager_app/Components/confirmation_dialog.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/multi_select_container.dart';
import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart';
@ -124,6 +125,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
label: "Langues :", label: "Langues :",
initialValue: configurationDTO.languages != null ? configurationDTO.languages: [], initialValue: configurationDTO.languages != null ? configurationDTO.languages: [],
values: languages, values: languages,
isMultiple: true,
onChanged: (value) { onChanged: (value) {
var tempOutput = new List<String>.from(value); var tempOutput = new List<String>.from(value);
configurationDTO.languages = tempOutput; configurationDTO.languages = tempOutput;
@ -196,11 +198,20 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.center,
child: AutoSizeText( child: AutoSizeText(
element.label, element.label,
style: new TextStyle(fontSize: 25), style: new TextStyle(fontSize: 15),
maxLines: 1, 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<ConfigurationDetailScreen> {
textColor: Colors.white, textColor: Colors.white,
fontSize: 15, fontSize: 15,
press: () { press: () {
print("Annuler pressed");
cancel(configurationDTO, appContext); cancel(configurationDTO, appContext);
}, },
), ),
@ -260,7 +270,6 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
textColor: Colors.white, textColor: Colors.white,
fontSize: 15, fontSize: 15,
press: () { press: () {
print("Supprimer pressed");
delete(configurationDTO, appContext); delete(configurationDTO, appContext);
}, },
), ),
@ -275,7 +284,6 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
fontSize: 15, fontSize: 15,
press: () { press: () {
save(configurationDTO, appContext); save(configurationDTO, appContext);
print("Sauvegarder pressed");
}, },
), ),
), ),
@ -326,20 +334,11 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
); );
} }
Future<void> save(ConfigurationDTO configurationDTO, AppContext appContext) async { Future<void> cancel(ConfigurationDTO configurationDTO, AppContext appContext) async {
ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationUpdate(configurationDTO);
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationGetDetail(configurationDTO.id);
managerAppContext.selectedConfiguration = configuration; managerAppContext.selectedConfiguration = configuration;
appContext.setContext(managerAppContext); appContext.setContext(managerAppContext);
// popup a toast.
toast('La configuration 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);*/
} }
Future<void> delete(ConfigurationDTO configurationDTO, AppContext appContext) async { Future<void> delete(ConfigurationDTO configurationDTO, AppContext appContext) async {
@ -356,11 +355,20 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
); );
} }
Future<void> cancel(ConfigurationDTO configurationDTO, AppContext appContext) async { Future<void> save(ConfigurationDTO configurationDTO, AppContext appContext) async {
ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationUpdate(configurationDTO);
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
ConfigurationDTO configuration = await appContext.getContext().clientAPI.configurationApi.configurationGetDetail(configurationDTO.id);
managerAppContext.selectedConfiguration = configuration; managerAppContext.selectedConfiguration = configuration;
appContext.setContext(managerAppContext); appContext.setContext(managerAppContext);
// popup a toast.
toast('La configuration 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);*/
} }
Future<ConfigurationDTO> getConfiguration(ConfigurationDetailScreen widget, Client client) async { Future<ConfigurationDTO> getConfiguration(ConfigurationDetailScreen widget, Client client) async {

View File

@ -9,8 +9,6 @@ import 'package:managerapi/api.dart';
import 'package:overlay_support/overlay_support.dart'; import 'package:overlay_support/overlay_support.dart';
void showNewSection(ConfigurationDTO configurationDTO, AppContext appContext, BuildContext context) { void showNewSection(ConfigurationDTO configurationDTO, AppContext appContext, BuildContext context) {
List<String> types = ["Map", "Slider", "Video", "Web", "Menu"];
SectionDTO sectionDTO = new SectionDTO(); SectionDTO sectionDTO = new SectionDTO();
sectionDTO.configurationId = configurationDTO.id; sectionDTO.configurationId = configurationDTO.id;
@ -33,7 +31,7 @@ void showNewSection(ConfigurationDTO configurationDTO, AppContext appContext, Bu
label: "Type :", label: "Type :",
initialValue: ["Map"], initialValue: ["Map"],
isMultiple: false, isMultiple: false,
values: types, values: section_types,
onChanged: (value) { onChanged: (value) {
var tempOutput = new List<String>.from(value); var tempOutput = new List<String>.from(value);
sectionDTO.type = SectionType.fromJson(tempOutput[0]); sectionDTO.type = SectionType.fromJson(tempOutput[0]);
@ -93,6 +91,7 @@ void create(SectionDTO sectionDTO, AppContext appContext, BuildContext context)
if (sectionDTO.label != null) { if (sectionDTO.label != null) {
Navigator.of(context).pop(); Navigator.of(context).pop();
print(sectionDTO);
SectionDTO newSection = await appContext.getContext().clientAPI.sectionApi.sectionCreate(sectionDTO); SectionDTO newSection = await appContext.getContext().clientAPI.sectionApi.sectionCreate(sectionDTO);
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
if (managerAppContext.selectedConfiguration.sectionIds == null) { if (managerAppContext.selectedConfiguration.sectionIds == null) {

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:managerapi/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class DevicesScreen extends StatefulWidget { class DevicesScreen extends StatefulWidget {
@ -21,7 +22,7 @@ class _DevicesScreenState extends State<DevicesScreen> {
Text( Text(
"Devices" "Devices"
), ),
/*FutureBuilder( FutureBuilder(
future: getDevices(appContext), future: getDevices(appContext),
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
@ -40,18 +41,18 @@ class _DevicesScreenState extends State<DevicesScreen> {
return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE'))); return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE')));
} }
} }
),*/ ),
] ]
), ),
); );
} }
} }
/*Future<List<DeviceDTO>> getDevices(dynamic appContext) async { Future<List<DeviceDTO>> getDevices(dynamic appContext) async {
List<DeviceDTO> devices = await appContext.getContext().clientAPI.deviceApi.deviceGet(); List<DeviceDTO> devices = await appContext.getContext().clientAPI.deviceApi.deviceGet();
print("number of devices " + ressources.length.toString()); print("number of devices " + devices.length.toString());
devices.forEach((element) { devices.forEach((element) {
print(element); print(element);
}); });
return devices; return devices;
}*/ }

View File

@ -75,16 +75,25 @@ class _LoginScreenState extends State<LoginScreen> {
print(element); print(element);
}); });
List<SectionDTO> sections = await clientAPI.sectionApi.sectionGetFromConfiguration(id); /*List<SectionDTO> sections = await clientAPI.sectionApi.sectionGetFromConfiguration(id);
print("number of sections " + sections.length.toString()); print("number of sections " + sections.length.toString());
sections.forEach((element) { sections.forEach((element) {
print(element); print(element);
}); });*/
SectionDTO section = await clientAPI.sectionApi.sectionGetDetail("60916249494b9eaf283b44f7");
print(section);
List<RessourceDTO> ressources = await clientAPI.ressourceApi.ressourceGet(); List<RessourceDTO> ressources = await clientAPI.ressourceApi.ressourceGet();
print("number of ressources " + ressources.length.toString()); print("number of ressources " + ressources.length.toString());
ressources.forEach((element) { ressources.forEach((element) {
print(element); print(element);
});
List<DeviceDTO> devices = await clientAPI.deviceApi.deviceGet();
print("number of devices " + devices.length.toString());
devices.forEach((element) {
print(element);
});*/ });*/
} }
} }

View File

@ -20,6 +20,9 @@ class Client {
RessourceApi _ressourceApi; RessourceApi _ressourceApi;
RessourceApi get ressourceApi => _ressourceApi; RessourceApi get ressourceApi => _ressourceApi;
DeviceApi _deviceApi;
DeviceApi get deviceApi => _deviceApi;
Client() { Client() {
_apiClient = ApiClient( _apiClient = ApiClient(
basePath: "http://192.168.31.96"); basePath: "http://192.168.31.96");
@ -29,5 +32,6 @@ class Client {
_configurationApi = ConfigurationApi(_apiClient); _configurationApi = ConfigurationApi(_apiClient);
_sectionApi = SectionApi(_apiClient); _sectionApi = SectionApi(_apiClient);
_ressourceApi = RessourceApi(_apiClient); _ressourceApi = RessourceApi(_apiClient);
_deviceApi = DeviceApi(_apiClient);
} }
} }

View File

@ -13,6 +13,8 @@ const kSecond = Color(0xFFC2C9D6);
const kWhite = Color(0xFFFFFFFF); const kWhite = Color(0xFFFFFFFF);
const kBlack = Color(0xFF000000); const kBlack = Color(0xFF000000);
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu"];
/* /*
const kTextStyle = TextStyle( const kTextStyle = TextStyle(
fontSize: 23, fontSize: 23,

View File

@ -4,6 +4,10 @@ README.md
doc/AuthenticationApi.md doc/AuthenticationApi.md
doc/ConfigurationApi.md doc/ConfigurationApi.md
doc/ConfigurationDTO.md doc/ConfigurationDTO.md
doc/DeviceApi.md
doc/DeviceDTO.md
doc/DeviceDetailDTO.md
doc/DeviceDetailDTOAllOf.md
doc/LoginDTO.md doc/LoginDTO.md
doc/RessourceApi.md doc/RessourceApi.md
doc/RessourceDTO.md doc/RessourceDTO.md
@ -20,6 +24,7 @@ git_push.sh
lib/api.dart lib/api.dart
lib/api/authentication_api.dart lib/api/authentication_api.dart
lib/api/configuration_api.dart lib/api/configuration_api.dart
lib/api/device_api.dart
lib/api/ressource_api.dart lib/api/ressource_api.dart
lib/api/section_api.dart lib/api/section_api.dart
lib/api/user_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/http_bearer_auth.dart
lib/auth/oauth.dart lib/auth/oauth.dart
lib/model/configuration_dto.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/login_dto.dart
lib/model/ressource_detail_dto.dart lib/model/ressource_detail_dto.dart
lib/model/ressource_dto.dart lib/model/ressource_dto.dart

View File

@ -71,6 +71,11 @@ Class | Method | HTTP request | Description
*ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | *ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
*ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | *ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | *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* | [**ressourceCreate**](doc\/RessourceApi.md#ressourcecreate) | **POST** /api/Ressource |
*RessourceApi* | [**ressourceDelete**](doc\/RessourceApi.md#ressourcedelete) | **DELETE** /api/Ressource/{id} | *RessourceApi* | [**ressourceDelete**](doc\/RessourceApi.md#ressourcedelete) | **DELETE** /api/Ressource/{id} |
*RessourceApi* | [**ressourceGet**](doc\/RessourceApi.md#ressourceget) | **GET** /api/Ressource | *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 | *RessourceApi* | [**ressourceUpdate**](doc\/RessourceApi.md#ressourceupdate) | **PUT** /api/Ressource |
*SectionApi* | [**sectionCreate**](doc\/SectionApi.md#sectioncreate) | **POST** /api/Section | *SectionApi* | [**sectionCreate**](doc\/SectionApi.md#sectioncreate) | **POST** /api/Section |
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | *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* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | *SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
@ -94,6 +100,9 @@ Class | Method | HTTP request | Description
## Documentation For Models ## Documentation For Models
- [ConfigurationDTO](doc\/ConfigurationDTO.md) - [ConfigurationDTO](doc\/ConfigurationDTO.md)
- [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
- [LoginDTO](doc\/LoginDTO.md) - [LoginDTO](doc\/LoginDTO.md)
- [RessourceDTO](doc\/RessourceDTO.md) - [RessourceDTO](doc\/RessourceDTO.md)
- [RessourceDetailDTO](doc\/RessourceDetailDTO.md) - [RessourceDetailDTO](doc\/RessourceDetailDTO.md)

View File

@ -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<OAuth>('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<OAuth>('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<DeviceDTO> deviceGet()
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('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>**](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<OAuth>('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<OAuth>('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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -11,6 +11,7 @@ Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**sectionCreate**](SectionApi.md#sectioncreate) | **POST** /api/Section | [**sectionCreate**](SectionApi.md#sectioncreate) | **POST** /api/Section |
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | [**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
[**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | [**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) [[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<OAuth>('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** # **sectionGet**
> List<SectionDTO> sectionGet() > List<SectionDTO> 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) [[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** # **sectionGetDetail**
> Object sectionGetDetail(id) > SectionDTO sectionGetDetail(id)
@ -216,7 +260,7 @@ Name | Type | Description | Notes
### Return type ### Return type
[**Object**](Object.md) [**SectionDTO**](SectionDTO.md)
### Authorization ### Authorization

View File

@ -10,6 +10,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] **id** | **String** | | [optional]
**label** | **String** | | [optional] **label** | **String** | | [optional]
**title** | **String** | | [optional]
**description** | **String** | | [optional] **description** | **String** | | [optional]
**imageId** | **String** | | [optional] **imageId** | **String** | | [optional]
**configurationId** | **String** | | [optional] **configurationId** | **String** | | [optional]

View File

@ -29,11 +29,15 @@ part 'auth/http_bearer_auth.dart';
part 'api/authentication_api.dart'; part 'api/authentication_api.dart';
part 'api/configuration_api.dart'; part 'api/configuration_api.dart';
part 'api/device_api.dart';
part 'api/ressource_api.dart'; part 'api/ressource_api.dart';
part 'api/section_api.dart'; part 'api/section_api.dart';
part 'api/user_api.dart'; part 'api/user_api.dart';
part 'model/configuration_dto.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/login_dto.dart';
part 'model/ressource_dto.dart'; part 'model/ressource_dto.dart';
part 'model/ressource_detail_dto.dart'; part 'model/ressource_detail_dto.dart';

View File

@ -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<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['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<DeviceDetailDTO> 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<DeviceDetailDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['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<String> 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<String>.value(null);
}
/// Performs an HTTP 'GET /api/Device' operation and returns the [Response].
Future<Response> deviceGetWithHttpInfo() async {
final path = r'/api/Device';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['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<List<DeviceDTO>> 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<DeviceDTO>') as List)
.cast<DeviceDTO>()
.toList(growable: false);
}
return Future<List<DeviceDTO>>.value(null);
}
/// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['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<DeviceDetailDTO> 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<DeviceDetailDTO>.value(null);
}
/// Performs an HTTP 'PUT /api/Device' operation and returns the [Response].
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['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<DeviceDetailDTO> 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<DeviceDetailDTO>.value(null);
}
}

View File

@ -142,6 +142,70 @@ class SectionApi {
return Future<String>.value(null); return Future<String>.value(null);
} }
/// Performs an HTTP 'DELETE /api/Section/configuration/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['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<String> 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<String>.value(null);
}
/// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Section' operation and returns the [Response].
Future<Response> sectionGetWithHttpInfo() async { Future<Response> sectionGetWithHttpInfo() async {
final path = r'/api/Section'; final path = r'/api/Section';
@ -312,7 +376,7 @@ class SectionApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Object> sectionGetDetail(String id) async { Future<SectionDTO> sectionGetDetail(String id) async {
final response = await sectionGetDetailWithHttpInfo(id); final response = await sectionGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); 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" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { 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<Object>.value(null); return Future<SectionDTO>.value(null);
} }
/// Performs an HTTP 'GET /api/Section/configuration/{id}' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Section/configuration/{id}' operation and returns the [Response].

View File

@ -158,6 +158,12 @@ class ApiClient {
return value is double ? value : double.parse('$value'); return value is double ? value : double.parse('$value');
case 'ConfigurationDTO': case 'ConfigurationDTO':
return ConfigurationDTO.fromJson(value); return ConfigurationDTO.fromJson(value);
case 'DeviceDTO':
return DeviceDTO.fromJson(value);
case 'DeviceDetailDTO':
return DeviceDetailDTO.fromJson(value);
case 'DeviceDetailDTOAllOf':
return DeviceDetailDTOAllOf.fromJson(value);
case 'LoginDTO': case 'LoginDTO':
return LoginDTO.fromJson(value); return LoginDTO.fromJson(value);
case 'RessourceDTO': case 'RessourceDTO':

View File

@ -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<String, dynamic> toJson() {
final json = <String, dynamic>{};
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<String, dynamic> 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<DeviceDetailDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDetailDTO>[]
: json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, DeviceDetailDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, DeviceDetailDTO>{};
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<String, List<DeviceDetailDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DeviceDetailDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -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<String, dynamic> toJson() {
final json = <String, dynamic>{};
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<String, dynamic> 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<DeviceDetailDTOAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDetailDTOAllOf>[]
: json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable);
static Map<String, DeviceDetailDTOAllOf> mapFromJson(Map<String, dynamic> json) {
final map = <String, DeviceDetailDTOAllOf>{};
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<String, List<DeviceDetailDTOAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DeviceDetailDTOAllOf>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -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<String, dynamic> toJson() {
final json = <String, dynamic>{};
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<String, dynamic> 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<DeviceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDTO>[]
: json.map((v) => DeviceDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, DeviceDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, DeviceDTO>{};
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<String, List<DeviceDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DeviceDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -14,6 +14,7 @@ class SectionDTO {
SectionDTO({ SectionDTO({
this.id, this.id,
this.label, this.label,
this.title,
this.description, this.description,
this.imageId, this.imageId,
this.configurationId, this.configurationId,
@ -28,6 +29,8 @@ class SectionDTO {
String label; String label;
String title;
String description; String description;
String imageId; String imageId;
@ -48,6 +51,7 @@ class SectionDTO {
bool operator ==(Object other) => identical(this, other) || other is SectionDTO && bool operator ==(Object other) => identical(this, other) || other is SectionDTO &&
other.id == id && other.id == id &&
other.label == label && other.label == label &&
other.title == title &&
other.description == description && other.description == description &&
other.imageId == imageId && other.imageId == imageId &&
other.configurationId == configurationId && other.configurationId == configurationId &&
@ -61,6 +65,7 @@ class SectionDTO {
int get hashCode => int get hashCode =>
(id == null ? 0 : id.hashCode) + (id == null ? 0 : id.hashCode) +
(label == null ? 0 : label.hashCode) + (label == null ? 0 : label.hashCode) +
(title == null ? 0 : title.hashCode) +
(description == null ? 0 : description.hashCode) + (description == null ? 0 : description.hashCode) +
(imageId == null ? 0 : imageId.hashCode) + (imageId == null ? 0 : imageId.hashCode) +
(configurationId == null ? 0 : configurationId.hashCode) + (configurationId == null ? 0 : configurationId.hashCode) +
@ -71,7 +76,7 @@ class SectionDTO {
(dateCreation == null ? 0 : dateCreation.hashCode); (dateCreation == null ? 0 : dateCreation.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -81,6 +86,9 @@ class SectionDTO {
if (label != null) { if (label != null) {
json[r'label'] = label; json[r'label'] = label;
} }
if (title != null) {
json[r'title'] = title;
}
if (description != null) { if (description != null) {
json[r'description'] = description; json[r'description'] = description;
} }
@ -115,6 +123,7 @@ class SectionDTO {
: SectionDTO( : SectionDTO(
id: json[r'id'], id: json[r'id'],
label: json[r'label'], label: json[r'label'],
title: json[r'title'],
description: json[r'description'], description: json[r'description'],
imageId: json[r'imageId'], imageId: json[r'imageId'],
configurationId: json[r'configurationId'], configurationId: json[r'configurationId'],

View File

@ -178,6 +178,178 @@ paths:
type: string type: string
security: security:
- bearer: [] - 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: /api/Ressource:
get: get:
tags: tags:
@ -518,6 +690,39 @@ paths:
type: string type: string
security: security:
- bearer: [] - 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': '/api/Section/{id}/subsections':
get: get:
tags: tags:
@ -571,7 +776,8 @@ paths:
description: '' description: ''
content: content:
application/json: application/json:
schema: {} schema:
$ref: '#/components/schemas/SectionDTO'
'404': '404':
description: '' description: ''
content: content:
@ -901,6 +1107,45 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time 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: RessourceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -954,6 +1199,9 @@ components:
label: label:
type: string type: string
nullable: true nullable: true
title:
type: string
nullable: true
description: description:
type: string type: string
nullable: true nullable: true
@ -1079,6 +1327,8 @@ security:
tags: tags:
- name: Configuration - name: Configuration
description: Configuration management description: Configuration management
- name: Device
description: Device management
- name: Ressource - name: Ressource
description: Ressource management description: Ressource management
- name: Section - name: Section

View File

@ -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<DeviceDetailDTO> deviceCreate(DeviceDetailDTO deviceDetailDTO) async
test('test deviceCreate', () async {
// TODO
});
//Future<String> deviceDelete(String id) async
test('test deviceDelete', () async {
// TODO
});
//Future<List<DeviceDTO>> deviceGet() async
test('test deviceGet', () async {
// TODO
});
//Future<DeviceDetailDTO> deviceGetDetail(String id) async
test('test deviceGetDetail', () async {
// TODO
});
//Future<DeviceDetailDTO> deviceUpdate(DeviceDetailDTO deviceDetailDTO) async
test('test deviceUpdate', () async {
// TODO
});
});
}

View File

@ -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
});
});
}

View File

@ -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
});
});
}

View File

@ -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
});
});
}