From 24ab7796e236058b2d38d4855338ca8a624d6afb Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Thu, 6 Oct 2022 17:06:08 +0200 Subject: [PATCH] Add instance generation service + dto + not show title and description for article --- lib/Models/managerContext.dart | 1 + .../SubSection/Article/article_config.dart | 2 +- .../Slider/listView_card_image.dart | 4 +- .../Slider/new_update_image_slider.dart | 57 +- .../SubSection/Slider/slider_config.dart | 2 +- .../new_configuration_popup.dart | 2 +- .../Configurations/new_section_popup.dart | 1 + .../Devices/change_device_info_modal.dart | 6 +- lib/Screens/Devices/devices_screen.dart | 4 +- lib/Screens/Resources/resource_body_grid.dart | 5 +- lib/Screens/Resources/resources_screen.dart | 5 +- lib/Screens/login_screen.dart | 3 +- manager_api/.openapi-generator/FILES | 6 + manager_api/README.md | 7 + manager_api/doc/ConfigurationApi.md | 10 +- manager_api/doc/ConfigurationDTO.md | 1 + manager_api/doc/DeviceApi.md | 10 +- manager_api/doc/DeviceDTO.md | 1 + manager_api/doc/DeviceDetailDTO.md | 1 + manager_api/doc/ExportConfigurationDTO.md | 1 + manager_api/doc/Instance.md | 17 + manager_api/doc/InstanceApi.md | 229 ++ manager_api/doc/InstanceDTO.md | 17 + manager_api/doc/ResourceApi.md | 16 +- manager_api/doc/ResourceDTO.md | 1 + manager_api/doc/SectionApi.md | 10 +- manager_api/doc/SectionDTO.md | 1 + manager_api/doc/TokenDTO.md | 1 + manager_api/doc/User.md | 1 + manager_api/lib/api.dart | 3 + manager_api/lib/api/configuration_api.dart | 18 +- manager_api/lib/api/device_api.dart | 18 +- manager_api/lib/api/instance_api.dart | 325 +++ manager_api/lib/api/resource_api.dart | 35 +- manager_api/lib/api/section_api.dart | 18 +- manager_api/lib/api_client.dart | 4 + manager_api/lib/model/configuration_dto.dart | 15 +- manager_api/lib/model/device_detail_dto.dart | 11 +- manager_api/lib/model/device_dto.dart | 15 +- .../lib/model/export_configuration_dto.dart | 11 +- manager_api/lib/model/instance.dart | 91 + manager_api/lib/model/instance_dto.dart | 91 + manager_api/lib/model/resource_dto.dart | 15 +- manager_api/lib/model/section_dto.dart | 15 +- manager_api/lib/model/token_dto.dart | 15 +- manager_api/lib/model/user.dart | 15 +- manager_api/swagger.yaml | 2212 +++++++++++++++++ manager_api/test/instance_api_test.dart | 45 + manager_api/test/instance_dto_test.dart | 36 + manager_api/test/instance_test.dart | 36 + 50 files changed, 3377 insertions(+), 89 deletions(-) create mode 100644 manager_api/doc/Instance.md create mode 100644 manager_api/doc/InstanceApi.md create mode 100644 manager_api/doc/InstanceDTO.md create mode 100644 manager_api/lib/api/instance_api.dart create mode 100644 manager_api/lib/model/instance.dart create mode 100644 manager_api/lib/model/instance_dto.dart create mode 100644 manager_api/swagger.yaml create mode 100644 manager_api/test/instance_api_test.dart create mode 100644 manager_api/test/instance_dto_test.dart create mode 100644 manager_api/test/instance_test.dart diff --git a/lib/Models/managerContext.dart b/lib/Models/managerContext.dart index 651d089..667a0e9 100644 --- a/lib/Models/managerContext.dart +++ b/lib/Models/managerContext.dart @@ -5,6 +5,7 @@ import 'package:managerapi/api.dart'; class ManagerAppContext with ChangeNotifier{ String email; + String instanceId; TokenDTO token; Client clientAPI; String currentRoute; diff --git a/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart b/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart index 6d2c694..fb4f4cb 100644 --- a/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart @@ -163,7 +163,7 @@ class _ArticleConfigState extends State { right: 15, child: InkWell( onTap: () async { - var result = await showNewOrUpdateImageSlider(null, appContext, context); + var result = await showNewOrUpdateImageSlider(null, appContext, context, false, false); if (result != null) { setState(() { diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart index f4b6c88..72fe299 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart @@ -77,7 +77,9 @@ class _ListViewCard extends State { var result = await showNewOrUpdateImageSlider( widget.listItems[widget.index], widget.appContext, - context + context, + true, + true ); if (result != null) { diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart index c3f7abb..936c0b6 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart @@ -8,7 +8,7 @@ import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; -Future showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext appContext, BuildContext context) async { +Future showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async { ImageDTO imageDTO = new ImageDTO(); if (inputImageDTO != null) { @@ -61,14 +61,15 @@ Future showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext a isSmall: true ), ), - Container( - height: size.height * 0.33, - width: double.infinity, - child: ListView( - scrollDirection: Axis.horizontal, - children: getTranslations(dialogContext, appContext, imageDTO), + if(showTitle || showDescription) + Container( + height: size.height * 0.33, + width: double.infinity, + child: ListView( + scrollDirection: Axis.horizontal, + children: getTranslations(dialogContext, appContext, imageDTO, showTitle, showDescription), + ), ), - ), ], ), ], @@ -123,7 +124,7 @@ Future showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext a return result; } -getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO) { +getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO, bool showTitle, bool showDescription) { List translations = []; ManagerAppContext managerAppContext = appContext.getContext(); for(var language in managerAppContext.selectedConfiguration.languages) { @@ -151,24 +152,26 @@ getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO) mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ - TextFormInputContainer( - label: "Titre:", - color: kWhite, - isTitle: true, - initialValue: imageDTO.title.where((element) => element.language == language).first.value, - onChanged: (value) { - imageDTO.title.where((element) => element.language == language).first.value = value; - }, - ), - TextFormInputContainer( - label: "Description:", - color: kWhite, - isTitle: false, - initialValue: imageDTO.description.where((element) => element.language == language).first.value, - onChanged: (value) { - imageDTO.description.where((element) => element.language == language).first.value = value; - }, - ), + if(showTitle) + TextFormInputContainer( + label: "Titre:", + color: kWhite, + isTitle: true, + initialValue: imageDTO.title.where((element) => element.language == language).first.value, + onChanged: (value) { + imageDTO.title.where((element) => element.language == language).first.value = value; + }, + ), + if(showDescription) + TextFormInputContainer( + label: "Description:", + color: kWhite, + isTitle: false, + initialValue: imageDTO.description.where((element) => element.language == language).first.value, + onChanged: (value) { + imageDTO.description.where((element) => element.language == language).first.value = value; + }, + ), ], ), ), diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart index 6b7dc99..cd73d33 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart @@ -100,7 +100,7 @@ class _SliderConfigState extends State { right: 0, child: InkWell( onTap: () async { - var result = await showNewOrUpdateImageSlider(null, appContext, context); + var result = await showNewOrUpdateImageSlider(null, appContext, context, true, true); if (result != null) { setState(() { diff --git a/lib/Screens/Configurations/new_configuration_popup.dart b/lib/Screens/Configurations/new_configuration_popup.dart index 50ea38f..a31d2b7 100644 --- a/lib/Screens/Configurations/new_configuration_popup.dart +++ b/lib/Screens/Configurations/new_configuration_popup.dart @@ -127,7 +127,7 @@ String filePicker() { void create(ConfigurationDTO configurationDTO, AppContext appContext, context) async { if (configurationDTO.label != null) { - + configurationDTO.instanceId = (appContext.getContext() as ManagerAppContext).instanceId; await appContext.getContext().clientAPI.configurationApi.configurationCreate(configurationDTO); ManagerAppContext managerAppContext = appContext.getContext(); managerAppContext.selectedConfiguration = null; diff --git a/lib/Screens/Configurations/new_section_popup.dart b/lib/Screens/Configurations/new_section_popup.dart index f78bd18..bba81c1 100644 --- a/lib/Screens/Configurations/new_section_popup.dart +++ b/lib/Screens/Configurations/new_section_popup.dart @@ -94,6 +94,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext void create(SectionDTO sectionDTO, AppContext appContext, BuildContext context, bool isSubSection, Function sendSubSection) async { if (sectionDTO.label != null) { + sectionDTO.instanceId = (appContext.getContext() as ManagerAppContext).instanceId; SectionDTO newSection = await appContext.getContext().clientAPI.sectionApi.sectionCreate(sectionDTO); if (!isSubSection) { diff --git a/lib/Screens/Devices/change_device_info_modal.dart b/lib/Screens/Devices/change_device_info_modal.dart index 5427ab8..41037cb 100644 --- a/lib/Screens/Devices/change_device_info_modal.dart +++ b/lib/Screens/Devices/change_device_info_modal.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.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/constants.dart'; import 'package:managerapi/api.dart'; @@ -143,8 +145,8 @@ getConfigurationsElement(DeviceDTO inputDevice, data, Function onGetResult) { return widgets; } -Future> getConfigurations(dynamic appContext) async { - List configurations = await appContext.getContext().clientAPI.configurationApi.configurationGet(); +Future> getConfigurations(AppContext appContext) async { + List configurations = await (appContext.getContext() as ManagerAppContext).clientAPI.configurationApi.configurationGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId); //print("number of configurations " + configurations.length.toString()); configurations.forEach((element) { //print(element); diff --git a/lib/Screens/Devices/devices_screen.dart b/lib/Screens/Devices/devices_screen.dart index 753350b..6502f86 100644 --- a/lib/Screens/Devices/devices_screen.dart +++ b/lib/Screens/Devices/devices_screen.dart @@ -222,8 +222,8 @@ boxDecoration() { ); } -Future> getDevices(dynamic appContext) async { - List devices = await appContext.getContext().clientAPI.deviceApi.deviceGet(); +Future> getDevices(AppContext appContext) async { + List devices = await (appContext.getContext() as ManagerAppContext).clientAPI.deviceApi.deviceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId); //print("number of devices " + devices.length.toString()); devices.forEach((element) { //print(element); diff --git a/lib/Screens/Resources/resource_body_grid.dart b/lib/Screens/Resources/resource_body_grid.dart index 1cfc530..e013d8c 100644 --- a/lib/Screens/Resources/resource_body_grid.dart +++ b/lib/Screens/Resources/resource_body_grid.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:manager_app/Components/fetch_resource_icon.dart'; import 'package:manager_app/Components/multi_select_container.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/constants.dart'; import 'package:managerapi/api.dart'; @@ -233,8 +234,8 @@ boxDecoration(dynamic resourceDetailDTO, appContext) { } -Future> getResources(Function onGetResult, bool isImage, dynamic appContext) async { - List resources = await appContext.getContext().clientAPI.resourceApi.resourceGet(); +Future> getResources(Function onGetResult, bool isImage, AppContext appContext) async { + List resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId:(appContext.getContext() as ManagerAppContext).instanceId); if (onGetResult != null && isImage) { resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList(); } diff --git a/lib/Screens/Resources/resources_screen.dart b/lib/Screens/Resources/resources_screen.dart index 30d251f..a113dc9 100644 --- a/lib/Screens/Resources/resources_screen.dart +++ b/lib/Screens/Resources/resources_screen.dart @@ -77,8 +77,8 @@ class _ResourcesScreenState extends State { } } -Future getResources(Function onGetResult, bool isImage, dynamic appContext) async { - List resources = await appContext.getContext().clientAPI.resourceApi.resourceGet(); +Future getResources(Function onGetResult, bool isImage, AppContext appContext) async { + List resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId); if (onGetResult != null && isImage) { resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList(); } @@ -119,6 +119,7 @@ Future create(ResourceDTO resourceDTO, List files, List { // store user info locally managerAppContext.email = email; + managerAppContext.instanceId = token.instanceId; managerAppContext.token = token; managerAppContext.clientAPI = clientAPI; //print(managerAppContext); @@ -113,7 +114,7 @@ class _LoginScreenState extends State { @override void initState() { this.isRememberMe = widget.session.rememberMe; - this.host = "https://api.mymuseum.be"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" + this.host = "http://localhost:5000"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be" //this.email = "test@email.be"; //widget.session.email; //this.password = "kljqsdkljqsd"; //widget.session.password; super.initState(); diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 5451054..6536543 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -14,6 +14,9 @@ doc/ExportConfigurationDTOAllOf.md doc/GeoPointDTO.md doc/ImageDTO.md doc/ImageGeoPoint.md +doc/Instance.md +doc/InstanceApi.md +doc/InstanceDTO.md doc/LevelDTO.md doc/LoginDTO.md doc/MapDTO.md @@ -42,6 +45,7 @@ lib/api.dart lib/api/authentication_api.dart lib/api/configuration_api.dart lib/api/device_api.dart +lib/api/instance_api.dart lib/api/resource_api.dart lib/api/section_api.dart lib/api/user_api.dart @@ -63,6 +67,8 @@ lib/model/export_configuration_dto_all_of.dart lib/model/geo_point_dto.dart lib/model/image_dto.dart lib/model/image_geo_point.dart +lib/model/instance.dart +lib/model/instance_dto.dart lib/model/level_dto.dart lib/model/login_dto.dart lib/model/map_dto.dart diff --git a/manager_api/README.md b/manager_api/README.md index 084ee52..0d14cb7 100644 --- a/manager_api/README.md +++ b/manager_api/README.md @@ -79,6 +79,11 @@ Class | Method | HTTP request | Description *DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | *DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | *DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | +*InstanceApi* | [**instanceCreateInstance**](doc\/InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | +*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | +*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance | +*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | +*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | *ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource | *ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | *ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource | @@ -122,6 +127,8 @@ Class | Method | HTTP request | Description - [GeoPointDTO](doc\/GeoPointDTO.md) - [ImageDTO](doc\/ImageDTO.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [Instance](doc\/Instance.md) + - [InstanceDTO](doc\/InstanceDTO.md) - [LevelDTO](doc\/LevelDTO.md) - [LoginDTO](doc\/LoginDTO.md) - [MapDTO](doc\/MapDTO.md) diff --git a/manager_api/doc/ConfigurationApi.md b/manager_api/doc/ConfigurationApi.md index 8b51ef5..ae1c366 100644 --- a/manager_api/doc/ConfigurationApi.md +++ b/manager_api/doc/ConfigurationApi.md @@ -148,7 +148,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) # **configurationGet** -> List configurationGet() +> List configurationGet(instanceId) @@ -159,9 +159,10 @@ import 'package:managerapi/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.configurationGet(); + final result = api_instance.configurationGet(instanceId); print(result); } catch (e) { print('Exception when calling ConfigurationApi->configurationGet: $e\n'); @@ -169,7 +170,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/ConfigurationDTO.md b/manager_api/doc/ConfigurationDTO.md index 6452ac3..c387e92 100644 --- a/manager_api/doc/ConfigurationDTO.md +++ b/manager_api/doc/ConfigurationDTO.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **isMobile** | **bool** | | [optional] **isTablet** | **bool** | | [optional] **isOffline** | **bool** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/DeviceApi.md b/manager_api/doc/DeviceApi.md index 42130e9..8fb5e6c 100644 --- a/manager_api/doc/DeviceApi.md +++ b/manager_api/doc/DeviceApi.md @@ -104,7 +104,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) # **deviceGet** -> List deviceGet() +> List deviceGet(instanceId) @@ -115,9 +115,10 @@ import 'package:managerapi/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.deviceGet(); + final result = api_instance.deviceGet(instanceId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGet: $e\n'); @@ -125,7 +126,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/DeviceDTO.md b/manager_api/doc/DeviceDTO.md index 62df565..0b4501b 100644 --- a/manager_api/doc/DeviceDTO.md +++ b/manager_api/doc/DeviceDTO.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **connected** | **bool** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/DeviceDetailDTO.md b/manager_api/doc/DeviceDetailDTO.md index 4968995..314498f 100644 --- a/manager_api/doc/DeviceDetailDTO.md +++ b/manager_api/doc/DeviceDetailDTO.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **connected** | **bool** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] **connectionLevel** | **String** | | [optional] **lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] **batteryLevel** | **String** | | [optional] diff --git a/manager_api/doc/ExportConfigurationDTO.md b/manager_api/doc/ExportConfigurationDTO.md index 92ece38..4560fef 100644 --- a/manager_api/doc/ExportConfigurationDTO.md +++ b/manager_api/doc/ExportConfigurationDTO.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **isMobile** | **bool** | | [optional] **isTablet** | **bool** | | [optional] **isOffline** | **bool** | | [optional] +**instanceId** | **String** | | [optional] **sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] **resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] diff --git a/manager_api/doc/Instance.md b/manager_api/doc/Instance.md new file mode 100644 index 0000000..35094f1 --- /dev/null +++ b/manager_api/doc/Instance.md @@ -0,0 +1,17 @@ +# managerapi.model.Instance + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/InstanceApi.md b/manager_api/doc/InstanceApi.md new file mode 100644 index 0000000..fbd914e --- /dev/null +++ b/manager_api/doc/InstanceApi.md @@ -0,0 +1,229 @@ +# managerapi.api.InstanceApi + +## Load the API package +```dart +import 'package:managerapi/api.dart'; +``` + +All URIs are relative to *http://localhost:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**instanceCreateInstance**](InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | +[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | +[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance | +[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | +[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | + + +# **instanceCreateInstance** +> InstanceDTO instanceCreateInstance(instance) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final instance = Instance(); // Instance | + +try { + final result = api_instance.instanceCreateInstance(instance); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceCreateInstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance** | [**Instance**](Instance.md)| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceDeleteInstance** +> String instanceDeleteInstance(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final id = id_example; // String | + +try { + final result = api_instance.instanceDeleteInstance(id); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceDeleteInstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceGet** +> List instanceGet() + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); + +try { + final result = api_instance.instanceGet(); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](Instance.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceGetDetail** +> InstanceDTO instanceGetDetail(id) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final id = id_example; // String | + +try { + final result = api_instance.instanceGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceUpdateinstance** +> InstanceDTO instanceUpdateinstance(instance) + + + +### Example +```dart +import 'package:managerapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final instance = Instance(); // Instance | + +try { + final result = api_instance.instanceUpdateinstance(instance); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceUpdateinstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance** | [**Instance**](Instance.md)| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api/doc/InstanceDTO.md b/manager_api/doc/InstanceDTO.md new file mode 100644 index 0000000..1e241f5 --- /dev/null +++ b/manager_api/doc/InstanceDTO.md @@ -0,0 +1,17 @@ +# managerapi.model.InstanceDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/ResourceApi.md b/manager_api/doc/ResourceApi.md index 34d7e5e..6748700 100644 --- a/manager_api/doc/ResourceApi.md +++ b/manager_api/doc/ResourceApi.md @@ -105,7 +105,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) # **resourceGet** -> List resourceGet() +> List resourceGet(instanceId) @@ -116,9 +116,10 @@ import 'package:managerapi/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.resourceGet(); + final result = api_instance.resourceGet(instanceId); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceGet: $e\n'); @@ -126,7 +127,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type @@ -273,7 +277,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) # **resourceUpload** -> String resourceUpload(label, type) +> String resourceUpload(label, type, instanceId) @@ -286,9 +290,10 @@ import 'package:managerapi/api.dart'; final api_instance = ResourceApi(); final label = label_example; // String | final type = type_example; // String | +final instanceId = instanceId_example; // String | try { - final result = api_instance.resourceUpload(label, type); + final result = api_instance.resourceUpload(label, type, instanceId); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceUpload: $e\n'); @@ -301,6 +306,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **label** | **String**| | [optional] **type** | **String**| | [optional] + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/ResourceDTO.md b/manager_api/doc/ResourceDTO.md index d2acd16..cc4d87b 100644 --- a/manager_api/doc/ResourceDTO.md +++ b/manager_api/doc/ResourceDTO.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **label** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **data** | **String** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/SectionApi.md b/manager_api/doc/SectionApi.md index 4793ac5..4fe095b 100644 --- a/manager_api/doc/SectionApi.md +++ b/manager_api/doc/SectionApi.md @@ -158,7 +158,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) # **sectionGet** -> List sectionGet() +> List sectionGet(instanceId) @@ -169,9 +169,10 @@ import 'package:managerapi/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.sectionGet(); + final result = api_instance.sectionGet(instanceId); print(result); } catch (e) { print('Exception when calling SectionApi->sectionGet: $e\n'); @@ -179,7 +180,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/SectionDTO.md b/manager_api/doc/SectionDTO.md index 46dec96..e14ebea 100644 --- a/manager_api/doc/SectionDTO.md +++ b/manager_api/doc/SectionDTO.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **data** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **order** | **int** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/TokenDTO.md b/manager_api/doc/TokenDTO.md index e031252..1a5e23f 100644 --- a/manager_api/doc/TokenDTO.md +++ b/manager_api/doc/TokenDTO.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **tokenType** | **String** | | [optional] **expiresIn** | **int** | | [optional] **expiration** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/User.md b/manager_api/doc/User.md index e1f1f90..02a0be1 100644 --- a/manager_api/doc/User.md +++ b/manager_api/doc/User.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **lastName** | **String** | | [optional] **token** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index 5fae69c..cc29d1f 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -30,6 +30,7 @@ part 'auth/http_bearer_auth.dart'; part 'api/authentication_api.dart'; part 'api/configuration_api.dart'; part 'api/device_api.dart'; +part 'api/instance_api.dart'; part 'api/resource_api.dart'; part 'api/section_api.dart'; part 'api/user_api.dart'; @@ -44,6 +45,8 @@ part 'model/export_configuration_dto_all_of.dart'; part 'model/geo_point_dto.dart'; part 'model/image_dto.dart'; part 'model/image_geo_point.dart'; +part 'model/instance.dart'; +part 'model/instance_dto.dart'; part 'model/level_dto.dart'; part 'model/login_dto.dart'; part 'model/map_dto.dart'; diff --git a/manager_api/lib/api/configuration_api.dart b/manager_api/lib/api/configuration_api.dart index 342f0f0..9fe998e 100644 --- a/manager_api/lib/api/configuration_api.dart +++ b/manager_api/lib/api/configuration_api.dart @@ -207,7 +207,12 @@ class ConfigurationApi { } /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. - Future configurationGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future configurationGetWithHttpInfo({ String instanceId }) async { + // Verify required params are set. + final path = r'/api/Configuration'; Object postBody; @@ -216,6 +221,10 @@ class ConfigurationApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId)); + } + final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; @@ -244,8 +253,11 @@ class ConfigurationApi { ); } - Future> configurationGet() async { - final response = await configurationGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future> configurationGet({ String instanceId }) async { + final response = await configurationGetWithHttpInfo( instanceId: instanceId ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api/device_api.dart b/manager_api/lib/api/device_api.dart index 7162ac9..63317d7 100644 --- a/manager_api/lib/api/device_api.dart +++ b/manager_api/lib/api/device_api.dart @@ -143,7 +143,12 @@ class DeviceApi { } /// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. - Future deviceGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future deviceGetWithHttpInfo({ String instanceId }) async { + // Verify required params are set. + final path = r'/api/Device'; Object postBody; @@ -152,6 +157,10 @@ class DeviceApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId)); + } + final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; @@ -180,8 +189,11 @@ class DeviceApi { ); } - Future> deviceGet() async { - final response = await deviceGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future> deviceGet({ String instanceId }) async { + final response = await deviceGetWithHttpInfo( instanceId: instanceId ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api/instance_api.dart b/manager_api/lib/api/instance_api.dart new file mode 100644 index 0000000..8d2c092 --- /dev/null +++ b/manager_api/lib/api/instance_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 InstanceApi { + InstanceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Instance' operation and returns the [Response]. + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceCreateInstanceWithHttpInfo(Instance instance) async { + // Verify required params are set. + if (instance == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: instance'); + } + + final path = r'/api/Instance'; + + Object postBody = instance; + + 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: + /// + /// * [Instance] instance (required): + Future instanceCreateInstance(Instance instance) async { + final response = await instanceCreateInstanceWithHttpInfo(instance); + 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), 'InstanceDTO') as InstanceDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/Instance/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future instanceDeleteInstanceWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Instance/{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 instanceDeleteInstance(String id) async { + final response = await instanceDeleteInstanceWithHttpInfo(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/Instance' operation and returns the [Response]. + Future instanceGetWithHttpInfo() async { + final path = r'/api/Instance'; + + 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> instanceGet() async { + final response = await instanceGetWithHttpInfo(); + 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/Instance/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future instanceGetDetailWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Instance/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future instanceGetDetail(String id) async { + final response = await instanceGetDetailWithHttpInfo(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), 'InstanceDTO') as InstanceDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response]. + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceUpdateinstanceWithHttpInfo(Instance instance) async { + // Verify required params are set. + if (instance == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: instance'); + } + + final path = r'/api/Instance'; + + Object postBody = instance; + + 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: + /// + /// * [Instance] instance (required): + Future instanceUpdateinstance(Instance instance) async { + final response = await instanceUpdateinstanceWithHttpInfo(instance); + 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), 'InstanceDTO') as InstanceDTO; + } + return Future.value(null); + } +} diff --git a/manager_api/lib/api/resource_api.dart b/manager_api/lib/api/resource_api.dart index 6423466..0e975bb 100644 --- a/manager_api/lib/api/resource_api.dart +++ b/manager_api/lib/api/resource_api.dart @@ -143,7 +143,12 @@ class ResourceApi { } /// Performs an HTTP 'GET /api/Resource' operation and returns the [Response]. - Future resourceGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future resourceGetWithHttpInfo({ String instanceId }) async { + // Verify required params are set. + final path = r'/api/Resource'; Object postBody; @@ -152,6 +157,10 @@ class ResourceApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId)); + } + final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; @@ -180,8 +189,11 @@ class ResourceApi { ); } - Future> resourceGet() async { - final response = await resourceGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future> resourceGet({ String instanceId }) async { + final response = await resourceGetWithHttpInfo( instanceId: instanceId ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } @@ -393,7 +405,9 @@ class ResourceApi { /// * [String] label: /// /// * [String] type: - Future resourceUploadWithHttpInfo({ String label, String type }) async { + /// + /// * [String] instanceId: + Future resourceUploadWithHttpInfo({ String label, String type, String instanceId }) async { // Verify required params are set. final path = r'/api/Resource/upload'; @@ -422,6 +436,10 @@ class ResourceApi { hasFields = true; mp.fields[r'type'] = parameterToString(type); } + if (instanceId != null) { + hasFields = true; + mp.fields[r'instanceId'] = parameterToString(instanceId); + } if (hasFields) { postBody = mp; } @@ -432,6 +450,9 @@ class ResourceApi { if (type != null) { formParams[r'type'] = parameterToString(type); } + if (instanceId != null) { + formParams[r'instanceId'] = parameterToString(instanceId); + } } return await apiClient.invokeAPI( @@ -451,8 +472,10 @@ class ResourceApi { /// * [String] label: /// /// * [String] type: - Future resourceUpload({ String label, String type }) async { - final response = await resourceUploadWithHttpInfo( label: label, type: type ); + /// + /// * [String] instanceId: + Future resourceUpload({ String label, String type, String instanceId }) async { + final response = await resourceUploadWithHttpInfo( label: label, type: type, instanceId: instanceId ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api/section_api.dart b/manager_api/lib/api/section_api.dart index ea05942..9a12d13 100644 --- a/manager_api/lib/api/section_api.dart +++ b/manager_api/lib/api/section_api.dart @@ -207,7 +207,12 @@ class SectionApi { } /// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. - Future sectionGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future sectionGetWithHttpInfo({ String instanceId }) async { + // Verify required params are set. + final path = r'/api/Section'; Object postBody; @@ -216,6 +221,10 @@ class SectionApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId)); + } + final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; @@ -244,8 +253,11 @@ class SectionApi { ); } - Future> sectionGet() async { - final response = await sectionGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future> sectionGet({ String instanceId }) async { + final response = await sectionGetWithHttpInfo( instanceId: instanceId ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api_client.dart b/manager_api/lib/api_client.dart index c2fe2db..0f57dda 100644 --- a/manager_api/lib/api_client.dart +++ b/manager_api/lib/api_client.dart @@ -176,6 +176,10 @@ class ApiClient { return ImageDTO.fromJson(value); case 'ImageGeoPoint': return ImageGeoPoint.fromJson(value); + case 'Instance': + return Instance.fromJson(value); + case 'InstanceDTO': + return InstanceDTO.fromJson(value); case 'LevelDTO': return LevelDTO.fromJson(value); case 'LoginDTO': diff --git a/manager_api/lib/model/configuration_dto.dart b/manager_api/lib/model/configuration_dto.dart index 31fe1ee..ea2eb1e 100644 --- a/manager_api/lib/model/configuration_dto.dart +++ b/manager_api/lib/model/configuration_dto.dart @@ -24,6 +24,7 @@ class ConfigurationDTO { this.isMobile, this.isTablet, this.isOffline, + this.instanceId, }); String id; @@ -50,6 +51,8 @@ class ConfigurationDTO { bool isOffline; + String instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && other.id == id && @@ -63,7 +66,8 @@ class ConfigurationDTO { other.dateCreation == dateCreation && other.isMobile == isMobile && other.isTablet == isTablet && - other.isOffline == isOffline; + other.isOffline == isOffline && + other.instanceId == instanceId; @override int get hashCode => @@ -78,10 +82,11 @@ class ConfigurationDTO { (dateCreation == null ? 0 : dateCreation.hashCode) + (isMobile == null ? 0 : isMobile.hashCode) + (isTablet == null ? 0 : isTablet.hashCode) + - (isOffline == null ? 0 : isOffline.hashCode); + (isOffline == null ? 0 : isOffline.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode); @override - String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline]'; + String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -121,6 +126,9 @@ class ConfigurationDTO { if (isOffline != null) { json[r'isOffline'] = isOffline; } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } return json; } @@ -145,6 +153,7 @@ class ConfigurationDTO { isMobile: json[r'isMobile'], isTablet: json[r'isTablet'], isOffline: json[r'isOffline'], + instanceId: json[r'instanceId'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => diff --git a/manager_api/lib/model/device_detail_dto.dart b/manager_api/lib/model/device_detail_dto.dart index f8b686c..a4883a0 100644 --- a/manager_api/lib/model/device_detail_dto.dart +++ b/manager_api/lib/model/device_detail_dto.dart @@ -22,6 +22,7 @@ class DeviceDetailDTO { this.connected, this.dateCreation, this.dateUpdate, + this.instanceId, this.connectionLevel, this.lastConnectionLevel, this.batteryLevel, @@ -48,6 +49,8 @@ class DeviceDetailDTO { DateTime dateUpdate; + String instanceId; + String connectionLevel; DateTime lastConnectionLevel; @@ -68,6 +71,7 @@ class DeviceDetailDTO { other.connected == connected && other.dateCreation == dateCreation && other.dateUpdate == dateUpdate && + other.instanceId == instanceId && other.connectionLevel == connectionLevel && other.lastConnectionLevel == lastConnectionLevel && other.batteryLevel == batteryLevel && @@ -85,13 +89,14 @@ class DeviceDetailDTO { (connected == null ? 0 : connected.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) + (dateUpdate == null ? 0 : dateUpdate.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode) + (connectionLevel == null ? 0 : connectionLevel.hashCode) + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + (batteryLevel == null ? 0 : batteryLevel.hashCode) + (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); @override - String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; Map toJson() { final json = {}; @@ -125,6 +130,9 @@ class DeviceDetailDTO { if (dateUpdate != null) { json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } if (connectionLevel != null) { json[r'connectionLevel'] = connectionLevel; } @@ -159,6 +167,7 @@ class DeviceDetailDTO { dateUpdate: json[r'dateUpdate'] == null ? null : DateTime.parse(json[r'dateUpdate']), + instanceId: json[r'instanceId'], connectionLevel: json[r'connectionLevel'], lastConnectionLevel: json[r'lastConnectionLevel'] == null ? null diff --git a/manager_api/lib/model/device_dto.dart b/manager_api/lib/model/device_dto.dart index 19a5677..e90f033 100644 --- a/manager_api/lib/model/device_dto.dart +++ b/manager_api/lib/model/device_dto.dart @@ -22,6 +22,7 @@ class DeviceDTO { this.connected, this.dateCreation, this.dateUpdate, + this.instanceId, }); String id; @@ -44,6 +45,8 @@ class DeviceDTO { DateTime dateUpdate; + String instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is DeviceDTO && other.id == id && @@ -55,7 +58,8 @@ class DeviceDTO { other.configuration == configuration && other.connected == connected && other.dateCreation == dateCreation && - other.dateUpdate == dateUpdate; + other.dateUpdate == dateUpdate && + other.instanceId == instanceId; @override int get hashCode => @@ -68,10 +72,11 @@ class DeviceDTO { (configuration == null ? 0 : configuration.hashCode) + (connected == null ? 0 : connected.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) + - (dateUpdate == null ? 0 : dateUpdate.hashCode); + (dateUpdate == null ? 0 : dateUpdate.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode); @override - String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate]'; + String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -105,6 +110,9 @@ class DeviceDTO { if (dateUpdate != null) { json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } return json; } @@ -127,6 +135,7 @@ class DeviceDTO { dateUpdate: json[r'dateUpdate'] == null ? null : DateTime.parse(json[r'dateUpdate']), + instanceId: json[r'instanceId'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => diff --git a/manager_api/lib/model/export_configuration_dto.dart b/manager_api/lib/model/export_configuration_dto.dart index b892853..226e864 100644 --- a/manager_api/lib/model/export_configuration_dto.dart +++ b/manager_api/lib/model/export_configuration_dto.dart @@ -24,6 +24,7 @@ class ExportConfigurationDTO { this.isMobile, this.isTablet, this.isOffline, + this.instanceId, this.sections, this.resources, }); @@ -52,6 +53,8 @@ class ExportConfigurationDTO { bool isOffline; + String instanceId; + List sections; List resources; @@ -70,6 +73,7 @@ class ExportConfigurationDTO { other.isMobile == isMobile && other.isTablet == isTablet && other.isOffline == isOffline && + other.instanceId == instanceId && other.sections == sections && other.resources == resources; @@ -87,11 +91,12 @@ class ExportConfigurationDTO { (isMobile == null ? 0 : isMobile.hashCode) + (isTablet == null ? 0 : isTablet.hashCode) + (isOffline == null ? 0 : isOffline.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode) + (sections == null ? 0 : sections.hashCode) + (resources == null ? 0 : resources.hashCode); @override - String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, sections=$sections, resources=$resources]'; + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sections=$sections, resources=$resources]'; Map toJson() { final json = {}; @@ -131,6 +136,9 @@ class ExportConfigurationDTO { if (isOffline != null) { json[r'isOffline'] = isOffline; } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } if (sections != null) { json[r'sections'] = sections; } @@ -161,6 +169,7 @@ class ExportConfigurationDTO { isMobile: json[r'isMobile'], isTablet: json[r'isTablet'], isOffline: json[r'isOffline'], + instanceId: json[r'instanceId'], sections: SectionDTO.listFromJson(json[r'sections']), resources: ResourceDTO.listFromJson(json[r'resources']), ); diff --git a/manager_api/lib/model/instance.dart b/manager_api/lib/model/instance.dart new file mode 100644 index 0000000..b398ea8 --- /dev/null +++ b/manager_api/lib/model/instance.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Instance { + /// Returns a new [Instance] instance. + Instance({ + this.id, + this.name, + this.dateCreation, + }); + + String id; + + String name; + + DateTime dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is Instance && + other.id == id && + other.name == name && + other.dateCreation == dateCreation; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode); + + @override + String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [Instance] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Instance fromJson(Map json) => json == null + ? null + : Instance( + id: json[r'id'], + name: json[r'name'], + 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) => Instance.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] = Instance.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Instance-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] = Instance.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/instance_dto.dart b/manager_api/lib/model/instance_dto.dart new file mode 100644 index 0000000..d39a6f3 --- /dev/null +++ b/manager_api/lib/model/instance_dto.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class InstanceDTO { + /// Returns a new [InstanceDTO] instance. + InstanceDTO({ + this.id, + this.name, + this.dateCreation, + }); + + String id; + + String name; + + DateTime dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is InstanceDTO && + other.id == id && + other.name == name && + other.dateCreation == dateCreation; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode); + + @override + String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [InstanceDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static InstanceDTO fromJson(Map json) => json == null + ? null + : InstanceDTO( + id: json[r'id'], + name: json[r'name'], + 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) => InstanceDTO.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] = InstanceDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of InstanceDTO-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] = InstanceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/resource_dto.dart b/manager_api/lib/model/resource_dto.dart index 81f6382..8907d2f 100644 --- a/manager_api/lib/model/resource_dto.dart +++ b/manager_api/lib/model/resource_dto.dart @@ -17,6 +17,7 @@ class ResourceDTO { this.label, this.dateCreation, this.data, + this.instanceId, }); String id; @@ -29,13 +30,16 @@ class ResourceDTO { String data; + String instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is ResourceDTO && other.id == id && other.type == type && other.label == label && other.dateCreation == dateCreation && - other.data == data; + other.data == data && + other.instanceId == instanceId; @override int get hashCode => @@ -43,10 +47,11 @@ class ResourceDTO { (type == null ? 0 : type.hashCode) + (label == null ? 0 : label.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) + - (data == null ? 0 : data.hashCode); + (data == null ? 0 : data.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode); @override - String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data]'; + String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -65,6 +70,9 @@ class ResourceDTO { if (data != null) { json[r'data'] = data; } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } return json; } @@ -80,6 +88,7 @@ class ResourceDTO { ? null : DateTime.parse(json[r'dateCreation']), data: json[r'data'], + instanceId: json[r'instanceId'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => diff --git a/manager_api/lib/model/section_dto.dart b/manager_api/lib/model/section_dto.dart index 7d29c5e..882db87 100644 --- a/manager_api/lib/model/section_dto.dart +++ b/manager_api/lib/model/section_dto.dart @@ -25,6 +25,7 @@ class SectionDTO { this.data, this.dateCreation, this.order, + this.instanceId, }); String id; @@ -53,6 +54,8 @@ class SectionDTO { int order; + String instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is SectionDTO && other.id == id && @@ -67,7 +70,8 @@ class SectionDTO { other.type == type && other.data == data && other.dateCreation == dateCreation && - other.order == order; + other.order == order && + other.instanceId == instanceId; @override int get hashCode => @@ -83,10 +87,11 @@ class SectionDTO { (type == null ? 0 : type.hashCode) + (data == null ? 0 : data.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) + - (order == null ? 0 : order.hashCode); + (order == null ? 0 : order.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode); @override - String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order]'; + String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -129,6 +134,9 @@ class SectionDTO { if (order != null) { json[r'order'] = order; } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } return json; } @@ -152,6 +160,7 @@ class SectionDTO { ? null : DateTime.parse(json[r'dateCreation']), order: json[r'order'], + instanceId: json[r'instanceId'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => diff --git a/manager_api/lib/model/token_dto.dart b/manager_api/lib/model/token_dto.dart index 5ef4e57..dc7b798 100644 --- a/manager_api/lib/model/token_dto.dart +++ b/manager_api/lib/model/token_dto.dart @@ -18,6 +18,7 @@ class TokenDTO { this.tokenType, this.expiresIn, this.expiration, + this.instanceId, }); String accessToken; @@ -32,6 +33,8 @@ class TokenDTO { DateTime expiration; + String instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is TokenDTO && other.accessToken == accessToken && @@ -39,7 +42,8 @@ class TokenDTO { other.scope == scope && other.tokenType == tokenType && other.expiresIn == expiresIn && - other.expiration == expiration; + other.expiration == expiration && + other.instanceId == instanceId; @override int get hashCode => @@ -48,10 +52,11 @@ class TokenDTO { (scope == null ? 0 : scope.hashCode) + (tokenType == null ? 0 : tokenType.hashCode) + (expiresIn == null ? 0 : expiresIn.hashCode) + - (expiration == null ? 0 : expiration.hashCode); + (expiration == null ? 0 : expiration.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode); @override - String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration]'; + String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -73,6 +78,9 @@ class TokenDTO { if (expiration != null) { json[r'expiration'] = expiration.toUtc().toIso8601String(); } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } return json; } @@ -89,6 +97,7 @@ class TokenDTO { expiration: json[r'expiration'] == null ? null : DateTime.parse(json[r'expiration']), + instanceId: json[r'instanceId'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => diff --git a/manager_api/lib/model/user.dart b/manager_api/lib/model/user.dart index 58d6440..a5918f3 100644 --- a/manager_api/lib/model/user.dart +++ b/manager_api/lib/model/user.dart @@ -19,6 +19,7 @@ class User { this.lastName, this.token, this.dateCreation, + this.instanceId, }); String id; @@ -35,6 +36,8 @@ class User { DateTime dateCreation; + String instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is User && other.id == id && @@ -43,7 +46,8 @@ class User { other.firstName == firstName && other.lastName == lastName && other.token == token && - other.dateCreation == dateCreation; + other.dateCreation == dateCreation && + other.instanceId == instanceId; @override int get hashCode => @@ -53,10 +57,11 @@ class User { (firstName == null ? 0 : firstName.hashCode) + (lastName == null ? 0 : lastName.hashCode) + (token == null ? 0 : token.hashCode) + - (dateCreation == null ? 0 : dateCreation.hashCode); + (dateCreation == null ? 0 : dateCreation.hashCode) + + (instanceId == null ? 0 : instanceId.hashCode); @override - String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation]'; + String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -81,6 +86,9 @@ class User { if (dateCreation != null) { json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); } + if (instanceId != null) { + json[r'instanceId'] = instanceId; + } return json; } @@ -98,6 +106,7 @@ class User { dateCreation: json[r'dateCreation'] == null ? null : DateTime.parse(json[r'dateCreation']), + instanceId: json[r'instanceId'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => diff --git a/manager_api/swagger.yaml b/manager_api/swagger.yaml new file mode 100644 index 0000000..d126a0d --- /dev/null +++ b/manager_api/swagger.yaml @@ -0,0 +1,2212 @@ +x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) +openapi: 3.0.0 +info: + title: Manager Service + description: API Manager Service + version: Version Alpha +servers: + - url: http://localhost:5000 +paths: + /api/Configuration: + get: + tags: + - Configuration + operationId: Configuration_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + post: + tags: + - Configuration + operationId: Configuration_Create + requestBody: + x-name: newConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Configuration + operationId: Configuration_Update + requestBody: + x-name: updatedConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}: + get: + tags: + - Configuration + operationId: Configuration_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Configuration + operationId: Configuration_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}/export: + get: + tags: + - Configuration + operationId: Configuration_Export + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Configuration/import: + post: + tags: + - Configuration + operationId: Configuration_Import + requestBody: + x-name: exportConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ExportConfigurationDTO' + required: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device: + get: + tags: + - Device + operationId: Device_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Device + operationId: Device_Create + requestBody: + x-name: newDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - Device + operationId: Device_Update + requestBody: + x-name: updatedDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}/detail: + get: + tags: + - Device + operationId: Device_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Device/mainInfos: + put: + tags: + - Device + operationId: Device_UpdateMainInfos + requestBody: + x-name: deviceIn + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}: + delete: + tags: + - Device + operationId: Device_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Instance: + get: + tags: + - Instance + operationId: Instance_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Instance' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Instance + operationId: Instance_CreateInstance + requestBody: + x-name: newInstance + content: + application/json: + schema: + $ref: '#/components/schemas/Instance' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Instance + operationId: Instance_Updateinstance + requestBody: + x-name: updatedInstance + content: + application/json: + schema: + $ref: '#/components/schemas/Instance' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Instance/{id}: + get: + tags: + - Instance + operationId: Instance_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - Instance + operationId: Instance_DeleteInstance + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource: + get: + tags: + - Resource + operationId: Resource_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Resource + operationId: Resource_Create + requestBody: + x-name: newResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Resource + operationId: Resource_Update + requestBody: + x-name: updatedResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/{id}/detail: + get: + tags: + - Resource + operationId: Resource_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Resource/{id}: + get: + tags: + - Resource + operationId: Resource_Show + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Resource + operationId: Resource_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/upload: + post: + tags: + - Resource + operationId: Resource_Upload + requestBody: + content: + multipart/form-data: + schema: + properties: + label: + type: string + nullable: true + type: + type: string + nullable: true + instanceId: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section: + get: + tags: + - Section + operationId: Section_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Section + operationId: Section_Create + requestBody: + x-name: newSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Section + operationId: Section_Update + requestBody: + x-name: updatedSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/configuration/{id}: + get: + tags: + - Section + operationId: Section_GetFromConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_DeleteAllForConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}/subsections: + get: + tags: + - Section + operationId: Section_GetAllSectionSubSections + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: {} + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}: + get: + tags: + - Section + operationId: Section_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/order: + put: + tags: + - Section + operationId: Section_UpdateOrder + requestBody: + x-name: updatedSectionsOrder + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/MapDTO: + get: + tags: + - Section + operationId: Section_GetMapDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MapDTO' + security: + - bearer: [] + /api/Section/SliderDTO: + get: + tags: + - Section + operationId: Section_GetSliderDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SliderDTO' + security: + - bearer: [] + /api/Section/VideoDTO: + get: + tags: + - Section + operationId: Section_GetVideoDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoDTO' + security: + - bearer: [] + /api/Section/WebDTO: + get: + tags: + - Section + operationId: Section_GetWebDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/WebDTO' + security: + - bearer: [] + /api/Section/MenuDTO: + get: + tags: + - Section + operationId: Section_GetMenuDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MenuDTO' + security: + - bearer: [] + /api/Section/PlayerMessageDTO: + get: + tags: + - Section + operationId: Section_PlayerMessageDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PlayerMessageDTO' + security: + - bearer: [] + /api/Section/QuizzDTO: + get: + tags: + - Section + operationId: Section_GetQuizzDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QuizzDTO' + security: + - bearer: [] + /api/Section/ArticleDTO: + get: + tags: + - Section + operationId: Section_GetArticleDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ArticleDTO' + security: + - bearer: [] + /api/User: + get: + tags: + - User + operationId: User_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - User + operationId: User_CreateUser + requestBody: + x-name: newUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - User + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/User/{id}: + get: + tags: + - User + operationId: User_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - User + operationId: User_DeleteUser + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Authentication/Token: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithForm + requestBody: + content: + multipart/form-data: + schema: + properties: + grant_type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + client_id: + type: string + nullable: true + client_secret: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Authentication/Authenticate: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string +components: + schemas: + ConfigurationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + primaryColor: + type: string + nullable: true + secondaryColor: + type: string + nullable: true + languages: + type: array + nullable: true + items: + type: string + dateCreation: + type: string + format: date-time + isMobile: + type: boolean + isTablet: + type: boolean + isOffline: + type: boolean + instanceId: + type: string + nullable: true + TranslationDTO: + type: object + additionalProperties: false + properties: + language: + type: string + nullable: true + value: + type: string + nullable: true + ExportConfigurationDTO: + allOf: + - $ref: '#/components/schemas/ConfigurationDTO' + - type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + resources: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResourceDTO' + SectionDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + configurationId: + type: string + nullable: true + isSubSection: + type: boolean + parentId: + type: string + nullable: true + type: + $ref: '#/components/schemas/SectionType' + data: + type: string + nullable: true + dateCreation: + type: string + format: date-time + order: + type: integer + format: int32 + instanceId: + type: string + nullable: true + SectionType: + type: integer + description: |- + 0 = Map + 1 = Slider + 2 = Video + 3 = Web + 4 = Menu + 5 = Quizz + 6 = Article + x-enumNames: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + - Article + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + ResourceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + $ref: '#/components/schemas/ResourceType' + label: + type: string + nullable: true + dateCreation: + type: string + format: date-time + data: + type: string + nullable: true + instanceId: + type: string + nullable: true + ResourceType: + type: integer + description: |- + 0 = Image + 1 = Video + 2 = ImageUrl + 3 = VideoUrl + x-enumNames: + - Image + - Video + - ImageUrl + - VideoUrl + enum: + - 0 + - 1 + - 2 + - 3 + DeviceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + identifier: + type: string + nullable: true + name: + type: string + nullable: true + ipAddressWLAN: + type: string + nullable: true + ipAddressETH: + type: string + nullable: true + configurationId: + type: string + nullable: true + configuration: + type: string + nullable: true + connected: + type: boolean + dateCreation: + type: string + format: date-time + dateUpdate: + type: string + format: date-time + instanceId: + type: string + nullable: true + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceDTO' + - type: object + additionalProperties: false + properties: + connectionLevel: + type: string + nullable: true + lastConnectionLevel: + type: string + format: date-time + batteryLevel: + type: string + nullable: true + lastBatteryLevel: + type: string + format: date-time + Instance: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + dateCreation: + type: string + format: date-time + InstanceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + dateCreation: + type: string + format: date-time + MapDTO: + type: object + additionalProperties: false + properties: + zoom: + type: integer + format: int32 + mapType: + $ref: '#/components/schemas/MapTypeApp' + points: + type: array + nullable: true + items: + $ref: '#/components/schemas/GeoPointDTO' + iconResourceId: + type: string + nullable: true + iconSource: + type: string + nullable: true + MapTypeApp: + type: integer + description: |- + 0 = none + 1 = normal + 2 = satellite + 3 = terrain + 4 = hybrid + x-enumNames: + - none + - normal + - satellite + - terrain + - hybrid + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + GeoPointDTO: + type: object + additionalProperties: false + properties: + id: + type: integer + format: int32 + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageGeoPoint' + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + ImageGeoPoint: + type: object + additionalProperties: false + properties: + imageResourceId: + type: string + nullable: true + imageSource: + type: string + nullable: true + SliderDTO: + type: object + additionalProperties: false + properties: + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + ImageDTO: + type: object + additionalProperties: false + properties: + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + VideoDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + WebDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + MenuDTO: + type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + PlayerMessageDTO: + type: object + additionalProperties: false + properties: + configChanged: + type: boolean + isDeleted: + type: boolean + QuizzDTO: + type: object + additionalProperties: false + properties: + questions: + type: array + nullable: true + items: + $ref: '#/components/schemas/QuestionDTO' + bad_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + medium_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + good_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + great_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + QuestionDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + responses: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResponseDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + ResponseDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isGood: + type: boolean + order: + type: integer + format: int32 + LevelDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + ArticleDTO: + type: object + additionalProperties: false + properties: + content: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + qrCode: + type: string + nullable: true + isContentTop: + type: boolean + audioId: + type: string + nullable: true + isReadAudioAuto: + type: boolean + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + password: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + token: + type: string + nullable: true + dateCreation: + type: string + format: date-time + instanceId: + type: string + nullable: true + UserDetailDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + TokenDTO: + type: object + additionalProperties: false + properties: + access_token: + type: string + nullable: true + refresh_token: + type: string + nullable: true + scope: + type: string + nullable: true + token_type: + type: string + nullable: true + expires_in: + type: integer + format: int32 + expiration: + type: string + format: date-time + instanceId: + type: string + nullable: true + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: Manager Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + Manager-api: Manager WebAPI +security: + - bearer: [] +tags: + - name: Configuration + description: Configuration management + - name: Device + description: Device management + - name: Instance + description: Instance management + - name: Resource + description: Resource management + - name: Section + description: Section management + - name: User + description: User management + - name: Authentication + description: Authentication management diff --git a/manager_api/test/instance_api_test.dart b/manager_api/test/instance_api_test.dart new file mode 100644 index 0000000..ccd4e96 --- /dev/null +++ b/manager_api/test/instance_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 InstanceApi +void main() { + final instance = InstanceApi(); + + group('tests for InstanceApi', () { + //Future instanceCreateInstance(Instance instance) async + test('test instanceCreateInstance', () async { + // TODO + }); + + //Future instanceDeleteInstance(String id) async + test('test instanceDeleteInstance', () async { + // TODO + }); + + //Future> instanceGet() async + test('test instanceGet', () async { + // TODO + }); + + //Future instanceGetDetail(String id) async + test('test instanceGetDetail', () async { + // TODO + }); + + //Future instanceUpdateinstance(Instance instance) async + test('test instanceUpdateinstance', () async { + // TODO + }); + + }); +} diff --git a/manager_api/test/instance_dto_test.dart b/manager_api/test/instance_dto_test.dart new file mode 100644 index 0000000..0778f21 --- /dev/null +++ b/manager_api/test/instance_dto_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for InstanceDTO +void main() { + final instance = InstanceDTO(); + + group('test InstanceDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/instance_test.dart b/manager_api/test/instance_test.dart new file mode 100644 index 0000000..d27e00b --- /dev/null +++ b/manager_api/test/instance_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Instance +void main() { + final instance = Instance(); + + group('test Instance', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +}