Wip add pin for access

This commit is contained in:
Thomas Fransolet 2023-12-01 09:09:16 +01:00
parent f45497d476
commit 0ae552622d
62 changed files with 1506 additions and 695 deletions

View File

@ -9,6 +9,7 @@ class RoundedInputField extends StatelessWidget {
final String? initialValue; final String? initialValue;
final Color? color, textColor, iconColor; final Color? color, textColor, iconColor;
final int? maxLength; final int? maxLength;
final bool isString;
const RoundedInputField({ const RoundedInputField({
Key? key, Key? key,
this.hintText, this.hintText,
@ -19,6 +20,7 @@ class RoundedInputField extends StatelessWidget {
this.iconColor = kMainRed, this.iconColor = kMainRed,
this.onChanged, this.onChanged,
this.maxLength, // 50 this.maxLength, // 50
this.isString = true,
}) : super(key: key); }) : super(key: key);
@override @override
@ -30,6 +32,7 @@ class RoundedInputField extends StatelessWidget {
initialValue: initialValue, initialValue: initialValue,
cursorColor: textColor, cursorColor: textColor,
maxLength: maxLength, maxLength: maxLength,
keyboardType: isString ? TextInputType.text : TextInputType.number,
style: TextStyle(fontSize: 20, color: textColor), style: TextStyle(fontSize: 20, color: textColor),
decoration: InputDecoration( decoration: InputDecoration(
icon: icon != null ? Icon( icon: icon != null ? Icon(

View File

@ -83,8 +83,8 @@ class DatabaseHelper {
return await db.rawQuery("DELETE FROM $table"); return await db.rawQuery("DELETE FROM $table");
} }
Future<TabletAppContext> getData() async { Future<TabletAppContext?> getData() async {
TabletAppContext tabletAppContext = TabletAppContext(); TabletAppContext? tabletAppContext;
await DatabaseHelper.instance.queryAllRows().then((value) { await DatabaseHelper.instance.queryAllRows().then((value) {
value.forEach((element) { value.forEach((element) {
@ -95,6 +95,7 @@ class DatabaseHelper {
tabletAppContext = TabletAppContext( tabletAppContext = TabletAppContext(
id: element["id"], id: element["id"],
instanceId: element["instanceId"],
deviceId: element["deviceId"], deviceId: element["deviceId"],
host: element["host"], host: element["host"],
configuration: configuration, configuration: configuration,
@ -103,6 +104,7 @@ class DatabaseHelper {
}); });
}).catchError((error) { }).catchError((error) {
print(error); print(error);
return null;
}); });
return tabletAppContext; return tabletAppContext;

View File

@ -132,7 +132,7 @@ class MQTTHelper {
"connected": false "connected": false
}; };
final connMessage = MqttConnectMessage().authenticateAs('admin', 'mdlf2021!') // TODO ONLINE final connMessage = MqttConnectMessage().authenticateAs("user1", "MyMuseum2023!") // TODO ONLINE // 'admin', 'mdlf2021!'
.keepAliveFor(60) .keepAliveFor(60)
.withWillTopic('player/status') .withWillTopic('player/status')
.withWillMessage(jsonEncode(message)) .withWillMessage(jsonEncode(message))
@ -141,7 +141,7 @@ class MQTTHelper {
.withWillQos(MqttQos.atLeastOnce); .withWillQos(MqttQos.atLeastOnce);
if(kIsWeb) { if(kIsWeb) {
/*tabletAppContext.clientBrowserMQTT = MqttBrowserClient.withPort(hostToTake!.replaceAll('http://', ''), 'tablet_app_'+identifier!, 1883); /*tabletAppContext.clientBrowserMQTT = MqttBrowserClient.withPort(hostToTake!.replaceAll('https://api.', ''), 'tablet_app_'+identifier!, 1883);
tabletAppContext.clientBrowserMQTT!.logging(on: false); tabletAppContext.clientBrowserMQTT!.logging(on: false);
tabletAppContext.clientBrowserMQTT!.keepAlivePeriod = 20; tabletAppContext.clientBrowserMQTT!.keepAlivePeriod = 20;
tabletAppContext.clientBrowserMQTT!.onDisconnected = onDisconnected; tabletAppContext.clientBrowserMQTT!.onDisconnected = onDisconnected;
@ -178,8 +178,8 @@ class MQTTHelper {
tabletAppContext.clientBrowserMQTT!.disconnect(); tabletAppContext.clientBrowserMQTT!.disconnect();
}*/ }*/
} else { } else {
tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('http://', ''), 'tablet_app_'+identifier!, 1883); tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('https://api.', ''), 'tablet_app_'+identifier!, 1883);
tabletAppContext.clientMQTT!.logging(on: false); tabletAppContext.clientMQTT!.logging(on: true);
tabletAppContext.clientMQTT!.keepAlivePeriod = 20; tabletAppContext.clientMQTT!.keepAlivePeriod = 20;
tabletAppContext.clientMQTT!.onDisconnected = onDisconnected; tabletAppContext.clientMQTT!.onDisconnected = onDisconnected;
tabletAppContext.clientMQTT!.onConnected = () => onConnected(appContext); tabletAppContext.clientMQTT!.onConnected = () => onConnected(appContext);
@ -236,6 +236,9 @@ class MQTTHelper {
tabletAppContext.deviceId = device.id; tabletAppContext.deviceId = device.id;
tabletAppContext.configuration!.id = device.configurationId; tabletAppContext.configuration!.id = device.configurationId;
print(tabletAppContext);
print(tabletAppContext.instanceId);
appContext.setContext(tabletAppContext); appContext.setContext(tabletAppContext);
// STORE IT LOCALLY (SQLite) // STORE IT LOCALLY (SQLite)

View File

@ -34,6 +34,7 @@ class ConfigViewWidget extends StatefulWidget {
class _ConfigViewWidget extends State<ConfigViewWidget> { class _ConfigViewWidget extends State<ConfigViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
String url = "https://api.mymuseum.be"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 // PROD MDLF "http://192.168.1.19" String url = "https://api.mymuseum.be"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 // PROD MDLF "http://192.168.1.19"
int? pinCode;
bool configOk = false; bool configOk = false;
@override @override
@ -148,8 +149,8 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
borderRadius: BorderRadius.circular(29), borderRadius: BorderRadius.circular(29),
color: kBackgroundLight, color: kBackgroundLight,
), ),
constraints: BoxConstraints(maxWidth: 500, minWidth: 450), constraints: BoxConstraints(maxWidth: 500, minWidth: 450, minHeight: 350, maxHeight: 450),
height: size.height*0.3, height: size.height*0.35,
width: size.width*0.6, width: size.width*0.6,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -171,20 +172,38 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
initialValue: url, initialValue: url,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
print("Setstate value");
url = value; url = value;
print(url);
}); });
}, },
icon: Icons.language icon: Icons.language
), ),
), ),
Padding(
padding: const EdgeInsets.only(left: 50, right: 50),
child: RoundedInputField(
hintText: "PIN",
onChanged: (value) {
setState(() {
pinCode = int.tryParse(value);
});
},
icon: Icons.pin,
isString: false
),
),
RoundedButton( RoundedButton(
text: "OK", text: "OK",
fontSize: 25, fontSize: 25,
press: () async { press: () async {
var client = new Client(url); var client = new Client(url);
print(url); print(url);
var isOk = await isValidApi(client); print(pinCode);
if (isOk) {
if(url.length > 0 && pinCode != null) {
var instance = await getInstanceIdByPinCode(client, pinCode!);
if (instance != null) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: "Connecté au manager", msg: "Connecté au manager",
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -197,23 +216,24 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
TabletAppContext? tabletAppContext = appContext.getContext(); TabletAppContext? tabletAppContext = appContext.getContext();
if(tabletAppContext == null) { if(tabletAppContext == null) {
TabletAppContext tabletAppContext = new TabletAppContext(); tabletAppContext = new TabletAppContext(host: url, instanceId: instance.id);
tabletAppContext.host = url;
} }
tabletAppContext.instanceId = instance.id;
tabletAppContext!.clientAPI = client; tabletAppContext.clientAPI = client;
var identifier = kIsWeb ? "WEB TEST" : await DeviceInfoHelper.getDeviceDetails(); var identifier = kIsWeb ? "WEB TEST" : await DeviceInfoHelper.getDeviceDetails();
if(kIsWeb) { if(kIsWeb) {
//tabletAppContext.clientBrowserMQTT = new MqttBrowserClient(url.replaceAll('http://', ''),'tablet_app_'+ identifier!); //tabletAppContext.clientBrowserMQTT = new MqttBrowserClient(url.replaceAll('http://', ''),'tablet_app_'+ identifier!);
} else } else
{ {
print("init mqtt");
print(identifier);
// mobile specific // mobile specific
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+ identifier!); tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('https://api.', ''),'tablet_app_'+ identifier!);
} }
setState(() { setState(() {
appContext.setContext(tabletAppContext); appContext.setContext(tabletAppContext!);
configOk = true; configOk = true;
}); });
} else { } else {
@ -227,6 +247,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
fontSize: 16.0 fontSize: 16.0
); );
} }
}
}, },
) )
], ],
@ -250,6 +271,10 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
newDevice.ipAddressWLAN = await getIP(true); newDevice.ipAddressWLAN = await getIP(true);
newDevice.ipAddressETH = await getIP(false); newDevice.ipAddressETH = await getIP(false);
newDevice.name = newDevice.ipAddressWLAN; newDevice.name = newDevice.ipAddressWLAN;
newDevice.dateCreation = DateTime.now();
newDevice.dateUpdate = DateTime.now();
newDevice.lastConnectionLevel = DateTime.now();
newDevice.lastBatteryLevel = DateTime.now();
print(newDevice); print(newDevice);
@ -270,7 +295,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
appContext.setContext(tabletAppContext); appContext.setContext(tabletAppContext);
// STORE IT LOCALLY (SQLite) // STORE IT LOCALLY (SQLite)
TabletAppContext localContext = await DatabaseHelper.instance.getData(); TabletAppContext? localContext = await DatabaseHelper.instance.getData();
if (localContext != null) { // Check if sql DB exist if (localContext != null) { // Check if sql DB exist
await DatabaseHelper.instance.update(tabletAppContext); await DatabaseHelper.instance.update(tabletAppContext);
} else { } else {
@ -299,14 +324,13 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
} }
} }
isValidApi(Client client) async { Future<InstanceDTO?> getInstanceIdByPinCode(Client client, int pinCode) async {
print("TEST URL");
try { try {
var configs = await client.configurationApi!.configurationGet(); var instance = await client.instanceApi!.instanceGetInstanceByPinCode(pinCode: pinCode);
return configs != null; return instance;
} catch (ex) { } catch (ex) {
print(ex); print(ex);
return false; return null;
} }
} }
} }

View File

