Add instance generation service + dto + not show title and description for article

This commit is contained in:
Fransolet Thomas 2022-10-06 17:06:08 +02:00
parent b6dd44cf9f
commit 24ab7796e2
50 changed files with 3377 additions and 89 deletions

View File

@ -5,6 +5,7 @@ import 'package:managerapi/api.dart';
class ManagerAppContext with ChangeNotifier{ class ManagerAppContext with ChangeNotifier{
String email; String email;
String instanceId;
TokenDTO token; TokenDTO token;
Client clientAPI; Client clientAPI;
String currentRoute; String currentRoute;

View File

@ -163,7 +163,7 @@ class _ArticleConfigState extends State<ArticleConfig> {
right: 15, right: 15,
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
var result = await showNewOrUpdateImageSlider(null, appContext, context); var result = await showNewOrUpdateImageSlider(null, appContext, context, false, false);
if (result != null) if (result != null)
{ {
setState(() { setState(() {

View File

@ -77,7 +77,9 @@ class _ListViewCard extends State<ListViewCardImage> {
var result = await showNewOrUpdateImageSlider( var result = await showNewOrUpdateImageSlider(
widget.listItems[widget.index], widget.listItems[widget.index],
widget.appContext, widget.appContext,
context context,
true,
true
); );
if (result != null) { if (result != null) {

View File

@ -8,7 +8,7 @@ import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext appContext, BuildContext context) async { Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async {
ImageDTO imageDTO = new ImageDTO(); ImageDTO imageDTO = new ImageDTO();
if (inputImageDTO != null) { if (inputImageDTO != null) {
@ -61,14 +61,15 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext a
isSmall: true isSmall: true
), ),
), ),
Container( if(showTitle || showDescription)
height: size.height * 0.33, Container(
width: double.infinity, height: size.height * 0.33,
child: ListView( width: double.infinity,
scrollDirection: Axis.horizontal, child: ListView(
children: getTranslations(dialogContext, appContext, imageDTO), scrollDirection: Axis.horizontal,
children: getTranslations(dialogContext, appContext, imageDTO, showTitle, showDescription),
),
), ),
),
], ],
), ),
], ],
@ -123,7 +124,7 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext a
return result; return result;
} }
getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO) { getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO, bool showTitle, bool showDescription) {
List<Widget> translations = <Widget>[]; List<Widget> translations = <Widget>[];
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
for(var language in managerAppContext.selectedConfiguration.languages) { for(var language in managerAppContext.selectedConfiguration.languages) {
@ -151,24 +152,26 @@ getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO)
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
TextFormInputContainer( if(showTitle)
label: "Titre:", TextFormInputContainer(
color: kWhite, label: "Titre:",
isTitle: true, color: kWhite,
initialValue: imageDTO.title.where((element) => element.language == language).first.value, isTitle: true,
onChanged: (value) { initialValue: imageDTO.title.where((element) => element.language == language).first.value,
imageDTO.title.where((element) => element.language == language).first.value = value; onChanged: (value) {
}, imageDTO.title.where((element) => element.language == language).first.value = value;
), },
TextFormInputContainer( ),
label: "Description:", if(showDescription)
color: kWhite, TextFormInputContainer(
isTitle: false, label: "Description:",
initialValue: imageDTO.description.where((element) => element.language == language).first.value, color: kWhite,
onChanged: (value) { isTitle: false,
imageDTO.description.where((element) => element.language == language).first.value = value; initialValue: imageDTO.description.where((element) => element.language == language).first.value,
}, onChanged: (value) {
), imageDTO.description.where((element) => element.language == language).first.value = value;
},
),
], ],
), ),
), ),

View File