@ -5,7 +5,7 @@ info:
description: API Manager Service description: API Manager Service
version: Version Alpha version: Version Alpha
servers: servers:
- url: https://api.mymuseum.be - url: http://localhost:5000
paths: paths:
/api/Configuration: /api/Configuration:
get: get:
@ -112,6 +112,39 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Configuration/byPin:
get:
tags:
- Configuration
operationId: Configuration_GetConfigurationsByPinCode
parameters:
- name: pinCode
in: query
schema:
type: integer
format: int32
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConfigurationDTO'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
/api/Configuration/{id}: /api/Configuration/{id}:
get: get:
tags: tags:
@ -196,6 +229,12 @@ paths:
type: string type: string
nullable: true nullable: true
x-position: 1 x-position: 1
- name: language
in: query
schema:
type: string
nullable: true
x-position: 2
responses: responses:
'200': '200':
description: '' description: ''
@ -664,6 +703,37 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Instance/byPin:
get:
tags:
- Instance
operationId: Instance_GetInstanceByPinCode
parameters:
- name: pinCode
in: query
schema:
type: integer
format: int32
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
/api/Resource: /api/Resource:
get: get:
tags: tags:
@ -1205,6 +1275,40 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Section/beacons/{instanceId}:
get:
tags:
- Section
operationId: Section_GetAllBeaconsForInstance
parameters:
- name: instanceId
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'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
/api/Section/order: /api/Section/order:
put: put:
tags: tags:
@ -1654,6 +1758,14 @@ components:
instanceId: instanceId:
type: string type: string
nullable: true nullable: true
sectionIds:
type: array
nullable: true
items:
type: string
pinCode:
type: integer
format: int32
TranslationDTO: TranslationDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1741,7 +1853,8 @@ components:
isBeacon: isBeacon:
type: boolean type: boolean
beaconId: beaconId:
type: string type: integer
format: int32
nullable: true nullable: true
SectionType: SectionType:
type: integer type: integer
@ -1877,6 +1990,10 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
pinCode:
type: integer
format: int32
nullable: true
InstanceDTO: InstanceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1890,6 +2007,10 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
pinCode:
type: integer
format: int32
nullable: true
MapDTO: MapDTO:
type: object type: object
additionalProperties: false additionalProperties: false

View File

@ -8,6 +8,9 @@ class Client {
AuthenticationApi? _authenticationApi; AuthenticationApi? _authenticationApi;
AuthenticationApi? get authenticationApi => _authenticationApi; AuthenticationApi? get authenticationApi => _authenticationApi;
InstanceApi? _instanceApi;
InstanceApi? get instanceApi => _instanceApi;
UserApi? _userApi; UserApi? _userApi;
UserApi? get userApi => _userApi; UserApi? get userApi => _userApi;
@ -28,6 +31,7 @@ class Client {
basePath: path); // "http://192.168.31.96" basePath: path); // "http://192.168.31.96"
//basePath: "https://localhost:44339"); //basePath: "https://localhost:44339");
_authenticationApi = AuthenticationApi(_apiClient); _authenticationApi = AuthenticationApi(_apiClient);
_instanceApi = InstanceApi(_apiClient);
_userApi = UserApi(_apiClient); _userApi = UserApi(_apiClient);
_configurationApi = ConfigurationApi(_apiClient); _configurationApi = ConfigurationApi(_apiClient);
_sectionApi = SectionApi(_apiClient); _sectionApi = SectionApi(_apiClient);

View File

@ -25,12 +25,18 @@ void main() async {
if(localContext != null && localContext.host != null) { if(localContext != null && localContext.host != null) {
print("we've got an local db !"); print("we've got an local db !");
localContext.clientAPI = new Client(localContext.host!); print(localContext);
localContext.clientAPI = new Client(localContext.host!); // retrieve instanceId from local DB
isConfig = localContext.configuration != null; isConfig = localContext.configuration != null;
print(localContext); print(localContext);
print("localContext.deviceId");
print(localContext.deviceId!);
print("localContext.instanceId");
print(localContext.instanceId);
// Get config from manager // Get config from manager
DeviceDetailDTO? device = await localContext.clientAPI!.deviceApi!.deviceGetDetail(localContext.deviceId!); DeviceDetailDTO? device = await localContext.clientAPI!.deviceApi!.deviceGetDetail(localContext.deviceId!);
localContext.configuration!.id = device!.configurationId; localContext.configuration!.id = device!.configurationId;
localContext.instanceId = device.instanceId;
if (device.configurationId == null) { if (device.configurationId == null) {
print("device.configurationId == null"); print("device.configurationId == null");
localContext.configuration = null; localContext.configuration = null;
@ -43,6 +49,9 @@ void main() async {
if(kIsWeb) { if(kIsWeb) {
localContext = TabletAppContext(host: "https://api.mymuseum.be", instanceId: "63514fd67ed8c735aaa4b8f1"); // mymuseum : 63514fd67ed8c735aaa4b8f1 localContext = TabletAppContext(host: "https://api.mymuseum.be", instanceId: "63514fd67ed8c735aaa4b8f1"); // mymuseum : 63514fd67ed8c735aaa4b8f1
print(localContext); print(localContext);
} else {
/*print("MOBILE - set host");
localContext = TabletAppContext(host: "https://api.mymuseum.be"); // mymuseum : 63514fd67ed8c735aaa4b8f1 //https://localhost:5001/ // https://api.mymuseum.be*/
} }
initialRoute = isConfig ? '/main' : '/config'; initialRoute = isConfig ? '/main' : '/config';

View File

@ -60,7 +60,7 @@ try {
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
@ -70,6 +70,7 @@ Class | Method | HTTP request | Description
*ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | *ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | *ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
*ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | *ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
*ConfigurationApi* | [**configurationGetConfigurationsByPinCode**](doc\/ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
*ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | *ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | *ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
*ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | *ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
@ -83,6 +84,7 @@ Class | Method | HTTP request | Description
*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | *InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance | *InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance |
*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | *InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
*InstanceApi* | [**instanceGetInstanceByPinCode**](doc\/InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | *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} |
@ -95,6 +97,7 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | *SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | *SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*SectionApi* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | *SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | *SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
@ -155,7 +158,8 @@ Class | Method | HTTP request | Description
## Documentation For Authorization ## Documentation For Authorization
## bearer Authentication schemes defined for the API:
### bearer
- **Type**: OAuth - **Type**: OAuth
- **Flow**: password - **Flow**: password

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -13,6 +13,7 @@ Method | HTTP request | Description
[**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | [**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | [**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
[**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration | [**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
[**configurationGetConfigurationsByPinCode**](ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
[**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | [**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | [**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
[**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | [**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
@ -105,7 +106,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)
# **configurationExport** # **configurationExport**
> MultipartFile configurationExport(id) > MultipartFile configurationExport(id, language)
@ -117,9 +118,10 @@ import 'package:manager_api/api.dart';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final id = id_example; // String | final id = id_example; // String |
final language = language_example; // String |
try { try {
final result = api_instance.configurationExport(id); final result = api_instance.configurationExport(id, language);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ConfigurationApi->configurationExport: $e\n'); print('Exception when calling ConfigurationApi->configurationExport: $e\n');
@ -131,6 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**id** | **String**| | **id** | **String**| |
**language** | **String**| | [optional]
### Return type ### Return type
@ -190,6 +193,49 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **configurationGetConfigurationsByPinCode**
> List<ConfigurationDTO> configurationGetConfigurationsByPinCode(pinCode)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi();
final pinCode = 56; // int |
try {
final result = api_instance.configurationGetConfigurationsByPinCode(pinCode);
print(result);
} catch (e) {
print('Exception when calling ConfigurationApi->configurationGetConfigurationsByPinCode: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pinCode** | **int**| | [optional]
### Return type
[**List<ConfigurationDTO>**](ConfigurationDTO.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)
# **configurationGetDetail** # **configurationGetDetail**
> ConfigurationDTO configurationGetDetail(id) > ConfigurationDTO configurationGetDetail(id)

View File

@ -21,6 +21,8 @@ Name | Type | Description | Notes
**isTablet** | **bool** | | [optional] **isTablet** | **bool** | | [optional]
**isOffline** | **bool** | | [optional] **isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional] **instanceId** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []]
**pinCode** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[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

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -21,6 +21,8 @@ Name | Type | Description | Notes
**isTablet** | **bool** | | [optional] **isTablet** | **bool** | | [optional]
**isOffline** | **bool** | | [optional] **isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional] **instanceId** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []]
**pinCode** | **int** | | [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

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

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -13,6 +13,7 @@ Method | HTTP request | Description
[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | [**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance | [**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance |
[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | [**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
[**instanceGetInstanceByPinCode**](InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | [**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
@ -184,6 +185,49 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **instanceGetInstanceByPinCode**
> InstanceDTO instanceGetInstanceByPinCode(pinCode)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final pinCode = 56; // int |
try {
final result = api_instance.instanceGetInstanceByPinCode(pinCode);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceGetInstanceByPinCode: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pinCode** | **int**| | [optional]
### 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** # **instanceUpdateinstance**
> InstanceDTO instanceUpdateinstance(instance) > InstanceDTO instanceUpdateinstance(instance)

View File

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

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -13,6 +13,7 @@ Method | HTTP request | Description
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | [**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | [**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
[**sectionGetAllBeaconsForInstance**](SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | [**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
[**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | [**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
@ -200,6 +201,49 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetAllBeaconsForInstance**
> List<SectionDTO> sectionGetAllBeaconsForInstance(instanceId)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi();
final instanceId = instanceId_example; // String |
try {
final result = api_instance.sectionGetAllBeaconsForInstance(instanceId);
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetAllBeaconsForInstance: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| |
### Return type
[**List<SectionDTO>**](SectionDTO.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)
# **sectionGetAllSectionSubSections** # **sectionGetAllSectionSubSections**
> List<Object> sectionGetAllSectionSubSections(id) > List<Object> sectionGetAllSectionSubSections(id)

View File

@ -26,7 +26,7 @@ Name | Type | Description | Notes
**longitude** | **String** | | [optional] **longitude** | **String** | | [optional]
**meterZoneGPS** | **int** | | [optional] **meterZoneGPS** | **int** | | [optional]
**isBeacon** | **bool** | | [optional] **isBeacon** | **bool** | | [optional]
**beaconId** | **String** | | [optional] **beaconId** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[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

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -115,7 +115,9 @@ class ConfigurationApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> configurationExportWithHttpInfo(String id,) async { ///
/// * [String] language:
Future<Response> configurationExportWithHttpInfo(String id, { String? language, }) async {
// ignore: prefer_const_declarations // ignore: prefer_const_declarations
final path = r'/api/Configuration/{id}/export' final path = r'/api/Configuration/{id}/export'
.replaceAll('{id}', id); .replaceAll('{id}', id);
@ -127,6 +129,10 @@ class ConfigurationApi {
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
if (language != null) {
queryParams.addAll(_queryParams('', 'language', language));
}
const contentTypes = <String>[]; const contentTypes = <String>[];
@ -144,8 +150,10 @@ class ConfigurationApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<MultipartFile?> configurationExport(String id,) async { ///
final response = await configurationExportWithHttpInfo(id,); /// * [String] language:
Future<MultipartFile?> configurationExport(String id, { String? language, }) async {
final response = await configurationExportWithHttpInfo(id, language: language, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
@ -213,6 +221,60 @@ class ConfigurationApi {
return null; return null;
} }
/// Performs an HTTP 'GET /api/Configuration/byPin' operation and returns the [Response].
/// Parameters:
///
/// * [int] pinCode:
Future<Response> configurationGetConfigurationsByPinCodeWithHttpInfo({ int? pinCode, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Configuration/byPin';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (pinCode != null) {
queryParams.addAll(_queryParams('', 'pinCode', pinCode));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [int] pinCode:
Future<List<ConfigurationDTO>?> configurationGetConfigurationsByPinCode({ int? pinCode, }) async {
final response = await configurationGetConfigurationsByPinCodeWithHttpInfo( pinCode: pinCode, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ConfigurationDTO>') as List)
.cast<ConfigurationDTO>()
.toList();
}
return null;
}
/// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///

View File

@ -203,6 +203,57 @@ class InstanceApi {
return null; return null;
} }
/// Performs an HTTP 'GET /api/Instance/byPin' operation and returns the [Response].
/// Parameters:
///
/// * [int] pinCode:
Future<Response> instanceGetInstanceByPinCodeWithHttpInfo({ int? pinCode, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Instance/byPin';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (pinCode != null) {
queryParams.addAll(_queryParams('', 'pinCode', pinCode));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [int] pinCode:
Future<InstanceDTO?> instanceGetInstanceByPinCode({ int? pinCode, }) async {
final response = await instanceGetInstanceByPinCodeWithHttpInfo( pinCode: pinCode, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO;
}
return null;
}
/// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///

View File

@ -213,6 +213,57 @@ class SectionApi {
return null; return null;
} }
/// Performs an HTTP 'GET /api/Section/beacons/{instanceId}' operation and returns the [Response].
/// Parameters:
///
/// * [String] instanceId (required):
Future<Response> sectionGetAllBeaconsForInstanceWithHttpInfo(String instanceId,) async {
// ignore: prefer_const_declarations
final path = r'/api/Section/beacons/{instanceId}'
.replaceAll('{instanceId}', instanceId);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] instanceId (required):
Future<List<SectionDTO>?> sectionGetAllBeaconsForInstance(String instanceId,) async {
final response = await sectionGetAllBeaconsForInstanceWithHttpInfo(instanceId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<SectionDTO>') as List)
.cast<SectionDTO>()
.toList();
}
return null;
}
/// Performs an HTTP 'GET /api/Section/{id}/subsections' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Section/{id}/subsections' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///

View File

@ -11,11 +11,13 @@
part of openapi.api; part of openapi.api;
class ApiClient { class ApiClient {
ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication}); ApiClient({this.basePath = 'http://localhost:5000', this.authentication,});
final String basePath; final String basePath;
final Authentication? authentication;
var _client = Client(); var _client = Client();
final _defaultHeaderMap = <String, String>{};
/// Returns the current HTTP [Client] instance to use in this class. /// Returns the current HTTP [Client] instance to use in this class.
/// ///
@ -27,15 +29,12 @@ class ApiClient {
_client = newClient; _client = newClient;
} }
final _defaultHeaderMap = <String, String>{}; Map<String, String> get defaultHeaderMap => _defaultHeaderMap;
final Authentication? authentication;
void addDefaultHeader(String key, String value) { void addDefaultHeader(String key, String value) {
_defaultHeaderMap[key] = value; _defaultHeaderMap[key] = value;
} }
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
// We don't use a Map<String, String> for queryParams. // We don't use a Map<String, String> for queryParams.
// If collectionFormat is 'multi', a key might appear multiple times. // If collectionFormat is 'multi', a key might appear multiple times.
Future<Response> invokeAPI( Future<Response> invokeAPI(
@ -47,7 +46,7 @@ class ApiClient {
Map<String, String> formParams, Map<String, String> formParams,
String? contentType, String? contentType,
) async { ) async {
_updateParamsForAuth(queryParams, headerParams); await authentication?.applyToParams(queryParams, headerParams);
headerParams.addAll(_defaultHeaderMap); headerParams.addAll(_defaultHeaderMap);
if (contentType != null) { if (contentType != null) {
@ -165,16 +164,6 @@ class ApiClient {
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.') @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
String serialize(Object? value) => value == null ? '' : json.encode(value); String serialize(Object? value) => value == null ? '' : json.encode(value);
/// Update query and header parameters based on authentication settings.
void _updateParamsForAuth(
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
if (authentication != null) {
authentication!.applyToParams(queryParams, headerParams);
}
}
static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) { static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) {
try { try {
switch (targetType) { switch (targetType) {
@ -190,6 +179,8 @@ class ApiClient {
} }
final valueString = '$value'.toLowerCase(); final valueString = '$value'.toLowerCase();
return valueString == 'true' || valueString == '1'; return valueString == 'true' || valueString == '1';
case 'DateTime':
return value is DateTime ? value : DateTime.tryParse(value);
case 'ArticleDTO': case 'ArticleDTO':
return ArticleDTO.fromJson(value); return ArticleDTO.fromJson(value);
case 'ConfigurationDTO': case 'ConfigurationDTO':

View File

@ -20,7 +20,7 @@ class ApiKeyAuth implements Authentication {
String apiKey = ''; String apiKey = '';
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
if (paramValue.isNotEmpty) { if (paramValue.isNotEmpty) {

View File

@ -13,5 +13,5 @@ part of openapi.api;
// ignore: one_member_abstracts // ignore: one_member_abstracts
abstract class Authentication { abstract class Authentication {
/// Apply authentication settings to header and query params. /// Apply authentication settings to header and query params.
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams); Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams);
} }

View File

@ -17,7 +17,7 @@ class HttpBasicAuth implements Authentication {
String password; String password;
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
if (username.isNotEmpty && password.isNotEmpty) { if (username.isNotEmpty && password.isNotEmpty) {
final credentials = '$username:$password'; final credentials = '$username:$password';
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';

View File

@ -27,7 +27,7 @@ class HttpBearerAuth implements Authentication {
} }
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
if (_accessToken == null) { if (_accessToken == null) {
return; return;
} }

View File

@ -16,7 +16,7 @@ class OAuth implements Authentication {
String accessToken; String accessToken;
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
if (accessToken.isNotEmpty) { if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken'; headerParams['Authorization'] = 'Bearer $accessToken';
} }

View File

@ -63,23 +63,33 @@ class ArticleDTO {
String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]'; String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (content != null) { if (this.content != null) {
_json[r'content'] = content; json[r'content'] = this.content;
} else {
json[r'content'] = null;
} }
if (isContentTop != null) { if (this.isContentTop != null) {
_json[r'isContentTop'] = isContentTop; json[r'isContentTop'] = this.isContentTop;
} else {
json[r'isContentTop'] = null;
} }
if (audioIds != null) { if (this.audioIds != null) {
_json[r'audioIds'] = audioIds; json[r'audioIds'] = this.audioIds;
} else {
json[r'audioIds'] = null;
} }
if (isReadAudioAuto != null) { if (this.isReadAudioAuto != null) {
_json[r'isReadAudioAuto'] = isReadAudioAuto; json[r'isReadAudioAuto'] = this.isReadAudioAuto;
} else {
json[r'isReadAudioAuto'] = null;
} }
if (images != null) { if (this.images != null) {
_json[r'images'] = images; json[r'images'] = this.images;
} else {
json[r'images'] = null;
} }
return _json; return json;
} }
/// Returns a new [ArticleDTO] instance and imports its values from /// Returns a new [ArticleDTO] instance and imports its values from
@ -101,17 +111,17 @@ class ArticleDTO {
}()); }());
return ArticleDTO( return ArticleDTO(
content: TranslationDTO.listFromJson(json[r'content']) ?? const [], content: TranslationDTO.listFromJson(json[r'content']),
isContentTop: mapValueOfType<bool>(json, r'isContentTop'), isContentTop: mapValueOfType<bool>(json, r'isContentTop'),
audioIds: TranslationDTO.listFromJson(json[r'audioIds']) ?? const [], audioIds: TranslationDTO.listFromJson(json[r'audioIds']),
isReadAudioAuto: mapValueOfType<bool>(json, r'isReadAudioAuto'), isReadAudioAuto: mapValueOfType<bool>(json, r'isReadAudioAuto'),
images: ImageDTO.listFromJson(json[r'images']) ?? const [], images: ImageDTO.listFromJson(json[r'images']),
); );
} }
return null; return null;
} }
static List<ArticleDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<ArticleDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ArticleDTO>[]; final result = <ArticleDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -142,12 +152,10 @@ class ArticleDTO {
static Map<String, List<ArticleDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ArticleDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ArticleDTO>>{}; final map = <String, List<ArticleDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ArticleDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = ArticleDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -26,6 +26,8 @@ class ConfigurationDTO {
this.isTablet, this.isTablet,
this.isOffline, this.isOffline,
this.instanceId, this.instanceId,
this.sectionIds = const [],
this.pinCode,
}); });
String? id; String? id;
@ -78,6 +80,16 @@ class ConfigurationDTO {
String? instanceId; String? instanceId;
List<String>? sectionIds;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? pinCode;
@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 &&
@ -92,7 +104,9 @@ class ConfigurationDTO {
other.isMobile == isMobile && other.isMobile == isMobile &&
other.isTablet == isTablet && other.isTablet == isTablet &&
other.isOffline == isOffline && other.isOffline == isOffline &&
other.instanceId == instanceId; other.instanceId == instanceId &&
other.sectionIds == sectionIds &&
other.pinCode == pinCode;
@override @override
int get hashCode => int get hashCode =>
@ -109,53 +123,91 @@ class ConfigurationDTO {
(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); (instanceId == null ? 0 : instanceId!.hashCode) +
(sectionIds == null ? 0 : sectionIds!.hashCode) +
(pinCode == null ? 0 : pinCode!.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, instanceId=$instanceId]'; 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, sectionIds=$sectionIds, pinCode=$pinCode]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (title != null) { if (this.title != null) {
_json[r'title'] = title; json[r'title'] = this.title;
} else {
json[r'title'] = null;
} }
if (imageId != null) { if (this.imageId != null) {
_json[r'imageId'] = imageId; json[r'imageId'] = this.imageId;
} else {
json[r'imageId'] = null;
} }
if (imageSource != null) { if (this.imageSource != null) {
_json[r'imageSource'] = imageSource; json[r'imageSource'] = this.imageSource;
} else {
json[r'imageSource'] = null;
} }
if (primaryColor != null) { if (this.primaryColor != null) {
_json[r'primaryColor'] = primaryColor; json[r'primaryColor'] = this.primaryColor;
} else {
json[r'primaryColor'] = null;
} }
if (secondaryColor != null) { if (this.secondaryColor != null) {
_json[r'secondaryColor'] = secondaryColor; json[r'secondaryColor'] = this.secondaryColor;
} else {
json[r'secondaryColor'] = null;
} }
if (languages != null) { if (this.languages != null) {
_json[r'languages'] = languages; json[r'languages'] = this.languages;
} else {
json[r'languages'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (isMobile != null) { if (this.isMobile != null) {
_json[r'isMobile'] = isMobile; json[r'isMobile'] = this.isMobile;
} else {
json[r'isMobile'] = null;
} }
if (isTablet != null) { if (this.isTablet != null) {
_json[r'isTablet'] = isTablet; json[r'isTablet'] = this.isTablet;
} else {
json[r'isTablet'] = null;
} }
if (isOffline != null) { if (this.isOffline != null) {
_json[r'isOffline'] = isOffline; json[r'isOffline'] = this.isOffline;
} else {
json[r'isOffline'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
return _json; if (this.sectionIds != null) {
json[r'sectionIds'] = this.sectionIds;
} else {
json[r'sectionIds'] = null;
}
if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
} }
/// Returns a new [ConfigurationDTO] instance and imports its values from /// Returns a new [ConfigurationDTO] instance and imports its values from
@ -179,7 +231,7 @@ class ConfigurationDTO {
return ConfigurationDTO( return ConfigurationDTO(
id: mapValueOfType<String>(json, r'id'), id: mapValueOfType<String>(json, r'id'),
label: mapValueOfType<String>(json, r'label'), label: mapValueOfType<String>(json, r'label'),
title: TranslationDTO.listFromJson(json[r'title']) ?? const [], title: TranslationDTO.listFromJson(json[r'title']),
imageId: mapValueOfType<String>(json, r'imageId'), imageId: mapValueOfType<String>(json, r'imageId'),
imageSource: mapValueOfType<String>(json, r'imageSource'), imageSource: mapValueOfType<String>(json, r'imageSource'),
primaryColor: mapValueOfType<String>(json, r'primaryColor'), primaryColor: mapValueOfType<String>(json, r'primaryColor'),
@ -192,12 +244,16 @@ class ConfigurationDTO {
isTablet: mapValueOfType<bool>(json, r'isTablet'), isTablet: mapValueOfType<bool>(json, r'isTablet'),
isOffline: mapValueOfType<bool>(json, r'isOffline'), isOffline: mapValueOfType<bool>(json, r'isOffline'),
instanceId: mapValueOfType<String>(json, r'instanceId'), instanceId: mapValueOfType<String>(json, r'instanceId'),
sectionIds: json[r'sectionIds'] is List
? (json[r'sectionIds'] as List).cast<String>()
: const [],
pinCode: mapValueOfType<int>(json, r'pinCode'),
); );
} }
return null; return null;
} }
static List<ConfigurationDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<ConfigurationDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ConfigurationDTO>[]; final result = <ConfigurationDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -228,12 +284,10 @@ class ConfigurationDTO {
static Map<String, List<ConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ConfigurationDTO>>{}; final map = <String, List<ConfigurationDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ConfigurationDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = ConfigurationDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -131,53 +131,83 @@ class DeviceDetailDTO {
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]'; 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>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (identifier != null) { if (this.identifier != null) {
_json[r'identifier'] = identifier; json[r'identifier'] = this.identifier;
} else {
json[r'identifier'] = null;
} }
if (name != null) { if (this.name != null) {
_json[r'name'] = name; json[r'name'] = this.name;
} else {
json[r'name'] = null;
} }
if (ipAddressWLAN != null) { if (this.ipAddressWLAN != null) {
_json[r'ipAddressWLAN'] = ipAddressWLAN; json[r'ipAddressWLAN'] = this.ipAddressWLAN;
} else {
json[r'ipAddressWLAN'] = null;
} }
if (ipAddressETH != null) { if (this.ipAddressETH != null) {
_json[r'ipAddressETH'] = ipAddressETH; json[r'ipAddressETH'] = this.ipAddressETH;
} else {
json[r'ipAddressETH'] = null;
} }
if (configurationId != null) { if (this.configurationId != null) {
_json[r'configurationId'] = configurationId; json[r'configurationId'] = this.configurationId;
} else {
json[r'configurationId'] = null;
} }
if (configuration != null) { if (this.configuration != null) {
_json[r'configuration'] = configuration; json[r'configuration'] = this.configuration;
} else {
json[r'configuration'] = null;
} }
if (connected != null) { if (this.connected != null) {
_json[r'connected'] = connected; json[r'connected'] = this.connected;
} else {
json[r'connected'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (dateUpdate != null) { if (this.dateUpdate != null) {
_json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String(); json[r'dateUpdate'] = this.dateUpdate!.toUtc().toIso8601String();
} else {
json[r'dateUpdate'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
if (connectionLevel != null) { if (this.connectionLevel != null) {
_json[r'connectionLevel'] = connectionLevel; json[r'connectionLevel'] = this.connectionLevel;
} else {
json[r'connectionLevel'] = null;
} }
if (lastConnectionLevel != null) { if (this.lastConnectionLevel != null) {
_json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String(); json[r'lastConnectionLevel'] = this.lastConnectionLevel!.toUtc().toIso8601String();
} else {
json[r'lastConnectionLevel'] = null;
} }
if (batteryLevel != null) { if (this.batteryLevel != null) {
_json[r'batteryLevel'] = batteryLevel; json[r'batteryLevel'] = this.batteryLevel;
} else {
json[r'batteryLevel'] = null;
} }
if (lastBatteryLevel != null) { if (this.lastBatteryLevel != null) {
_json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String(); json[r'lastBatteryLevel'] = this.lastBatteryLevel!.toUtc().toIso8601String();
} else {
json[r'lastBatteryLevel'] = null;
} }
return _json; return json;
} }
/// Returns a new [DeviceDetailDTO] instance and imports its values from /// Returns a new [DeviceDetailDTO] instance and imports its values from
@ -219,7 +249,7 @@ class DeviceDetailDTO {
return null; return null;
} }
static List<DeviceDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<DeviceDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <DeviceDetailDTO>[]; final result = <DeviceDetailDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -250,12 +280,10 @@ class DeviceDetailDTO {
static Map<String, List<DeviceDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<DeviceDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<DeviceDetailDTO>>{}; final map = <String, List<DeviceDetailDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = DeviceDetailDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = DeviceDetailDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -58,20 +58,28 @@ class DeviceDetailDTOAllOf {
String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (connectionLevel != null) { if (this.connectionLevel != null) {
_json[r'connectionLevel'] = connectionLevel; json[r'connectionLevel'] = this.connectionLevel;
} else {
json[r'connectionLevel'] = null;
} }
if (lastConnectionLevel != null) { if (this.lastConnectionLevel != null) {
_json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String(); json[r'lastConnectionLevel'] = this.lastConnectionLevel!.toUtc().toIso8601String();
} else {
json[r'lastConnectionLevel'] = null;
} }
if (batteryLevel != null) { if (this.batteryLevel != null) {
_json[r'batteryLevel'] = batteryLevel; json[r'batteryLevel'] = this.batteryLevel;
} else {
json[r'batteryLevel'] = null;
} }
if (lastBatteryLevel != null) { if (this.lastBatteryLevel != null) {
_json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String(); json[r'lastBatteryLevel'] = this.lastBatteryLevel!.toUtc().toIso8601String();
} else {
json[r'lastBatteryLevel'] = null;
} }
return _json; return json;
} }
/// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from /// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from
@ -102,7 +110,7 @@ class DeviceDetailDTOAllOf {
return null; return null;
} }
static List<DeviceDetailDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) { static List<DeviceDetailDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
final result = <DeviceDetailDTOAllOf>[]; final result = <DeviceDetailDTOAllOf>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -133,12 +141,10 @@ class DeviceDetailDTOAllOf {
static Map<String, List<DeviceDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<DeviceDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<DeviceDetailDTOAllOf>>{}; final map = <String, List<DeviceDetailDTOAllOf>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,); map[entry.key] = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -99,41 +99,63 @@ class DeviceDTO {
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]'; 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>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (identifier != null) { if (this.identifier != null) {
_json[r'identifier'] = identifier; json[r'identifier'] = this.identifier;
} else {
json[r'identifier'] = null;
} }
if (name != null) { if (this.name != null) {
_json[r'name'] = name; json[r'name'] = this.name;
} else {
json[r'name'] = null;
} }
if (ipAddressWLAN != null) { if (this.ipAddressWLAN != null) {
_json[r'ipAddressWLAN'] = ipAddressWLAN; json[r'ipAddressWLAN'] = this.ipAddressWLAN;
} else {
json[r'ipAddressWLAN'] = null;
} }
if (ipAddressETH != null) { if (this.ipAddressETH != null) {
_json[r'ipAddressETH'] = ipAddressETH; json[r'ipAddressETH'] = this.ipAddressETH;
} else {
json[r'ipAddressETH'] = null;
} }
if (configurationId != null) { if (this.configurationId != null) {
_json[r'configurationId'] = configurationId; json[r'configurationId'] = this.configurationId;
} else {
json[r'configurationId'] = null;
} }
if (configuration != null) { if (this.configuration != null) {
_json[r'configuration'] = configuration; json[r'configuration'] = this.configuration;
} else {
json[r'configuration'] = null;
} }
if (connected != null) { if (this.connected != null) {
_json[r'connected'] = connected; json[r'connected'] = this.connected;
} else {
json[r'connected'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (dateUpdate != null) { if (this.dateUpdate != null) {
_json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String(); json[r'dateUpdate'] = this.dateUpdate!.toUtc().toIso8601String();
} else {
json[r'dateUpdate'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
return _json; return json;
} }
/// Returns a new [DeviceDTO] instance and imports its values from /// Returns a new [DeviceDTO] instance and imports its values from
@ -171,7 +193,7 @@ class DeviceDTO {
return null; return null;
} }
static List<DeviceDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<DeviceDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <DeviceDTO>[]; final result = <DeviceDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -202,12 +224,10 @@ class DeviceDTO {
static Map<String, List<DeviceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<DeviceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<DeviceDTO>>{}; final map = <String, List<DeviceDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = DeviceDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = DeviceDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -26,6 +26,8 @@ class ExportConfigurationDTO {
this.isTablet, this.isTablet,
this.isOffline, this.isOffline,
this.instanceId, this.instanceId,
this.sectionIds = const [],
this.pinCode,
this.sections = const [], this.sections = const [],
this.resources = const [], this.resources = const [],
}); });
@ -80,6 +82,16 @@ class ExportConfigurationDTO {
String? instanceId; String? instanceId;
List<String>? sectionIds;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? pinCode;
List<SectionDTO>? sections; List<SectionDTO>? sections;
List<ResourceDTO>? resources; List<ResourceDTO>? resources;
@ -99,6 +111,8 @@ class ExportConfigurationDTO {
other.isTablet == isTablet && other.isTablet == isTablet &&
other.isOffline == isOffline && other.isOffline == isOffline &&
other.instanceId == instanceId && other.instanceId == instanceId &&
other.sectionIds == sectionIds &&
other.pinCode == pinCode &&
other.sections == sections && other.sections == sections &&
other.resources == resources; other.resources == resources;
@ -118,60 +132,102 @@ class ExportConfigurationDTO {
(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) + (instanceId == null ? 0 : instanceId!.hashCode) +
(sectionIds == null ? 0 : sectionIds!.hashCode) +
(pinCode == null ? 0 : pinCode!.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, instanceId=$instanceId, 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, sectionIds=$sectionIds, pinCode=$pinCode, sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (title != null) { if (this.title != null) {
_json[r'title'] = title; json[r'title'] = this.title;
} else {
json[r'title'] = null;
} }
if (imageId != null) { if (this.imageId != null) {
_json[r'imageId'] = imageId; json[r'imageId'] = this.imageId;
} else {
json[r'imageId'] = null;
} }
if (imageSource != null) { if (this.imageSource != null) {
_json[r'imageSource'] = imageSource; json[r'imageSource'] = this.imageSource;
} else {
json[r'imageSource'] = null;
} }
if (primaryColor != null) { if (this.primaryColor != null) {
_json[r'primaryColor'] = primaryColor; json[r'primaryColor'] = this.primaryColor;
} else {
json[r'primaryColor'] = null;
} }
if (secondaryColor != null) { if (this.secondaryColor != null) {
_json[r'secondaryColor'] = secondaryColor; json[r'secondaryColor'] = this.secondaryColor;
} else {
json[r'secondaryColor'] = null;
} }
if (languages != null) { if (this.languages != null) {
_json[r'languages'] = languages; json[r'languages'] = this.languages;
} else {
json[r'languages'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (isMobile != null) { if (this.isMobile != null) {
_json[r'isMobile'] = isMobile; json[r'isMobile'] = this.isMobile;
} else {
json[r'isMobile'] = null;
} }
if (isTablet != null) { if (this.isTablet != null) {
_json[r'isTablet'] = isTablet; json[r'isTablet'] = this.isTablet;
} else {
json[r'isTablet'] = null;
} }
if (isOffline != null) { if (this.isOffline != null) {
_json[r'isOffline'] = isOffline; json[r'isOffline'] = this.isOffline;
} else {
json[r'isOffline'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
if (sections != null) { if (this.sectionIds != null) {
_json[r'sections'] = sections; json[r'sectionIds'] = this.sectionIds;
} else {
json[r'sectionIds'] = null;
} }
if (resources != null) { if (this.pinCode != null) {
_json[r'resources'] = resources; json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
} }
return _json; if (this.sections != null) {
json[r'sections'] = this.sections;
} else {
json[r'sections'] = null;
}
if (this.resources != null) {
json[r'resources'] = this.resources;
} else {
json[r'resources'] = null;
}
return json;
} }
/// Returns a new [ExportConfigurationDTO] instance and imports its values from /// Returns a new [ExportConfigurationDTO] instance and imports its values from
@ -195,7 +251,7 @@ class ExportConfigurationDTO {
return ExportConfigurationDTO( return ExportConfigurationDTO(
id: mapValueOfType<String>(json, r'id'), id: mapValueOfType<String>(json, r'id'),
label: mapValueOfType<String>(json, r'label'), label: mapValueOfType<String>(json, r'label'),
title: TranslationDTO.listFromJson(json[r'title']) ?? const [], title: TranslationDTO.listFromJson(json[r'title']),
imageId: mapValueOfType<String>(json, r'imageId'), imageId: mapValueOfType<String>(json, r'imageId'),
imageSource: mapValueOfType<String>(json, r'imageSource'), imageSource: mapValueOfType<String>(json, r'imageSource'),
primaryColor: mapValueOfType<String>(json, r'primaryColor'), primaryColor: mapValueOfType<String>(json, r'primaryColor'),
@ -208,14 +264,18 @@ class ExportConfigurationDTO {
isTablet: mapValueOfType<bool>(json, r'isTablet'), isTablet: mapValueOfType<bool>(json, r'isTablet'),
isOffline: mapValueOfType<bool>(json, r'isOffline'), isOffline: mapValueOfType<bool>(json, r'isOffline'),
instanceId: mapValueOfType<String>(json, r'instanceId'), instanceId: mapValueOfType<String>(json, r'instanceId'),
sections: SectionDTO.listFromJson(json[r'sections']) ?? const [], sectionIds: json[r'sectionIds'] is List
resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [], ? (json[r'sectionIds'] as List).cast<String>()
: const [],
pinCode: mapValueOfType<int>(json, r'pinCode'),
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
); );
} }
return null; return null;
} }
static List<ExportConfigurationDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<ExportConfigurationDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ExportConfigurationDTO>[]; final result = <ExportConfigurationDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -246,12 +306,10 @@ class ExportConfigurationDTO {
static Map<String, List<ExportConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ExportConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ExportConfigurationDTO>>{}; final map = <String, List<ExportConfigurationDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -36,14 +36,18 @@ class ExportConfigurationDTOAllOf {
String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]'; String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (sections != null) { if (this.sections != null) {
_json[r'sections'] = sections; json[r'sections'] = this.sections;
} else {
json[r'sections'] = null;
} }
if (resources != null) { if (this.resources != null) {
_json[r'resources'] = resources; json[r'resources'] = this.resources;
} else {
json[r'resources'] = null;
} }
return _json; return json;
} }
/// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from /// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from
@ -65,14 +69,14 @@ class ExportConfigurationDTOAllOf {
}()); }());
return ExportConfigurationDTOAllOf( return ExportConfigurationDTOAllOf(
sections: SectionDTO.listFromJson(json[r'sections']) ?? const [], sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [], resources: ResourceDTO.listFromJson(json[r'resources']),
); );
} }
return null; return null;
} }
static List<ExportConfigurationDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) { static List<ExportConfigurationDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ExportConfigurationDTOAllOf>[]; final result = <ExportConfigurationDTOAllOf>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -103,12 +107,10 @@ class ExportConfigurationDTOAllOf {
static Map<String, List<ExportConfigurationDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ExportConfigurationDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ExportConfigurationDTOAllOf>>{}; final map = <String, List<ExportConfigurationDTOAllOf>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,); map[entry.key] = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -62,26 +62,38 @@ class GeoPointDTO {
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]'; String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (title != null) { if (this.title != null) {
_json[r'title'] = title; json[r'title'] = this.title;
} else {
json[r'title'] = null;
} }
if (description != null) { if (this.description != null) {
_json[r'description'] = description; json[r'description'] = this.description;
} else {
json[r'description'] = null;
} }
if (images != null) { if (this.images != null) {
_json[r'images'] = images; json[r'images'] = this.images;
} else {
json[r'images'] = null;
} }
if (latitude != null) { if (this.latitude != null) {
_json[r'latitude'] = latitude; json[r'latitude'] = this.latitude;
} else {
json[r'latitude'] = null;
} }
if (longitude != null) { if (this.longitude != null) {
_json[r'longitude'] = longitude; json[r'longitude'] = this.longitude;
} else {
json[r'longitude'] = null;
} }
return _json; return json;
} }
/// Returns a new [GeoPointDTO] instance and imports its values from /// Returns a new [GeoPointDTO] instance and imports its values from
@ -104,9 +116,9 @@ class GeoPointDTO {
return GeoPointDTO( return GeoPointDTO(
id: mapValueOfType<int>(json, r'id'), id: mapValueOfType<int>(json, r'id'),
title: TranslationDTO.listFromJson(json[r'title']) ?? const [], title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']) ?? const [], description: TranslationDTO.listFromJson(json[r'description']),
images: ImageGeoPoint.listFromJson(json[r'images']) ?? const [], images: ImageGeoPoint.listFromJson(json[r'images']),
latitude: mapValueOfType<String>(json, r'latitude'), latitude: mapValueOfType<String>(json, r'latitude'),
longitude: mapValueOfType<String>(json, r'longitude'), longitude: mapValueOfType<String>(json, r'longitude'),
); );
@ -114,7 +126,7 @@ class GeoPointDTO {
return null; return null;
} }
static List<GeoPointDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<GeoPointDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <GeoPointDTO>[]; final result = <GeoPointDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -145,12 +157,10 @@ class GeoPointDTO {
static Map<String, List<GeoPointDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<GeoPointDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<GeoPointDTO>>{}; final map = <String, List<GeoPointDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = GeoPointDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = GeoPointDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -57,23 +57,33 @@ class ImageDTO {
String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]'; String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (title != null) { if (this.title != null) {
_json[r'title'] = title; json[r'title'] = this.title;
} else {
json[r'title'] = null;
} }
if (description != null) { if (this.description != null) {
_json[r'description'] = description; json[r'description'] = this.description;
} else {
json[r'description'] = null;
} }
if (resourceId != null) { if (this.resourceId != null) {
_json[r'resourceId'] = resourceId; json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
} }
if (source_ != null) { if (this.source_ != null) {
_json[r'source'] = source_; json[r'source'] = this.source_;
} else {
json[r'source'] = null;
} }
if (order != null) { if (this.order != null) {
_json[r'order'] = order; json[r'order'] = this.order;
} else {
json[r'order'] = null;
} }
return _json; return json;
} }
/// Returns a new [ImageDTO] instance and imports its values from /// Returns a new [ImageDTO] instance and imports its values from
@ -95,8 +105,8 @@ class ImageDTO {
}()); }());
return ImageDTO( return ImageDTO(
title: TranslationDTO.listFromJson(json[r'title']) ?? const [], title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']) ?? const [], description: TranslationDTO.listFromJson(json[r'description']),
resourceId: mapValueOfType<String>(json, r'resourceId'), resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'), source_: mapValueOfType<String>(json, r'source'),
order: mapValueOfType<int>(json, r'order'), order: mapValueOfType<int>(json, r'order'),
@ -105,7 +115,7 @@ class ImageDTO {
return null; return null;
} }
static List<ImageDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<ImageDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImageDTO>[]; final result = <ImageDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -136,12 +146,10 @@ class ImageDTO {
static Map<String, List<ImageDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ImageDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImageDTO>>{}; final map = <String, List<ImageDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ImageDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = ImageDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -36,14 +36,18 @@ class ImageGeoPoint {
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]'; String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (imageResourceId != null) { if (this.imageResourceId != null) {
_json[r'imageResourceId'] = imageResourceId; json[r'imageResourceId'] = this.imageResourceId;
} else {
json[r'imageResourceId'] = null;
} }
if (imageSource != null) { if (this.imageSource != null) {
_json[r'imageSource'] = imageSource; json[r'imageSource'] = this.imageSource;
} else {
json[r'imageSource'] = null;
} }
return _json; return json;
} }
/// Returns a new [ImageGeoPoint] instance and imports its values from /// Returns a new [ImageGeoPoint] instance and imports its values from
@ -72,7 +76,7 @@ class ImageGeoPoint {
return null; return null;
} }
static List<ImageGeoPoint>? listFromJson(dynamic json, {bool growable = false,}) { static List<ImageGeoPoint> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImageGeoPoint>[]; final result = <ImageGeoPoint>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -103,12 +107,10 @@ class ImageGeoPoint {
static Map<String, List<ImageGeoPoint>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ImageGeoPoint>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImageGeoPoint>>{}; final map = <String, List<ImageGeoPoint>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ImageGeoPoint.listFromJson(entry.value, growable: growable,); map[entry.key] = ImageGeoPoint.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -16,6 +16,7 @@ class Instance {
this.id, this.id,
this.name, this.name,
this.dateCreation, this.dateCreation,
this.pinCode,
}); });
String? id; String? id;
@ -30,34 +31,49 @@ class Instance {
/// ///
DateTime? dateCreation; DateTime? dateCreation;
int? pinCode;
@override @override
bool operator ==(Object other) => identical(this, other) || other is Instance && bool operator ==(Object other) => identical(this, other) || other is Instance &&
other.id == id && other.id == id &&
other.name == name && other.name == name &&
other.dateCreation == dateCreation; other.dateCreation == dateCreation &&
other.pinCode == pinCode;
@override @override
int get hashCode => int get hashCode =>
// ignore: unnecessary_parenthesis // ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) + (id == null ? 0 : id!.hashCode) +
(name == null ? 0 : name!.hashCode) + (name == null ? 0 : name!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode); (dateCreation == null ? 0 : dateCreation!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode);
@override @override
String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]'; String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (name != null) { if (this.name != null) {
_json[r'name'] = name; json[r'name'] = this.name;
} else {
json[r'name'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
return _json; if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
} }
/// Returns a new [Instance] instance and imports its values from /// Returns a new [Instance] instance and imports its values from
@ -82,12 +98,13 @@ class Instance {
id: mapValueOfType<String>(json, r'id'), id: mapValueOfType<String>(json, r'id'),
name: mapValueOfType<String>(json, r'name'), name: mapValueOfType<String>(json, r'name'),
dateCreation: mapDateTime(json, r'dateCreation', ''), dateCreation: mapDateTime(json, r'dateCreation', ''),
pinCode: mapValueOfType<int>(json, r'pinCode'),
); );
} }
return null; return null;
} }
static List<Instance>? listFromJson(dynamic json, {bool growable = false,}) { static List<Instance> listFromJson(dynamic json, {bool growable = false,}) {
final result = <Instance>[]; final result = <Instance>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -118,12 +135,10 @@ class Instance {
static Map<String, List<Instance>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<Instance>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<Instance>>{}; final map = <String, List<Instance>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = Instance.listFromJson(entry.value, growable: growable,); map[entry.key] = Instance.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -16,6 +16,7 @@ class InstanceDTO {
this.id, this.id,
this.name, this.name,
this.dateCreation, this.dateCreation,
this.pinCode,
}); });
String? id; String? id;
@ -30,34 +31,49 @@ class InstanceDTO {
/// ///
DateTime? dateCreation; DateTime? dateCreation;
int? pinCode;
@override @override
bool operator ==(Object other) => identical(this, other) || other is InstanceDTO && bool operator ==(Object other) => identical(this, other) || other is InstanceDTO &&
other.id == id && other.id == id &&
other.name == name && other.name == name &&
other.dateCreation == dateCreation; other.dateCreation == dateCreation &&
other.pinCode == pinCode;
@override @override
int get hashCode => int get hashCode =>
// ignore: unnecessary_parenthesis // ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) + (id == null ? 0 : id!.hashCode) +
(name == null ? 0 : name!.hashCode) + (name == null ? 0 : name!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode); (dateCreation == null ? 0 : dateCreation!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode);
@override @override
String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]'; String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (name != null) { if (this.name != null) {
_json[r'name'] = name; json[r'name'] = this.name;
} else {
json[r'name'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
return _json; if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
} }
/// Returns a new [InstanceDTO] instance and imports its values from /// Returns a new [InstanceDTO] instance and imports its values from
@ -82,12 +98,13 @@ class InstanceDTO {
id: mapValueOfType<String>(json, r'id'), id: mapValueOfType<String>(json, r'id'),
name: mapValueOfType<String>(json, r'name'), name: mapValueOfType<String>(json, r'name'),
dateCreation: mapDateTime(json, r'dateCreation', ''), dateCreation: mapDateTime(json, r'dateCreation', ''),
pinCode: mapValueOfType<int>(json, r'pinCode'),
); );
} }
return null; return null;
} }
static List<InstanceDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<InstanceDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <InstanceDTO>[]; final result = <InstanceDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -118,12 +135,10 @@ class InstanceDTO {
static Map<String, List<InstanceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<InstanceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<InstanceDTO>>{}; final map = <String, List<InstanceDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = InstanceDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = InstanceDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -41,17 +41,23 @@ class LevelDTO {
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]'; String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (resourceId != null) { if (this.resourceId != null) {
_json[r'resourceId'] = resourceId; json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
} }
if (source_ != null) { if (this.source_ != null) {
_json[r'source'] = source_; json[r'source'] = this.source_;
} else {
json[r'source'] = null;
} }
return _json; return json;
} }
/// Returns a new [LevelDTO] instance and imports its values from /// Returns a new [LevelDTO] instance and imports its values from
@ -73,7 +79,7 @@ class LevelDTO {
}()); }());
return LevelDTO( return LevelDTO(
label: TranslationDTO.listFromJson(json[r'label']) ?? const [], label: TranslationDTO.listFromJson(json[r'label']),
resourceId: mapValueOfType<String>(json, r'resourceId'), resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'), source_: mapValueOfType<String>(json, r'source'),
); );
@ -81,7 +87,7 @@ class LevelDTO {
return null; return null;
} }
static List<LevelDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<LevelDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <LevelDTO>[]; final result = <LevelDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -112,12 +118,10 @@ class LevelDTO {
static Map<String, List<LevelDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<LevelDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<LevelDTO>>{}; final map = <String, List<LevelDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = LevelDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = LevelDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -36,14 +36,18 @@ class LoginDTO {
String toString() => 'LoginDTO[email=$email, password=$password]'; String toString() => 'LoginDTO[email=$email, password=$password]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (email != null) { if (this.email != null) {
_json[r'email'] = email; json[r'email'] = this.email;
} else {
json[r'email'] = null;
} }
if (password != null) { if (this.password != null) {
_json[r'password'] = password; json[r'password'] = this.password;
} else {
json[r'password'] = null;
} }
return _json; return json;
} }
/// Returns a new [LoginDTO] instance and imports its values from /// Returns a new [LoginDTO] instance and imports its values from
@ -72,7 +76,7 @@ class LoginDTO {
return null; return null;
} }
static List<LoginDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<LoginDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <LoginDTO>[]; final result = <LoginDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -103,12 +107,10 @@ class LoginDTO {
static Map<String, List<LoginDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<LoginDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<LoginDTO>>{}; final map = <String, List<LoginDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = LoginDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = LoginDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -63,23 +63,33 @@ class MapDTO {
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]'; String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (zoom != null) { if (this.zoom != null) {
_json[r'zoom'] = zoom; json[r'zoom'] = this.zoom;
} else {
json[r'zoom'] = null;
} }
if (mapType != null) { if (this.mapType != null) {
_json[r'mapType'] = mapType; json[r'mapType'] = this.mapType;
} else {
json[r'mapType'] = null;
} }
if (points != null) { if (this.points != null) {
_json[r'points'] = points; json[r'points'] = this.points;
} else {
json[r'points'] = null;
} }
if (iconResourceId != null) { if (this.iconResourceId != null) {
_json[r'iconResourceId'] = iconResourceId; json[r'iconResourceId'] = this.iconResourceId;
} else {
json[r'iconResourceId'] = null;
} }
if (iconSource != null) { if (this.iconSource != null) {
_json[r'iconSource'] = iconSource; json[r'iconSource'] = this.iconSource;
} else {
json[r'iconSource'] = null;
} }
return _json; return json;
} }
/// Returns a new [MapDTO] instance and imports its values from /// Returns a new [MapDTO] instance and imports its values from
@ -103,7 +113,7 @@ class MapDTO {
return MapDTO( return MapDTO(
zoom: mapValueOfType<int>(json, r'zoom'), zoom: mapValueOfType<int>(json, r'zoom'),
mapType: MapTypeApp.fromJson(json[r'mapType']), mapType: MapTypeApp.fromJson(json[r'mapType']),
points: GeoPointDTO.listFromJson(json[r'points']) ?? const [], points: GeoPointDTO.listFromJson(json[r'points']),
iconResourceId: mapValueOfType<String>(json, r'iconResourceId'), iconResourceId: mapValueOfType<String>(json, r'iconResourceId'),
iconSource: mapValueOfType<String>(json, r'iconSource'), iconSource: mapValueOfType<String>(json, r'iconSource'),
); );
@ -111,7 +121,7 @@ class MapDTO {
return null; return null;
} }
static List<MapDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<MapDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MapDTO>[]; final result = <MapDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -142,12 +152,10 @@ class MapDTO {
static Map<String, List<MapDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<MapDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<MapDTO>>{}; final map = <String, List<MapDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = MapDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = MapDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -40,7 +40,7 @@ class MapTypeApp {
static MapTypeApp? fromJson(dynamic value) => MapTypeAppTypeTransformer().decode(value); static MapTypeApp? fromJson(dynamic value) => MapTypeAppTypeTransformer().decode(value);
static List<MapTypeApp>? listFromJson(dynamic json, {bool growable = false,}) { static List<MapTypeApp> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MapTypeApp>[]; final result = <MapTypeApp>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {

View File

@ -31,11 +31,13 @@ class MenuDTO {
String toString() => 'MenuDTO[sections=$sections]'; String toString() => 'MenuDTO[sections=$sections]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (sections != null) { if (this.sections != null) {
_json[r'sections'] = sections; json[r'sections'] = this.sections;
} else {
json[r'sections'] = null;
} }
return _json; return json;
} }
/// Returns a new [MenuDTO] instance and imports its values from /// Returns a new [MenuDTO] instance and imports its values from
@ -57,13 +59,13 @@ class MenuDTO {
}()); }());
return MenuDTO( return MenuDTO(
sections: SectionDTO.listFromJson(json[r'sections']) ?? const [], sections: SectionDTO.listFromJson(json[r'sections']),
); );
} }
return null; return null;
} }
static List<MenuDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<MenuDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MenuDTO>[]; final result = <MenuDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -94,12 +96,10 @@ class MenuDTO {
static Map<String, List<MenuDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<MenuDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<MenuDTO>>{}; final map = <String, List<MenuDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = MenuDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = MenuDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -48,14 +48,18 @@ class PlayerMessageDTO {
String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]'; String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (configChanged != null) { if (this.configChanged != null) {
_json[r'configChanged'] = configChanged; json[r'configChanged'] = this.configChanged;
} else {
json[r'configChanged'] = null;
} }
if (isDeleted != null) { if (this.isDeleted != null) {
_json[r'isDeleted'] = isDeleted; json[r'isDeleted'] = this.isDeleted;
} else {
json[r'isDeleted'] = null;
} }
return _json; return json;
} }
/// Returns a new [PlayerMessageDTO] instance and imports its values from /// Returns a new [PlayerMessageDTO] instance and imports its values from
@ -84,7 +88,7 @@ class PlayerMessageDTO {
return null; return null;
} }
static List<PlayerMessageDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<PlayerMessageDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PlayerMessageDTO>[]; final result = <PlayerMessageDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -115,12 +119,10 @@ class PlayerMessageDTO {
static Map<String, List<PlayerMessageDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<PlayerMessageDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PlayerMessageDTO>>{}; final map = <String, List<PlayerMessageDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = PlayerMessageDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = PlayerMessageDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -57,23 +57,33 @@ class QuestionDTO {
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]'; String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (responses != null) { if (this.responses != null) {
_json[r'responses'] = responses; json[r'responses'] = this.responses;
} else {
json[r'responses'] = null;
} }
if (resourceId != null) { if (this.resourceId != null) {
_json[r'resourceId'] = resourceId; json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
} }
if (source_ != null) { if (this.source_ != null) {
_json[r'source'] = source_; json[r'source'] = this.source_;
} else {
json[r'source'] = null;
} }
if (order != null) { if (this.order != null) {
_json[r'order'] = order; json[r'order'] = this.order;
} else {
json[r'order'] = null;
} }
return _json; return json;
} }
/// Returns a new [QuestionDTO] instance and imports its values from /// Returns a new [QuestionDTO] instance and imports its values from
@ -95,8 +105,8 @@ class QuestionDTO {
}()); }());
return QuestionDTO( return QuestionDTO(
label: TranslationDTO.listFromJson(json[r'label']) ?? const [], label: TranslationDTO.listFromJson(json[r'label']),
responses: ResponseDTO.listFromJson(json[r'responses']) ?? const [], responses: ResponseDTO.listFromJson(json[r'responses']),
resourceId: mapValueOfType<String>(json, r'resourceId'), resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'), source_: mapValueOfType<String>(json, r'source'),
order: mapValueOfType<int>(json, r'order'), order: mapValueOfType<int>(json, r'order'),
@ -105,7 +115,7 @@ class QuestionDTO {
return null; return null;
} }
static List<QuestionDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<QuestionDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <QuestionDTO>[]; final result = <QuestionDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -136,12 +146,10 @@ class QuestionDTO {
static Map<String, List<QuestionDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<QuestionDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<QuestionDTO>>{}; final map = <String, List<QuestionDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = QuestionDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = QuestionDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -51,23 +51,33 @@ class QuizzDTO {
String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]'; String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (questions != null) { if (this.questions != null) {
_json[r'questions'] = questions; json[r'questions'] = this.questions;
} else {
json[r'questions'] = null;
} }
if (badLevel != null) { if (this.badLevel != null) {
_json[r'bad_level'] = badLevel; json[r'bad_level'] = this.badLevel;
} else {
json[r'bad_level'] = null;
} }
if (mediumLevel != null) { if (this.mediumLevel != null) {
_json[r'medium_level'] = mediumLevel; json[r'medium_level'] = this.mediumLevel;
} else {
json[r'medium_level'] = null;
} }
if (goodLevel != null) { if (this.goodLevel != null) {
_json[r'good_level'] = goodLevel; json[r'good_level'] = this.goodLevel;
} else {
json[r'good_level'] = null;
} }
if (greatLevel != null) { if (this.greatLevel != null) {
_json[r'great_level'] = greatLevel; json[r'great_level'] = this.greatLevel;
} else {
json[r'great_level'] = null;
} }
return _json; return json;
} }
/// Returns a new [QuizzDTO] instance and imports its values from /// Returns a new [QuizzDTO] instance and imports its values from
@ -89,7 +99,7 @@ class QuizzDTO {
}()); }());
return QuizzDTO( return QuizzDTO(
questions: QuestionDTO.listFromJson(json[r'questions']) ?? const [], questions: QuestionDTO.listFromJson(json[r'questions']),
badLevel: QuizzDTOBadLevel.fromJson(json[r'bad_level']), badLevel: QuizzDTOBadLevel.fromJson(json[r'bad_level']),
mediumLevel: QuizzDTOBadLevel.fromJson(json[r'medium_level']), mediumLevel: QuizzDTOBadLevel.fromJson(json[r'medium_level']),
goodLevel: QuizzDTOBadLevel.fromJson(json[r'good_level']), goodLevel: QuizzDTOBadLevel.fromJson(json[r'good_level']),
@ -99,7 +109,7 @@ class QuizzDTO {
return null; return null;
} }
static List<QuizzDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<QuizzDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <QuizzDTO>[]; final result = <QuizzDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -130,12 +140,10 @@ class QuizzDTO {
static Map<String, List<QuizzDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<QuizzDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<QuizzDTO>>{}; final map = <String, List<QuizzDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = QuizzDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = QuizzDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -41,17 +41,23 @@ class QuizzDTOBadLevel {
String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, source_=$source_]'; String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, source_=$source_]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (resourceId != null) { if (this.resourceId != null) {
_json[r'resourceId'] = resourceId; json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
} }
if (source_ != null) { if (this.source_ != null) {
_json[r'source'] = source_; json[r'source'] = this.source_;
} else {
json[r'source'] = null;
} }
return _json; return json;
} }
/// Returns a new [QuizzDTOBadLevel] instance and imports its values from /// Returns a new [QuizzDTOBadLevel] instance and imports its values from
@ -73,7 +79,7 @@ class QuizzDTOBadLevel {
}()); }());
return QuizzDTOBadLevel( return QuizzDTOBadLevel(
label: TranslationDTO.listFromJson(json[r'label']) ?? const [], label: TranslationDTO.listFromJson(json[r'label']),
resourceId: mapValueOfType<String>(json, r'resourceId'), resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'), source_: mapValueOfType<String>(json, r'source'),
); );
@ -81,7 +87,7 @@ class QuizzDTOBadLevel {
return null; return null;
} }
static List<QuizzDTOBadLevel>? listFromJson(dynamic json, {bool growable = false,}) { static List<QuizzDTOBadLevel> listFromJson(dynamic json, {bool growable = false,}) {
final result = <QuizzDTOBadLevel>[]; final result = <QuizzDTOBadLevel>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -112,12 +118,10 @@ class QuizzDTOBadLevel {
static Map<String, List<QuizzDTOBadLevel>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<QuizzDTOBadLevel>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<QuizzDTOBadLevel>>{}; final map = <String, List<QuizzDTOBadLevel>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = QuizzDTOBadLevel.listFromJson(entry.value, growable: growable,); map[entry.key] = QuizzDTOBadLevel.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -68,26 +68,38 @@ class ResourceDTO {
String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data, dateCreation=$dateCreation, instanceId=$instanceId]'; String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data, dateCreation=$dateCreation, instanceId=$instanceId]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (type != null) { if (this.type != null) {
_json[r'type'] = type; json[r'type'] = this.type;
} else {
json[r'type'] = null;
} }
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (data != null) { if (this.data != null) {
_json[r'data'] = data; json[r'data'] = this.data;
} else {
json[r'data'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
return _json; return json;
} }
/// Returns a new [ResourceDTO] instance and imports its values from /// Returns a new [ResourceDTO] instance and imports its values from
@ -120,7 +132,7 @@ class ResourceDTO {
return null; return null;
} }
static List<ResourceDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<ResourceDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ResourceDTO>[]; final result = <ResourceDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -151,12 +163,10 @@ class ResourceDTO {
static Map<String, List<ResourceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ResourceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ResourceDTO>>{}; final map = <String, List<ResourceDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ResourceDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = ResourceDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -40,7 +40,7 @@ class ResourceType {
static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value); static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value);
static List<ResourceType>? listFromJson(dynamic json, {bool growable = false,}) { static List<ResourceType> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ResourceType>[]; final result = <ResourceType>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {

View File

@ -53,17 +53,23 @@ class ResponseDTO {
String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]'; String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (isGood != null) { if (this.isGood != null) {
_json[r'isGood'] = isGood; json[r'isGood'] = this.isGood;
} else {
json[r'isGood'] = null;
} }
if (order != null) { if (this.order != null) {
_json[r'order'] = order; json[r'order'] = this.order;
} else {
json[r'order'] = null;
} }
return _json; return json;
} }
/// Returns a new [ResponseDTO] instance and imports its values from /// Returns a new [ResponseDTO] instance and imports its values from
@ -85,7 +91,7 @@ class ResponseDTO {
}()); }());
return ResponseDTO( return ResponseDTO(
label: TranslationDTO.listFromJson(json[r'label']) ?? const [], label: TranslationDTO.listFromJson(json[r'label']),
isGood: mapValueOfType<bool>(json, r'isGood'), isGood: mapValueOfType<bool>(json, r'isGood'),
order: mapValueOfType<int>(json, r'order'), order: mapValueOfType<int>(json, r'order'),
); );
@ -93,7 +99,7 @@ class ResponseDTO {
return null; return null;
} }
static List<ResponseDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<ResponseDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ResponseDTO>[]; final result = <ResponseDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -124,12 +130,10 @@ class ResponseDTO {
static Map<String, List<ResponseDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<ResponseDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ResponseDTO>>{}; final map = <String, List<ResponseDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = ResponseDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = ResponseDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -100,7 +100,7 @@ class SectionDTO {
/// ///
bool? isBeacon; bool? isBeacon;
String? beaconId; int? beaconId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is SectionDTO && bool operator ==(Object other) => identical(this, other) || other is SectionDTO &&
@ -151,65 +151,103 @@ class SectionDTO {
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, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId]'; 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, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (label != null) { if (this.label != null) {
_json[r'label'] = label; json[r'label'] = this.label;
} else {
json[r'label'] = null;
} }
if (title != null) { if (this.title != null) {
_json[r'title'] = title; json[r'title'] = this.title;
} else {
json[r'title'] = null;
} }
if (description != null) { if (this.description != null) {
_json[r'description'] = description; json[r'description'] = this.description;
} else {
json[r'description'] = null;
} }
if (imageId != null) { if (this.imageId != null) {
_json[r'imageId'] = imageId; json[r'imageId'] = this.imageId;
} else {
json[r'imageId'] = null;
} }
if (imageSource != null) { if (this.imageSource != null) {
_json[r'imageSource'] = imageSource; json[r'imageSource'] = this.imageSource;
} else {
json[r'imageSource'] = null;
} }
if (configurationId != null) { if (this.configurationId != null) {
_json[r'configurationId'] = configurationId; json[r'configurationId'] = this.configurationId;
} else {
json[r'configurationId'] = null;
} }
if (isSubSection != null) { if (this.isSubSection != null) {
_json[r'isSubSection'] = isSubSection; json[r'isSubSection'] = this.isSubSection;
} else {
json[r'isSubSection'] = null;
} }
if (parentId != null) { if (this.parentId != null) {
_json[r'parentId'] = parentId; json[r'parentId'] = this.parentId;
} else {
json[r'parentId'] = null;
} }
if (type != null) { if (this.type != null) {
_json[r'type'] = type; json[r'type'] = this.type;
} else {
json[r'type'] = null;
} }
if (data != null) { if (this.data != null) {
_json[r'data'] = data; json[r'data'] = this.data;
} else {
json[r'data'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (order != null) { if (this.order != null) {
_json[r'order'] = order; json[r'order'] = this.order;
} else {
json[r'order'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
if (latitude != null) { if (this.latitude != null) {
_json[r'latitude'] = latitude; json[r'latitude'] = this.latitude;
} else {
json[r'latitude'] = null;
} }
if (longitude != null) { if (this.longitude != null) {
_json[r'longitude'] = longitude; json[r'longitude'] = this.longitude;
} else {
json[r'longitude'] = null;
} }
if (meterZoneGPS != null) { if (this.meterZoneGPS != null) {
_json[r'meterZoneGPS'] = meterZoneGPS; json[r'meterZoneGPS'] = this.meterZoneGPS;
} else {
json[r'meterZoneGPS'] = null;
} }
if (isBeacon != null) { if (this.isBeacon != null) {
_json[r'isBeacon'] = isBeacon; json[r'isBeacon'] = this.isBeacon;
} else {
json[r'isBeacon'] = null;
} }
if (beaconId != null) { if (this.beaconId != null) {
_json[r'beaconId'] = beaconId; json[r'beaconId'] = this.beaconId;
} else {
json[r'beaconId'] = null;
} }
return _json; return json;
} }
/// Returns a new [SectionDTO] instance and imports its values from /// Returns a new [SectionDTO] instance and imports its values from
@ -233,8 +271,8 @@ class SectionDTO {
return SectionDTO( return SectionDTO(
id: mapValueOfType<String>(json, r'id'), id: mapValueOfType<String>(json, r'id'),
label: mapValueOfType<String>(json, r'label'), label: mapValueOfType<String>(json, r'label'),
title: TranslationDTO.listFromJson(json[r'title']) ?? const [], title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']) ?? const [], description: TranslationDTO.listFromJson(json[r'description']),
imageId: mapValueOfType<String>(json, r'imageId'), imageId: mapValueOfType<String>(json, r'imageId'),
imageSource: mapValueOfType<String>(json, r'imageSource'), imageSource: mapValueOfType<String>(json, r'imageSource'),
configurationId: mapValueOfType<String>(json, r'configurationId'), configurationId: mapValueOfType<String>(json, r'configurationId'),
@ -249,13 +287,13 @@ class SectionDTO {
longitude: mapValueOfType<String>(json, r'longitude'), longitude: mapValueOfType<String>(json, r'longitude'),
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'), meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
isBeacon: mapValueOfType<bool>(json, r'isBeacon'), isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
beaconId: mapValueOfType<String>(json, r'beaconId'), beaconId: mapValueOfType<int>(json, r'beaconId'),
); );
} }
return null; return null;
} }
static List<SectionDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<SectionDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SectionDTO>[]; final result = <SectionDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -286,12 +324,10 @@ class SectionDTO {
static Map<String, List<SectionDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<SectionDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SectionDTO>>{}; final map = <String, List<SectionDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = SectionDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = SectionDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -44,7 +44,7 @@ class SectionType {
static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value); static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value);
static List<SectionType>? listFromJson(dynamic json, {bool growable = false,}) { static List<SectionType> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SectionType>[]; final result = <SectionType>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {

View File

@ -31,11 +31,13 @@ class SliderDTO {
String toString() => 'SliderDTO[images=$images]'; String toString() => 'SliderDTO[images=$images]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (images != null) { if (this.images != null) {
_json[r'images'] = images; json[r'images'] = this.images;
} else {
json[r'images'] = null;
} }
return _json; return json;
} }
/// Returns a new [SliderDTO] instance and imports its values from /// Returns a new [SliderDTO] instance and imports its values from
@ -57,13 +59,13 @@ class SliderDTO {
}()); }());
return SliderDTO( return SliderDTO(
images: ImageDTO.listFromJson(json[r'images']) ?? const [], images: ImageDTO.listFromJson(json[r'images']),
); );
} }
return null; return null;
} }
static List<SliderDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<SliderDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SliderDTO>[]; final result = <SliderDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -94,12 +96,10 @@ class SliderDTO {
static Map<String, List<SliderDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<SliderDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SliderDTO>>{}; final map = <String, List<SliderDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = SliderDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = SliderDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -73,29 +73,43 @@ class TokenDTO {
String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId]'; 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>{};
if (accessToken != null) { if (this.accessToken != null) {
_json[r'access_token'] = accessToken; json[r'access_token'] = this.accessToken;
} else {
json[r'access_token'] = null;
} }
if (refreshToken != null) { if (this.refreshToken != null) {
_json[r'refresh_token'] = refreshToken; json[r'refresh_token'] = this.refreshToken;
} else {
json[r'refresh_token'] = null;
} }
if (scope != null) { if (this.scope != null) {
_json[r'scope'] = scope; json[r'scope'] = this.scope;
} else {
json[r'scope'] = null;
} }
if (tokenType != null) { if (this.tokenType != null) {
_json[r'token_type'] = tokenType; json[r'token_type'] = this.tokenType;
} else {
json[r'token_type'] = null;
} }
if (expiresIn != null) { if (this.expiresIn != null) {
_json[r'expires_in'] = expiresIn; json[r'expires_in'] = this.expiresIn;
} else {
json[r'expires_in'] = null;
} }
if (expiration != null) { if (this.expiration != null) {
_json[r'expiration'] = expiration!.toUtc().toIso8601String(); json[r'expiration'] = this.expiration!.toUtc().toIso8601String();
} else {
json[r'expiration'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
return _json; return json;
} }
/// Returns a new [TokenDTO] instance and imports its values from /// Returns a new [TokenDTO] instance and imports its values from
@ -129,7 +143,7 @@ class TokenDTO {
return null; return null;
} }
static List<TokenDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<TokenDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TokenDTO>[]; final result = <TokenDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -160,12 +174,10 @@ class TokenDTO {
static Map<String, List<TokenDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<TokenDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TokenDTO>>{}; final map = <String, List<TokenDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = TokenDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = TokenDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -36,14 +36,18 @@ class TranslationDTO {
String toString() => 'TranslationDTO[language=$language, value=$value]'; String toString() => 'TranslationDTO[language=$language, value=$value]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (language != null) { if (this.language != null) {
_json[r'language'] = language; json[r'language'] = this.language;
} else {
json[r'language'] = null;
} }
if (value != null) { if (this.value != null) {
_json[r'value'] = value; json[r'value'] = this.value;
} else {
json[r'value'] = null;
} }
return _json; return json;
} }
/// Returns a new [TranslationDTO] instance and imports its values from /// Returns a new [TranslationDTO] instance and imports its values from
@ -72,7 +76,7 @@ class TranslationDTO {
return null; return null;
} }
static List<TranslationDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<TranslationDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TranslationDTO>[]; final result = <TranslationDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -103,12 +107,10 @@ class TranslationDTO {
static Map<String, List<TranslationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<TranslationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TranslationDTO>>{}; final map = <String, List<TranslationDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = TranslationDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = TranslationDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -72,32 +72,48 @@ class User {
String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation, instanceId=$instanceId]'; 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>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (email != null) { if (this.email != null) {
_json[r'email'] = email; json[r'email'] = this.email;
} else {
json[r'email'] = null;
} }
if (password != null) { if (this.password != null) {
_json[r'password'] = password; json[r'password'] = this.password;
} else {
json[r'password'] = null;
} }
if (firstName != null) { if (this.firstName != null) {
_json[r'firstName'] = firstName; json[r'firstName'] = this.firstName;
} else {
json[r'firstName'] = null;
} }
if (lastName != null) { if (this.lastName != null) {
_json[r'lastName'] = lastName; json[r'lastName'] = this.lastName;
} else {
json[r'lastName'] = null;
} }
if (token != null) { if (this.token != null) {
_json[r'token'] = token; json[r'token'] = this.token;
} else {
json[r'token'] = null;
} }
if (dateCreation != null) { if (this.dateCreation != null) {
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
} }
if (instanceId != null) { if (this.instanceId != null) {
_json[r'instanceId'] = instanceId; json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
} }
return _json; return json;
} }
/// Returns a new [User] instance and imports its values from /// Returns a new [User] instance and imports its values from
@ -132,7 +148,7 @@ class User {
return null; return null;
} }
static List<User>? listFromJson(dynamic json, {bool growable = false,}) { static List<User> listFromJson(dynamic json, {bool growable = false,}) {
final result = <User>[]; final result = <User>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -163,12 +179,10 @@ class User {
static Map<String, List<User>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<User>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<User>>{}; final map = <String, List<User>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = User.listFromJson(entry.value, growable: growable,); map[entry.key] = User.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -46,20 +46,28 @@ class UserDetailDTO {
String toString() => 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName]'; String toString() => 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (id != null) { if (this.id != null) {
_json[r'id'] = id; json[r'id'] = this.id;
} else {
json[r'id'] = null;
} }
if (email != null) { if (this.email != null) {
_json[r'email'] = email; json[r'email'] = this.email;
} else {
json[r'email'] = null;
} }
if (firstName != null) { if (this.firstName != null) {
_json[r'firstName'] = firstName; json[r'firstName'] = this.firstName;
} else {
json[r'firstName'] = null;
} }
if (lastName != null) { if (this.lastName != null) {
_json[r'lastName'] = lastName; json[r'lastName'] = this.lastName;
} else {
json[r'lastName'] = null;
} }
return _json; return json;
} }
/// Returns a new [UserDetailDTO] instance and imports its values from /// Returns a new [UserDetailDTO] instance and imports its values from
@ -90,7 +98,7 @@ class UserDetailDTO {
return null; return null;
} }
static List<UserDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<UserDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <UserDetailDTO>[]; final result = <UserDetailDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -121,12 +129,10 @@ class UserDetailDTO {
static Map<String, List<UserDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<UserDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<UserDetailDTO>>{}; final map = <String, List<UserDetailDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = UserDetailDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = UserDetailDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -31,11 +31,13 @@ class VideoDTO {
String toString() => 'VideoDTO[source_=$source_]'; String toString() => 'VideoDTO[source_=$source_]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (source_ != null) { if (this.source_ != null) {
_json[r'source'] = source_; json[r'source'] = this.source_;
} else {
json[r'source'] = null;
} }
return _json; return json;
} }
/// Returns a new [VideoDTO] instance and imports its values from /// Returns a new [VideoDTO] instance and imports its values from
@ -63,7 +65,7 @@ class VideoDTO {
return null; return null;
} }
static List<VideoDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<VideoDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <VideoDTO>[]; final result = <VideoDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -94,12 +96,10 @@ class VideoDTO {
static Map<String, List<VideoDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<VideoDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<VideoDTO>>{}; final map = <String, List<VideoDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = VideoDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = VideoDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;

View File

@ -31,11 +31,13 @@ class WebDTO {
String toString() => 'WebDTO[source_=$source_]'; String toString() => 'WebDTO[source_=$source_]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final _json = <String, dynamic>{}; final json = <String, dynamic>{};
if (source_ != null) { if (this.source_ != null) {
_json[r'source'] = source_; json[r'source'] = this.source_;
} else {
json[r'source'] = null;
} }
return _json; return json;
} }
/// Returns a new [WebDTO] instance and imports its values from /// Returns a new [WebDTO] instance and imports its values from
@ -63,7 +65,7 @@ class WebDTO {
return null; return null;
} }
static List<WebDTO>? listFromJson(dynamic json, {bool growable = false,}) { static List<WebDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <WebDTO>[]; final result = <WebDTO>[];
if (json is List && json.isNotEmpty) { if (json is List && json.isNotEmpty) {
for (final row in json) { for (final row in json) {
@ -94,12 +96,10 @@ class WebDTO {
static Map<String, List<WebDTO>> mapListFromJson(dynamic json, {bool growable = false,}) { static Map<String, List<WebDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<WebDTO>>{}; final map = <String, List<WebDTO>>{};
if (json is Map && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments // ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) { for (final entry in json.entries) {
final value = WebDTO.listFromJson(entry.value, growable: growable,); map[entry.key] = WebDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
} }
} }
return map; return map;