@ -100,7 +100,7 @@ class _SliderConfigState extends State<SliderConfig> {
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
var result = await showNewOrUpdateImageSlider(null, appContext, context); var result = await showNewOrUpdateImageSlider(null, appContext, context, true, true);
if (result != null) if (result != null)
{ {
setState(() { setState(() {

View File

@ -127,7 +127,7 @@ String filePicker() {
void create(ConfigurationDTO configurationDTO, AppContext appContext, context) async { void create(ConfigurationDTO configurationDTO, AppContext appContext, context) async {
if (configurationDTO.label != null) { if (configurationDTO.label != null) {
configurationDTO.instanceId = (appContext.getContext() as ManagerAppContext).instanceId;
await appContext.getContext().clientAPI.configurationApi.configurationCreate(configurationDTO); await appContext.getContext().clientAPI.configurationApi.configurationCreate(configurationDTO);
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.selectedConfiguration = null; managerAppContext.selectedConfiguration = null;

View File

@ -94,6 +94,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
void create(SectionDTO sectionDTO, AppContext appContext, BuildContext context, bool isSubSection, Function sendSubSection) async { void create(SectionDTO sectionDTO, AppContext appContext, BuildContext context, bool isSubSection, Function sendSubSection) async {
if (sectionDTO.label != null) { if (sectionDTO.label != null) {
sectionDTO.instanceId = (appContext.getContext() as ManagerAppContext).instanceId;
SectionDTO newSection = await appContext.getContext().clientAPI.sectionApi.sectionCreate(sectionDTO); SectionDTO newSection = await appContext.getContext().clientAPI.sectionApi.sectionCreate(sectionDTO);
if (!isSubSection) { if (!isSubSection) {

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart';
import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
@ -143,8 +145,8 @@ getConfigurationsElement(DeviceDTO inputDevice, data, Function onGetResult) {
return widgets; return widgets;
} }
Future<List<ConfigurationDTO>> getConfigurations(dynamic appContext) async { Future<List<ConfigurationDTO>> getConfigurations(AppContext appContext) async {
List<ConfigurationDTO> configurations = await appContext.getContext().clientAPI.configurationApi.configurationGet(); List<ConfigurationDTO> configurations = await (appContext.getContext() as ManagerAppContext).clientAPI.configurationApi.configurationGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId);
//print("number of configurations " + configurations.length.toString()); //print("number of configurations " + configurations.length.toString());
configurations.forEach((element) { configurations.forEach((element) {
//print(element); //print(element);

View File

@ -222,8 +222,8 @@ boxDecoration() {
); );
} }
Future<List<DeviceDTO>> getDevices(dynamic appContext) async { Future<List<DeviceDTO>> getDevices(AppContext appContext) async {
List<DeviceDTO> devices = await appContext.getContext().clientAPI.deviceApi.deviceGet(); List<DeviceDTO> devices = await (appContext.getContext() as ManagerAppContext).clientAPI.deviceApi.deviceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId);
//print("number of devices " + devices.length.toString()); //print("number of devices " + devices.length.toString());
devices.forEach((element) { devices.forEach((element) {
//print(element); //print(element);

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:manager_app/Components/fetch_resource_icon.dart'; import 'package:manager_app/Components/fetch_resource_icon.dart';
import 'package:manager_app/Components/multi_select_container.dart'; import 'package:manager_app/Components/multi_select_container.dart';
import 'package:manager_app/Components/string_input_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/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
@ -233,8 +234,8 @@ boxDecoration(dynamic resourceDetailDTO, appContext) {
} }
Future<List<ResourceDTO>> getResources(Function onGetResult, bool isImage, dynamic appContext) async { Future<List<ResourceDTO>> getResources(Function onGetResult, bool isImage, AppContext appContext) async {
List<ResourceDTO> resources = await appContext.getContext().clientAPI.resourceApi.resourceGet(); List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId:(appContext.getContext() as ManagerAppContext).instanceId);
if (onGetResult != null && isImage) { if (onGetResult != null && isImage) {
resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList(); resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList();
} }

View File

@ -77,8 +77,8 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
} }
} }
Future<void> getResources(Function onGetResult, bool isImage, dynamic appContext) async { Future<void> getResources(Function onGetResult, bool isImage, AppContext appContext) async {
List<ResourceDTO> resources = await appContext.getContext().clientAPI.resourceApi.resourceGet(); List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId);
if (onGetResult != null && isImage) { if (onGetResult != null && isImage) {
resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList(); resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList();
} }
@ -119,6 +119,7 @@ Future<ResourceDTO> create(ResourceDTO resourceDTO, List<File> files, List<Platf
request.headers["authorization"]="Bearer ${managerAppContext.token.accessToken}"; request.headers["authorization"]="Bearer ${managerAppContext.token.accessToken}";
request.fields['label'] = resourceDTO.label; request.fields['label'] = resourceDTO.label;
request.fields['type'] = ResourceType.image.toString(); request.fields['type'] = ResourceType.image.toString();
request.fields['instanceId'] = managerAppContext.instanceId;
var res = await request.send(); var res = await request.send();
await res.stream.bytesToString(); await res.stream.bytesToString();

View File

@ -70,6 +70,7 @@ class _LoginScreenState extends State<LoginScreen> {
// store user info locally // store user info locally
managerAppContext.email = email; managerAppContext.email = email;
managerAppContext.instanceId = token.instanceId;
managerAppContext.token = token; managerAppContext.token = token;
managerAppContext.clientAPI = clientAPI; managerAppContext.clientAPI = clientAPI;
//print(managerAppContext); //print(managerAppContext);
@ -113,7 +114,7 @@ class _LoginScreenState extends State<LoginScreen> {
@override @override
void initState() { void initState() {
this.isRememberMe = widget.session.rememberMe; 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.email = "test@email.be"; //widget.session.email;
//this.password = "kljqsdkljqsd"; //widget.session.password; //this.password = "kljqsdkljqsd"; //widget.session.password;
super.initState(); super.initState();

View File

@ -14,6 +14,9 @@ doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md doc/GeoPointDTO.md
doc/ImageDTO.md doc/ImageDTO.md
doc/ImageGeoPoint.md doc/ImageGeoPoint.md
doc/Instance.md
doc/InstanceApi.md
doc/InstanceDTO.md
doc/LevelDTO.md doc/LevelDTO.md
doc/LoginDTO.md doc/LoginDTO.md
doc/MapDTO.md doc/MapDTO.md
@ -42,6 +45,7 @@ lib/api.dart
lib/api/authentication_api.dart lib/api/authentication_api.dart
lib/api/configuration_api.dart lib/api/configuration_api.dart
lib/api/device_api.dart lib/api/device_api.dart
lib/api/instance_api.dart
lib/api/resource_api.dart lib/api/resource_api.dart
lib/api/section_api.dart lib/api/section_api.dart
lib/api/user_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/geo_point_dto.dart
lib/model/image_dto.dart lib/model/image_dto.dart
lib/model/image_geo_point.dart lib/model/image_geo_point.dart
lib/model/instance.dart
lib/model/instance_dto.dart
lib/model/level_dto.dart lib/model/level_dto.dart
lib/model/login_dto.dart lib/model/login_dto.dart
lib/model/map_dto.dart lib/model/map_dto.dart

View File

@ -79,6 +79,11 @@ Class | Method | HTTP request | Description
*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | *DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail |
*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | *DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device |
*DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | *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* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource |
*ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | *ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} |
*ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource | *ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource |
@ -122,6 +127,8 @@ Class | Method | HTTP request | Description
- [GeoPointDTO](doc\/GeoPointDTO.md) - [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md) - [ImageDTO](doc\/ImageDTO.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [Instance](doc\/Instance.md)
- [InstanceDTO](doc\/InstanceDTO.md)
- [LevelDTO](doc\/LevelDTO.md) - [LevelDTO](doc\/LevelDTO.md)
- [LoginDTO](doc\/LoginDTO.md) - [LoginDTO](doc\/LoginDTO.md)
- [MapDTO](doc\/MapDTO.md) - [MapDTO](doc\/MapDTO.md)

View File

@ -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) [[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** # **configurationGet**
> List<ConfigurationDTO> configurationGet() > List<ConfigurationDTO> configurationGet(instanceId)
@ -159,9 +159,10 @@ import 'package:managerapi/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.configurationGet(); final result = api_instance.configurationGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ConfigurationApi->configurationGet: $e\n'); print('Exception when calling ConfigurationApi->configurationGet: $e\n');
@ -169,7 +170,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### Return type

View File

@ -20,6 +20,7 @@ Name | Type | Description | Notes
**isMobile** | **bool** | | [optional] **isMobile** | **bool** | | [optional]
**isTablet** | **bool** | | [optional] **isTablet** | **bool** | | [optional]
**isOffline** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -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) [[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** # **deviceGet**
> List<DeviceDTO> deviceGet() > List<DeviceDTO> deviceGet(instanceId)
@ -115,9 +115,10 @@ import 'package:managerapi/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.deviceGet(); final result = api_instance.deviceGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling DeviceApi->deviceGet: $e\n'); print('Exception when calling DeviceApi->deviceGet: $e\n');
@ -125,7 +126,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### Return type

View File

@ -18,6 +18,7 @@ Name | Type | Description | Notes
**connected** | **bool** | | [optional] **connected** | **bool** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**dateUpdate** | [**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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -18,6 +18,7 @@ Name | Type | Description | Notes
**connected** | **bool** | | [optional] **connected** | **bool** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**dateUpdate** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
**connectionLevel** | **String** | | [optional] **connectionLevel** | **String** | | [optional]
**lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] **lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional]
**batteryLevel** | **String** | | [optional] **batteryLevel** | **String** | | [optional]

View File

@ -20,6 +20,7 @@ Name | Type | Description | Notes
**isMobile** | **bool** | | [optional] **isMobile** | **bool** | | [optional]
**isTablet** | **bool** | | [optional] **isTablet** | **bool** | | [optional]
**isOffline** | **bool** | | [optional] **isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []] **sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []] **resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

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

View File

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

View File

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

View File

@ -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) [[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** # **resourceGet**
> List<ResourceDTO> resourceGet() > List<ResourceDTO> resourceGet(instanceId)
@ -116,9 +116,10 @@ import 'package:managerapi/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.resourceGet(); final result = api_instance.resourceGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ResourceApi->resourceGet: $e\n'); print('Exception when calling ResourceApi->resourceGet: $e\n');
@ -126,7 +127,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### 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) [[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** # **resourceUpload**
> String resourceUpload(label, type) > String resourceUpload(label, type, instanceId)
@ -286,9 +290,10 @@ import 'package:managerapi/api.dart';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final label = label_example; // String | final label = label_example; // String |
final type = type_example; // String | final type = type_example; // String |
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.resourceUpload(label, type); final result = api_instance.resourceUpload(label, type, instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ResourceApi->resourceUpload: $e\n'); print('Exception when calling ResourceApi->resourceUpload: $e\n');
@ -301,6 +306,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**label** | **String**| | [optional] **label** | **String**| | [optional]
**type** | **String**| | [optional] **type** | **String**| | [optional]
**instanceId** | **String**| | [optional]
### Return type ### Return type

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**label** | **String** | | [optional] **label** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**data** | **String** | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -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) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGet** # **sectionGet**
> List<SectionDTO> sectionGet() > List<SectionDTO> sectionGet(instanceId)
@ -169,9 +169,10 @@ import 'package:managerapi/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.sectionGet(); final result = api_instance.sectionGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling SectionApi->sectionGet: $e\n'); print('Exception when calling SectionApi->sectionGet: $e\n');
@ -179,7 +180,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### Return type

View File

@ -21,6 +21,7 @@ Name | Type | Description | Notes
**data** | **String** | | [optional] **data** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**order** | **int** | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -14,6 +14,7 @@ Name | Type | Description | Notes
**tokenType** | **String** | | [optional] **tokenType** | **String** | | [optional]
**expiresIn** | **int** | | [optional] **expiresIn** | **int** | | [optional]
**expiration** | [**DateTime**](DateTime.md) | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -15,6 +15,7 @@ Name | Type | Description | Notes
**lastName** | **String** | | [optional] **lastName** | **String** | | [optional]
**token** | **String** | | [optional] **token** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -30,6 +30,7 @@ part 'auth/http_bearer_auth.dart';
part 'api/authentication_api.dart'; part 'api/authentication_api.dart';
part 'api/configuration_api.dart'; part 'api/configuration_api.dart';
part 'api/device_api.dart'; part 'api/device_api.dart';
part 'api/instance_api.dart';
part 'api/resource_api.dart'; part 'api/resource_api.dart';
part 'api/section_api.dart'; part 'api/section_api.dart';
part 'api/user_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/geo_point_dto.dart';
part 'model/image_dto.dart'; part 'model/image_dto.dart';
part 'model/image_geo_point.dart'; part 'model/image_geo_point.dart';
part 'model/instance.dart';
part 'model/instance_dto.dart';
part 'model/level_dto.dart'; part 'model/level_dto.dart';
part 'model/login_dto.dart'; part 'model/login_dto.dart';
part 'model/map_dto.dart'; part 'model/map_dto.dart';

View File

@ -207,7 +207,12 @@ class ConfigurationApi {
} }
/// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response].
Future<Response> configurationGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
Future<Response> configurationGetWithHttpInfo({ String instanceId }) async {
// Verify required params are set.
final path = r'/api/Configuration'; final path = r'/api/Configuration';
Object postBody; Object postBody;
@ -216,6 +221,10 @@ class ConfigurationApi {
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
final contentTypes = <String>[]; final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer']; final authNames = <String>['bearer'];
@ -244,8 +253,11 @@ class ConfigurationApi {
); );
} }
Future<List<ConfigurationDTO>> configurationGet() async { /// Parameters:
final response = await configurationGetWithHttpInfo(); ///
/// * [String] instanceId:
Future<List<ConfigurationDTO>> configurationGet({ String instanceId }) async {
final response = await configurationGetWithHttpInfo( instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }

View File

@ -143,7 +143,12 @@ class DeviceApi {
} }
/// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Device' operation and returns the [Response].
Future<Response> deviceGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
Future<Response> deviceGetWithHttpInfo({ String instanceId }) async {
// Verify required params are set.
final path = r'/api/Device'; final path = r'/api/Device';
Object postBody; Object postBody;
@ -152,6 +157,10 @@ class DeviceApi {
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
final contentTypes = <String>[]; final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer']; final authNames = <String>['bearer'];
@ -180,8 +189,11 @@ class DeviceApi {
); );
} }
Future<List<DeviceDTO>> deviceGet() async { /// Parameters:
final response = await deviceGetWithHttpInfo(); ///
/// * [String] instanceId:
Future<List<DeviceDTO>> deviceGet({ String instanceId }) async {
final response = await deviceGetWithHttpInfo( instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }

View File

@ -0,0 +1,325 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class 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<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [Instance] instance (required):
Future<InstanceDTO> 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<InstanceDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Instance/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> 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<String>.value(null);
}
/// Performs an HTTP 'GET /api/Instance' operation and returns the [Response].
Future<Response> instanceGetWithHttpInfo() async {
final path = r'/api/Instance';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
Future<List<Instance>> 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<Instance>') as List)
.cast<Instance>()
.toList(growable: false);
}
return Future<List<Instance>>.value(null);
}
/// Performs an HTTP 'GET /api/Instance/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<InstanceDTO> 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<InstanceDTO>.value(null);
}
/// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response].
/// Parameters:
///
/// * [Instance] instance (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [Instance] instance (required):
Future<InstanceDTO> 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<InstanceDTO>.value(null);
}
}

View File

@ -143,7 +143,12 @@ class ResourceApi {
} }
/// Performs an HTTP 'GET /api/Resource' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Resource' operation and returns the [Response].
Future<Response> resourceGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
Future<Response> resourceGetWithHttpInfo({ String instanceId }) async {
// Verify required params are set.
final path = r'/api/Resource'; final path = r'/api/Resource';
Object postBody; Object postBody;
@ -152,6 +157,10 @@ class ResourceApi {
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
final contentTypes = <String>[]; final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer']; final authNames = <String>['bearer'];
@ -180,8 +189,11 @@ class ResourceApi {
); );
} }
Future<List<ResourceDTO>> resourceGet() async { /// Parameters:
final response = await resourceGetWithHttpInfo(); ///
/// * [String] instanceId:
Future<List<ResourceDTO>> resourceGet({ String instanceId }) async {
final response = await resourceGetWithHttpInfo( instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }
@ -393,7 +405,9 @@ class ResourceApi {
/// * [String] label: /// * [String] label:
/// ///
/// * [String] type: /// * [String] type:
Future<Response> resourceUploadWithHttpInfo({ String label, String type }) async { ///
/// * [String] instanceId:
Future<Response> resourceUploadWithHttpInfo({ String label, String type, String instanceId }) async {
// Verify required params are set. // Verify required params are set.
final path = r'/api/Resource/upload'; final path = r'/api/Resource/upload';
@ -422,6 +436,10 @@ class ResourceApi {
hasFields = true; hasFields = true;
mp.fields[r'type'] = parameterToString(type); mp.fields[r'type'] = parameterToString(type);
} }
if (instanceId != null) {
hasFields = true;
mp.fields[r'instanceId'] = parameterToString(instanceId);
}
if (hasFields) { if (hasFields) {
postBody = mp; postBody = mp;
} }
@ -432,6 +450,9 @@ class ResourceApi {
if (type != null) { if (type != null) {
formParams[r'type'] = parameterToString(type); formParams[r'type'] = parameterToString(type);
} }
if (instanceId != null) {
formParams[r'instanceId'] = parameterToString(instanceId);
}
} }
return await apiClient.invokeAPI( return await apiClient.invokeAPI(
@ -451,8 +472,10 @@ class ResourceApi {
/// * [String] label: /// * [String] label:
/// ///
/// * [String] type: /// * [String] type:
Future<String> resourceUpload({ String label, String type }) async { ///
final response = await resourceUploadWithHttpInfo( label: label, type: type ); /// * [String] instanceId:
Future<String> resourceUpload({ String label, String type, String instanceId }) async {
final response = await resourceUploadWithHttpInfo( label: label, type: type, instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }

View File

@ -207,7 +207,12 @@ class SectionApi {
} }
/// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Section' operation and returns the [Response].
Future<Response> sectionGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
Future<Response> sectionGetWithHttpInfo({ String instanceId }) async {
// Verify required params are set.
final path = r'/api/Section'; final path = r'/api/Section';
Object postBody; Object postBody;
@ -216,6 +221,10 @@ class SectionApi {
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
final contentTypes = <String>[]; final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer']; final authNames = <String>['bearer'];
@ -244,8 +253,11 @@ class SectionApi {
); );
} }
Future<List<SectionDTO>> sectionGet() async { /// Parameters:
final response = await sectionGetWithHttpInfo(); ///
/// * [String] instanceId:
Future<List<SectionDTO>> sectionGet({ String instanceId }) async {
final response = await sectionGetWithHttpInfo( instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }

View File

@ -176,6 +176,10 @@ class ApiClient {
return ImageDTO.fromJson(value); return ImageDTO.fromJson(value);
case 'ImageGeoPoint': case 'ImageGeoPoint':
return ImageGeoPoint.fromJson(value); return ImageGeoPoint.fromJson(value);
case 'Instance':
return Instance.fromJson(value);
case 'InstanceDTO':
return InstanceDTO.fromJson(value);
case 'LevelDTO': case 'LevelDTO':
return LevelDTO.fromJson(value); return LevelDTO.fromJson(value);
case 'LoginDTO': case 'LoginDTO':

View File

@ -24,6 +24,7 @@ class ConfigurationDTO {
this.isMobile, this.isMobile,
this.isTablet, this.isTablet,
this.isOffline, this.isOffline,
this.instanceId,
}); });
String id; String id;
@ -50,6 +51,8 @@ class ConfigurationDTO {
bool isOffline; bool isOffline;
String instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id && other.id == id &&
@ -63,7 +66,8 @@ class ConfigurationDTO {
other.dateCreation == dateCreation && other.dateCreation == dateCreation &&
other.isMobile == isMobile && other.isMobile == isMobile &&
other.isTablet == isTablet && other.isTablet == isTablet &&
other.isOffline == isOffline; other.isOffline == isOffline &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
@ -78,10 +82,11 @@ class ConfigurationDTO {
(dateCreation == null ? 0 : dateCreation.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) +
(isMobile == null ? 0 : isMobile.hashCode) + (isMobile == null ? 0 : isMobile.hashCode) +
(isTablet == null ? 0 : isTablet.hashCode) + (isTablet == null ? 0 : isTablet.hashCode) +
(isOffline == null ? 0 : isOffline.hashCode); (isOffline == null ? 0 : isOffline.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -121,6 +126,9 @@ class ConfigurationDTO {
if (isOffline != null) { if (isOffline != null) {
json[r'isOffline'] = isOffline; json[r'isOffline'] = isOffline;
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json; return json;
} }
@ -145,6 +153,7 @@ class ConfigurationDTO {
isMobile: json[r'isMobile'], isMobile: json[r'isMobile'],
isTablet: json[r'isTablet'], isTablet: json[r'isTablet'],
isOffline: json[r'isOffline'], isOffline: json[r'isOffline'],
instanceId: json[r'instanceId'],
); );
static List<ConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => static List<ConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>

View File

@ -22,6 +22,7 @@ class DeviceDetailDTO {
this.connected, this.connected,
this.dateCreation, this.dateCreation,
this.dateUpdate, this.dateUpdate,
this.instanceId,
this.connectionLevel, this.connectionLevel,
this.lastConnectionLevel, this.lastConnectionLevel,
this.batteryLevel, this.batteryLevel,
@ -48,6 +49,8 @@ class DeviceDetailDTO {
DateTime dateUpdate; DateTime dateUpdate;
String instanceId;
String connectionLevel; String connectionLevel;
DateTime lastConnectionLevel; DateTime lastConnectionLevel;
@ -68,6 +71,7 @@ class DeviceDetailDTO {
other.connected == connected && other.connected == connected &&
other.dateCreation == dateCreation && other.dateCreation == dateCreation &&
other.dateUpdate == dateUpdate && other.dateUpdate == dateUpdate &&
other.instanceId == instanceId &&
other.connectionLevel == connectionLevel && other.connectionLevel == connectionLevel &&
other.lastConnectionLevel == lastConnectionLevel && other.lastConnectionLevel == lastConnectionLevel &&
other.batteryLevel == batteryLevel && other.batteryLevel == batteryLevel &&
@ -85,13 +89,14 @@ class DeviceDetailDTO {
(connected == null ? 0 : connected.hashCode) + (connected == null ? 0 : connected.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) +
(dateUpdate == null ? 0 : dateUpdate.hashCode) + (dateUpdate == null ? 0 : dateUpdate.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode) +
(connectionLevel == null ? 0 : connectionLevel.hashCode) + (connectionLevel == null ? 0 : connectionLevel.hashCode) +
(lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) +
(batteryLevel == null ? 0 : batteryLevel.hashCode) + (batteryLevel == null ? 0 : batteryLevel.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -125,6 +130,9 @@ class DeviceDetailDTO {
if (dateUpdate != null) { if (dateUpdate != null) {
json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String();
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
if (connectionLevel != null) { if (connectionLevel != null) {
json[r'connectionLevel'] = connectionLevel; json[r'connectionLevel'] = connectionLevel;
} }
@ -159,6 +167,7 @@ class DeviceDetailDTO {
dateUpdate: json[r'dateUpdate'] == null dateUpdate: json[r'dateUpdate'] == null
? null ? null
: DateTime.parse(json[r'dateUpdate']), : DateTime.parse(json[r'dateUpdate']),
instanceId: json[r'instanceId'],
connectionLevel: json[r'connectionLevel'], connectionLevel: json[r'connectionLevel'],
lastConnectionLevel: json[r'lastConnectionLevel'] == null lastConnectionLevel: json[r'lastConnectionLevel'] == null
? null ? null

View File

@ -22,6 +22,7 @@ class DeviceDTO {
this.connected, this.connected,
this.dateCreation, this.dateCreation,
this.dateUpdate, this.dateUpdate,
this.instanceId,
}); });
String id; String id;
@ -44,6 +45,8 @@ class DeviceDTO {
DateTime dateUpdate; DateTime dateUpdate;
String instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is DeviceDTO && bool operator ==(Object other) => identical(this, other) || other is DeviceDTO &&
other.id == id && other.id == id &&
@ -55,7 +58,8 @@ class DeviceDTO {
other.configuration == configuration && other.configuration == configuration &&
other.connected == connected && other.connected == connected &&
other.dateCreation == dateCreation && other.dateCreation == dateCreation &&
other.dateUpdate == dateUpdate; other.dateUpdate == dateUpdate &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
@ -68,10 +72,11 @@ class DeviceDTO {
(configuration == null ? 0 : configuration.hashCode) + (configuration == null ? 0 : configuration.hashCode) +
(connected == null ? 0 : connected.hashCode) + (connected == null ? 0 : connected.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) +
(dateUpdate == null ? 0 : dateUpdate.hashCode); (dateUpdate == null ? 0 : dateUpdate.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -105,6 +110,9 @@ class DeviceDTO {
if (dateUpdate != null) { if (dateUpdate != null) {
json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String();
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json; return json;
} }
@ -127,6 +135,7 @@ class DeviceDTO {
dateUpdate: json[r'dateUpdate'] == null dateUpdate: json[r'dateUpdate'] == null
? null ? null
: DateTime.parse(json[r'dateUpdate']), : DateTime.parse(json[r'dateUpdate']),
instanceId: json[r'instanceId'],
); );
static List<DeviceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => static List<DeviceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>

View File

@ -24,6 +24,7 @@ class ExportConfigurationDTO {
this.isMobile, this.isMobile,
this.isTablet, this.isTablet,
this.isOffline, this.isOffline,
this.instanceId,
this.sections, this.sections,
this.resources, this.resources,
}); });
@ -52,6 +53,8 @@ class ExportConfigurationDTO {
bool isOffline; bool isOffline;
String instanceId;
List<SectionDTO> sections; List<SectionDTO> sections;
List<ResourceDTO> resources; List<ResourceDTO> resources;
@ -70,6 +73,7 @@ class ExportConfigurationDTO {
other.isMobile == isMobile && other.isMobile == isMobile &&
other.isTablet == isTablet && other.isTablet == isTablet &&
other.isOffline == isOffline && other.isOffline == isOffline &&
other.instanceId == instanceId &&
other.sections == sections && other.sections == sections &&
other.resources == resources; other.resources == resources;
@ -87,11 +91,12 @@ class ExportConfigurationDTO {
(isMobile == null ? 0 : isMobile.hashCode) + (isMobile == null ? 0 : isMobile.hashCode) +
(isTablet == null ? 0 : isTablet.hashCode) + (isTablet == null ? 0 : isTablet.hashCode) +
(isOffline == null ? 0 : isOffline.hashCode) + (isOffline == null ? 0 : isOffline.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode) +
(sections == null ? 0 : sections.hashCode) + (sections == null ? 0 : sections.hashCode) +
(resources == null ? 0 : resources.hashCode); (resources == null ? 0 : resources.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -131,6 +136,9 @@ class ExportConfigurationDTO {
if (isOffline != null) { if (isOffline != null) {
json[r'isOffline'] = isOffline; json[r'isOffline'] = isOffline;
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
if (sections != null) { if (sections != null) {
json[r'sections'] = sections; json[r'sections'] = sections;
} }
@ -161,6 +169,7 @@ class ExportConfigurationDTO {
isMobile: json[r'isMobile'], isMobile: json[r'isMobile'],
isTablet: json[r'isTablet'], isTablet: json[r'isTablet'],
isOffline: json[r'isOffline'], isOffline: json[r'isOffline'],
instanceId: json[r'instanceId'],
sections: SectionDTO.listFromJson(json[r'sections']), sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']), resources: ResourceDTO.listFromJson(json[r'resources']),
); );

View File

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

View File

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

View File

@ -17,6 +17,7 @@ class ResourceDTO {
this.label, this.label,
this.dateCreation, this.dateCreation,
this.data, this.data,
this.instanceId,
}); });
String id; String id;
@ -29,13 +30,16 @@ class ResourceDTO {
String data; String data;
String instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is ResourceDTO && bool operator ==(Object other) => identical(this, other) || other is ResourceDTO &&
other.id == id && other.id == id &&
other.type == type && other.type == type &&
other.label == label && other.label == label &&
other.dateCreation == dateCreation && other.dateCreation == dateCreation &&
other.data == data; other.data == data &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
@ -43,10 +47,11 @@ class ResourceDTO {
(type == null ? 0 : type.hashCode) + (type == null ? 0 : type.hashCode) +
(label == null ? 0 : label.hashCode) + (label == null ? 0 : label.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) +
(data == null ? 0 : data.hashCode); (data == null ? 0 : data.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -65,6 +70,9 @@ class ResourceDTO {
if (data != null) { if (data != null) {
json[r'data'] = data; json[r'data'] = data;
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json; return json;
} }
@ -80,6 +88,7 @@ class ResourceDTO {
? null ? null
: DateTime.parse(json[r'dateCreation']), : DateTime.parse(json[r'dateCreation']),
data: json[r'data'], data: json[r'data'],
instanceId: json[r'instanceId'],
); );
static List<ResourceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => static List<ResourceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>

View File

@ -25,6 +25,7 @@ class SectionDTO {
this.data, this.data,
this.dateCreation, this.dateCreation,
this.order, this.order,
this.instanceId,
}); });
String id; String id;
@ -53,6 +54,8 @@ class SectionDTO {
int order; int order;
String instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is SectionDTO && bool operator ==(Object other) => identical(this, other) || other is SectionDTO &&
other.id == id && other.id == id &&
@ -67,7 +70,8 @@ class SectionDTO {
other.type == type && other.type == type &&
other.data == data && other.data == data &&
other.dateCreation == dateCreation && other.dateCreation == dateCreation &&
other.order == order; other.order == order &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
@ -83,10 +87,11 @@ class SectionDTO {
(type == null ? 0 : type.hashCode) + (type == null ? 0 : type.hashCode) +
(data == null ? 0 : data.hashCode) + (data == null ? 0 : data.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) +
(order == null ? 0 : order.hashCode); (order == null ? 0 : order.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -129,6 +134,9 @@ class SectionDTO {
if (order != null) { if (order != null) {
json[r'order'] = order; json[r'order'] = order;
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json; return json;
} }
@ -152,6 +160,7 @@ class SectionDTO {
? null ? null
: DateTime.parse(json[r'dateCreation']), : DateTime.parse(json[r'dateCreation']),
order: json[r'order'], order: json[r'order'],
instanceId: json[r'instanceId'],
); );
static List<SectionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => static List<SectionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>

View File

@ -18,6 +18,7 @@ class TokenDTO {
this.tokenType, this.tokenType,
this.expiresIn, this.expiresIn,
this.expiration, this.expiration,
this.instanceId,
}); });
String accessToken; String accessToken;
@ -32,6 +33,8 @@ class TokenDTO {
DateTime expiration; DateTime expiration;
String instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is TokenDTO && bool operator ==(Object other) => identical(this, other) || other is TokenDTO &&
other.accessToken == accessToken && other.accessToken == accessToken &&
@ -39,7 +42,8 @@ class TokenDTO {
other.scope == scope && other.scope == scope &&
other.tokenType == tokenType && other.tokenType == tokenType &&
other.expiresIn == expiresIn && other.expiresIn == expiresIn &&
other.expiration == expiration; other.expiration == expiration &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
@ -48,10 +52,11 @@ class TokenDTO {
(scope == null ? 0 : scope.hashCode) + (scope == null ? 0 : scope.hashCode) +
(tokenType == null ? 0 : tokenType.hashCode) + (tokenType == null ? 0 : tokenType.hashCode) +
(expiresIn == null ? 0 : expiresIn.hashCode) + (expiresIn == null ? 0 : expiresIn.hashCode) +
(expiration == null ? 0 : expiration.hashCode); (expiration == null ? 0 : expiration.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -73,6 +78,9 @@ class TokenDTO {
if (expiration != null) { if (expiration != null) {
json[r'expiration'] = expiration.toUtc().toIso8601String(); json[r'expiration'] = expiration.toUtc().toIso8601String();
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json; return json;
} }
@ -89,6 +97,7 @@ class TokenDTO {
expiration: json[r'expiration'] == null expiration: json[r'expiration'] == null
? null ? null
: DateTime.parse(json[r'expiration']), : DateTime.parse(json[r'expiration']),
instanceId: json[r'instanceId'],
); );
static List<TokenDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => static List<TokenDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>

View File

@ -19,6 +19,7 @@ class User {
this.lastName, this.lastName,
this.token, this.token,
this.dateCreation, this.dateCreation,
this.instanceId,
}); });
String id; String id;
@ -35,6 +36,8 @@ class User {
DateTime dateCreation; DateTime dateCreation;
String instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is User && bool operator ==(Object other) => identical(this, other) || other is User &&
other.id == id && other.id == id &&
@ -43,7 +46,8 @@ class User {
other.firstName == firstName && other.firstName == firstName &&
other.lastName == lastName && other.lastName == lastName &&
other.token == token && other.token == token &&
other.dateCreation == dateCreation; other.dateCreation == dateCreation &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
@ -53,10 +57,11 @@ class User {
(firstName == null ? 0 : firstName.hashCode) + (firstName == null ? 0 : firstName.hashCode) +
(lastName == null ? 0 : lastName.hashCode) + (lastName == null ? 0 : lastName.hashCode) +
(token == null ? 0 : token.hashCode) + (token == null ? 0 : token.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode); (dateCreation == null ? 0 : dateCreation.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override @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<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -81,6 +86,9 @@ class User {
if (dateCreation != null) { if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
} }
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json; return json;
} }
@ -98,6 +106,7 @@ class User {
dateCreation: json[r'dateCreation'] == null dateCreation: json[r'dateCreation'] == null
? null ? null
: DateTime.parse(json[r'dateCreation']), : DateTime.parse(json[r'dateCreation']),
instanceId: json[r'instanceId'],
); );
static List<User> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => static List<User> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>

2212
manager_api/swagger.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
/// tests for InstanceApi
void main() {
final instance = InstanceApi();
group('tests for InstanceApi', () {
//Future<InstanceDTO> instanceCreateInstance(Instance instance) async
test('test instanceCreateInstance', () async {
// TODO
});
//Future<String> instanceDeleteInstance(String id) async
test('test instanceDeleteInstance', () async {
// TODO
});
//Future<List<Instance>> instanceGet() async
test('test instanceGet', () async {
// TODO
});
//Future<InstanceDTO> instanceGetDetail(String id) async
test('test instanceGetDetail', () async {
// TODO
});
//Future<InstanceDTO> instanceUpdateinstance(Instance instance) async
test('test instanceUpdateinstance', () async {
// TODO
});
});
}

View File

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

View File

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