mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 16:41:19 +00:00
Wip add pin for access
This commit is contained in:
parent
f45497d476
commit
0ae552622d
@ -9,6 +9,7 @@ class RoundedInputField extends StatelessWidget {
|
||||
final String? initialValue;
|
||||
final Color? color, textColor, iconColor;
|
||||
final int? maxLength;
|
||||
final bool isString;
|
||||
const RoundedInputField({
|
||||
Key? key,
|
||||
this.hintText,
|
||||
@ -19,6 +20,7 @@ class RoundedInputField extends StatelessWidget {
|
||||
this.iconColor = kMainRed,
|
||||
this.onChanged,
|
||||
this.maxLength, // 50
|
||||
this.isString = true,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -30,6 +32,7 @@ class RoundedInputField extends StatelessWidget {
|
||||
initialValue: initialValue,
|
||||
cursorColor: textColor,
|
||||
maxLength: maxLength,
|
||||
keyboardType: isString ? TextInputType.text : TextInputType.number,
|
||||
style: TextStyle(fontSize: 20, color: textColor),
|
||||
decoration: InputDecoration(
|
||||
icon: icon != null ? Icon(
|
||||
|
||||
@ -83,8 +83,8 @@ class DatabaseHelper {
|
||||
return await db.rawQuery("DELETE FROM $table");
|
||||
}
|
||||
|
||||
Future<TabletAppContext> getData() async {
|
||||
TabletAppContext tabletAppContext = TabletAppContext();
|
||||
Future<TabletAppContext?> getData() async {
|
||||
TabletAppContext? tabletAppContext;
|
||||
|
||||
await DatabaseHelper.instance.queryAllRows().then((value) {
|
||||
value.forEach((element) {
|
||||
@ -95,6 +95,7 @@ class DatabaseHelper {
|
||||
|
||||
tabletAppContext = TabletAppContext(
|
||||
id: element["id"],
|
||||
instanceId: element["instanceId"],
|
||||
deviceId: element["deviceId"],
|
||||
host: element["host"],
|
||||
configuration: configuration,
|
||||
@ -103,6 +104,7 @@ class DatabaseHelper {
|
||||
});
|
||||
}).catchError((error) {
|
||||
print(error);
|
||||
return null;
|
||||
});
|
||||
|
||||
return tabletAppContext;
|
||||
|
||||
@ -132,7 +132,7 @@ class MQTTHelper {
|
||||
"connected": false
|
||||
};
|
||||
|
||||
final connMessage = MqttConnectMessage().authenticateAs('admin', 'mdlf2021!') // TODO ONLINE
|
||||
final connMessage = MqttConnectMessage().authenticateAs("user1", "MyMuseum2023!") // TODO ONLINE // 'admin', 'mdlf2021!'
|
||||
.keepAliveFor(60)
|
||||
.withWillTopic('player/status')
|
||||
.withWillMessage(jsonEncode(message))
|
||||
@ -141,7 +141,7 @@ class MQTTHelper {
|
||||
.withWillQos(MqttQos.atLeastOnce);
|
||||
|
||||
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!.keepAlivePeriod = 20;
|
||||
tabletAppContext.clientBrowserMQTT!.onDisconnected = onDisconnected;
|
||||
@ -178,8 +178,8 @@ class MQTTHelper {
|
||||
tabletAppContext.clientBrowserMQTT!.disconnect();
|
||||
}*/
|
||||
} else {
|
||||
tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('http://', ''), 'tablet_app_'+identifier!, 1883);
|
||||
tabletAppContext.clientMQTT!.logging(on: false);
|
||||
tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('https://api.', ''), 'tablet_app_'+identifier!, 1883);
|
||||
tabletAppContext.clientMQTT!.logging(on: true);
|
||||
tabletAppContext.clientMQTT!.keepAlivePeriod = 20;
|
||||
tabletAppContext.clientMQTT!.onDisconnected = onDisconnected;
|
||||
tabletAppContext.clientMQTT!.onConnected = () => onConnected(appContext);
|
||||
@ -236,6 +236,9 @@ class MQTTHelper {
|
||||
tabletAppContext.deviceId = device.id;
|
||||
tabletAppContext.configuration!.id = device.configurationId;
|
||||
|
||||
print(tabletAppContext);
|
||||
print(tabletAppContext.instanceId);
|
||||
|
||||
appContext.setContext(tabletAppContext);
|
||||
|
||||
// STORE IT LOCALLY (SQLite)
|
||||
|
||||
@ -34,6 +34,7 @@ class ConfigViewWidget extends StatefulWidget {
|
||||
class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
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"
|
||||
int? pinCode;
|
||||
bool configOk = false;
|
||||
|
||||
@override
|
||||
@ -148,8 +149,8 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
borderRadius: BorderRadius.circular(29),
|
||||
color: kBackgroundLight,
|
||||
),
|
||||
constraints: BoxConstraints(maxWidth: 500, minWidth: 450),
|
||||
height: size.height*0.3,
|
||||
constraints: BoxConstraints(maxWidth: 500, minWidth: 450, minHeight: 350, maxHeight: 450),
|
||||
height: size.height*0.35,
|
||||
width: size.width*0.6,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
@ -171,61 +172,81 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
initialValue: url,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
print("Setstate value");
|
||||
url = value;
|
||||
print(url);
|
||||
});
|
||||
},
|
||||
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(
|
||||
text: "OK",
|
||||
fontSize: 25,
|
||||
press: () async {
|
||||
var client = new Client(url);
|
||||
print(url);
|
||||
var isOk = await isValidApi(client);
|
||||
if (isOk) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "Connecté au manager",
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
timeInSecForIosWeb: 1,
|
||||
backgroundColor: Colors.lightGreen,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0
|
||||
);
|
||||
print(pinCode);
|
||||
|
||||
TabletAppContext? tabletAppContext = appContext.getContext();
|
||||
if(tabletAppContext == null) {
|
||||
TabletAppContext tabletAppContext = new TabletAppContext();
|
||||
tabletAppContext.host = url;
|
||||
}
|
||||
if(url.length > 0 && pinCode != null) {
|
||||
var instance = await getInstanceIdByPinCode(client, pinCode!);
|
||||
if (instance != null) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "Connecté au manager",
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
timeInSecForIosWeb: 1,
|
||||
backgroundColor: Colors.lightGreen,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0
|
||||
);
|
||||
|
||||
tabletAppContext!.clientAPI = client;
|
||||
var identifier = kIsWeb ? "WEB TEST" : await DeviceInfoHelper.getDeviceDetails();
|
||||
TabletAppContext? tabletAppContext = appContext.getContext();
|
||||
if(tabletAppContext == null) {
|
||||
tabletAppContext = new TabletAppContext(host: url, instanceId: instance.id);
|
||||
}
|
||||
tabletAppContext.instanceId = instance.id;
|
||||
tabletAppContext.clientAPI = client;
|
||||
var identifier = kIsWeb ? "WEB TEST" : await DeviceInfoHelper.getDeviceDetails();
|
||||
|
||||
if(kIsWeb) {
|
||||
//tabletAppContext.clientBrowserMQTT = new MqttBrowserClient(url.replaceAll('http://', ''),'tablet_app_'+ identifier!);
|
||||
} else
|
||||
{
|
||||
// mobile specific
|
||||
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+ identifier!);
|
||||
}
|
||||
if(kIsWeb) {
|
||||
//tabletAppContext.clientBrowserMQTT = new MqttBrowserClient(url.replaceAll('http://', ''),'tablet_app_'+ identifier!);
|
||||
} else
|
||||
{
|
||||
print("init mqtt");
|
||||
print(identifier);
|
||||
// mobile specific
|
||||
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('https://api.', ''),'tablet_app_'+ identifier!);
|
||||
}
|
||||
|
||||
setState(() {
|
||||
appContext.setContext(tabletAppContext);
|
||||
setState(() {
|
||||
appContext.setContext(tabletAppContext!);
|
||||
configOk = true;
|
||||
});
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg: "L'url ne correspond pas à un manager",
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
timeInSecForIosWeb: 1,
|
||||
backgroundColor: Colors.redAccent,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0
|
||||
);
|
||||
});
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg: "L'url ne correspond pas à un manager",
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
timeInSecForIosWeb: 1,
|
||||
backgroundColor: Colors.redAccent,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
@ -250,6 +271,10 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
newDevice.ipAddressWLAN = await getIP(true);
|
||||
newDevice.ipAddressETH = await getIP(false);
|
||||
newDevice.name = newDevice.ipAddressWLAN;
|
||||
newDevice.dateCreation = DateTime.now();
|
||||
newDevice.dateUpdate = DateTime.now();
|
||||
newDevice.lastConnectionLevel = DateTime.now();
|
||||
newDevice.lastBatteryLevel = DateTime.now();
|
||||
|
||||
print(newDevice);
|
||||
|
||||
@ -270,7 +295,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
|
||||
appContext.setContext(tabletAppContext);
|
||||
// STORE IT LOCALLY (SQLite)
|
||||
TabletAppContext localContext = await DatabaseHelper.instance.getData();
|
||||
TabletAppContext? localContext = await DatabaseHelper.instance.getData();
|
||||
if (localContext != null) { // Check if sql DB exist
|
||||
await DatabaseHelper.instance.update(tabletAppContext);
|
||||
} else {
|
||||
@ -299,14 +324,13 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
isValidApi(Client client) async {
|
||||
print("TEST URL");
|
||||
Future<InstanceDTO?> getInstanceIdByPinCode(Client client, int pinCode) async {
|
||||
try {
|
||||
var configs = await client.configurationApi!.configurationGet();
|
||||
return configs != null;
|
||||
var instance = await client.instanceApi!.instanceGetInstanceByPinCode(pinCode: pinCode);
|
||||
return instance;
|
||||
} catch (ex) {
|
||||
print(ex);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ info:
|
||||
description: API Manager Service
|
||||
version: Version Alpha
|
||||
servers:
|
||||
- url: https://api.mymuseum.be
|
||||
- url: http://localhost:5000
|
||||
paths:
|
||||
/api/Configuration:
|
||||
get:
|
||||
@ -112,6 +112,39 @@ paths:
|
||||
type: string
|
||||
security:
|
||||
- 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}:
|
||||
get:
|
||||
tags:
|
||||
@ -196,6 +229,12 @@ paths:
|
||||
type: string
|
||||
nullable: true
|
||||
x-position: 1
|
||||
- name: language
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
nullable: true
|
||||
x-position: 2
|
||||
responses:
|
||||
'200':
|
||||
description: ''
|
||||
@ -664,6 +703,37 @@ paths:
|
||||
type: string
|
||||
security:
|
||||
- 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:
|
||||
get:
|
||||
tags:
|
||||
@ -1205,6 +1275,40 @@ paths:
|
||||
type: string
|
||||
security:
|
||||
- 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:
|
||||
put:
|
||||
tags:
|
||||
@ -1654,6 +1758,14 @@ components:
|
||||
instanceId:
|
||||
type: string
|
||||
nullable: true
|
||||
sectionIds:
|
||||
type: array
|
||||
nullable: true
|
||||
items:
|
||||
type: string
|
||||
pinCode:
|
||||
type: integer
|
||||
format: int32
|
||||
TranslationDTO:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
@ -1741,7 +1853,8 @@ components:
|
||||
isBeacon:
|
||||
type: boolean
|
||||
beaconId:
|
||||
type: string
|
||||
type: integer
|
||||
format: int32
|
||||
nullable: true
|
||||
SectionType:
|
||||
type: integer
|
||||
@ -1877,6 +1990,10 @@ components:
|
||||
dateCreation:
|
||||
type: string
|
||||
format: date-time
|
||||
pinCode:
|
||||
type: integer
|
||||
format: int32
|
||||
nullable: true
|
||||
InstanceDTO:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
@ -1890,6 +2007,10 @@ components:
|
||||
dateCreation:
|
||||
type: string
|
||||
format: date-time
|
||||
pinCode:
|
||||
type: integer
|
||||
format: int32
|
||||
nullable: true
|
||||
MapDTO:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
@ -8,6 +8,9 @@ class Client {
|
||||
AuthenticationApi? _authenticationApi;
|
||||
AuthenticationApi? get authenticationApi => _authenticationApi;
|
||||
|
||||
InstanceApi? _instanceApi;
|
||||
InstanceApi? get instanceApi => _instanceApi;
|
||||
|
||||
UserApi? _userApi;
|
||||
UserApi? get userApi => _userApi;
|
||||
|
||||
@ -28,6 +31,7 @@ class Client {
|
||||
basePath: path); // "http://192.168.31.96"
|
||||
//basePath: "https://localhost:44339");
|
||||
_authenticationApi = AuthenticationApi(_apiClient);
|
||||
_instanceApi = InstanceApi(_apiClient);
|
||||
_userApi = UserApi(_apiClient);
|
||||
_configurationApi = ConfigurationApi(_apiClient);
|
||||
_sectionApi = SectionApi(_apiClient);
|
||||
|
||||
@ -25,12 +25,18 @@ void main() async {
|
||||
|
||||
if(localContext != null && localContext.host != null) {
|
||||
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;
|
||||
print(localContext);
|
||||
print("localContext.deviceId");
|
||||
print(localContext.deviceId!);
|
||||
print("localContext.instanceId");
|
||||
print(localContext.instanceId);
|
||||
// Get config from manager
|
||||
DeviceDetailDTO? device = await localContext.clientAPI!.deviceApi!.deviceGetDetail(localContext.deviceId!);
|
||||
localContext.configuration!.id = device!.configurationId;
|
||||
localContext.instanceId = device.instanceId;
|
||||
if (device.configurationId == null) {
|
||||
print("device.configurationId == null");
|
||||
localContext.configuration = null;
|
||||
@ -43,6 +49,9 @@ void main() async {
|
||||
if(kIsWeb) {
|
||||
localContext = TabletAppContext(host: "https://api.mymuseum.be", instanceId: "63514fd67ed8c735aaa4b8f1"); // mymuseum : 63514fd67ed8c735aaa4b8f1
|
||||
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';
|
||||
|
||||
@ -60,7 +60,7 @@ try {
|
||||
|
||||
## 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
|
||||
------------ | ------------- | ------------- | -------------
|
||||
@ -70,6 +70,7 @@ Class | Method | HTTP request | Description
|
||||
*ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
|
||||
*ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
|
||||
*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* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
|
||||
*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* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance |
|
||||
*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 |
|
||||
*ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource |
|
||||
*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* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
|
||||
*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* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
|
||||
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
|
||||
@ -155,7 +158,8 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
## bearer
|
||||
Authentication schemes defined for the API:
|
||||
### bearer
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: password
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
@ -13,6 +13,7 @@ Method | HTTP request | Description
|
||||
[**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
|
||||
[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
|
||||
[**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
|
||||
[**configurationGetConfigurationsByPinCode**](ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
|
||||
[**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
|
||||
[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
|
||||
[**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)
|
||||
|
||||
# **configurationExport**
|
||||
> MultipartFile configurationExport(id)
|
||||
> MultipartFile configurationExport(id, language)
|
||||
|
||||
|
||||
|
||||
@ -117,9 +118,10 @@ import 'package:manager_api/api.dart';
|
||||
|
||||
final api_instance = ConfigurationApi();
|
||||
final id = id_example; // String |
|
||||
final language = language_example; // String |
|
||||
|
||||
try {
|
||||
final result = api_instance.configurationExport(id);
|
||||
final result = api_instance.configurationExport(id, language);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling ConfigurationApi->configurationExport: $e\n');
|
||||
@ -131,6 +133,7 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **String**| |
|
||||
**language** | **String**| | [optional]
|
||||
|
||||
### 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)
|
||||
|
||||
# **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**
|
||||
> ConfigurationDTO configurationGetDetail(id)
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@ Name | Type | Description | Notes
|
||||
**isTablet** | **bool** | | [optional]
|
||||
**isOffline** | **bool** | | [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)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -21,6 +21,8 @@ Name | Type | Description | Notes
|
||||
**isTablet** | **bool** | | [optional]
|
||||
**isOffline** | **bool** | | [optional]
|
||||
**instanceId** | **String** | | [optional]
|
||||
**sectionIds** | **List<String>** | | [optional] [default to const []]
|
||||
**pinCode** | **int** | | [optional]
|
||||
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
|
||||
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ Name | Type | Description | Notes
|
||||
**id** | **String** | | [optional]
|
||||
**name** | **String** | | [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)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
@ -13,6 +13,7 @@ Method | HTTP request | Description
|
||||
[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
|
||||
[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance |
|
||||
[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
|
||||
[**instanceGetInstanceByPinCode**](InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
|
||||
[**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)
|
||||
|
||||
# **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**
|
||||
> InstanceDTO instanceUpdateinstance(instance)
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ Name | Type | Description | Notes
|
||||
**id** | **String** | | [optional]
|
||||
**name** | **String** | | [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)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
@ -13,6 +13,7 @@ Method | HTTP request | Description
|
||||
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
|
||||
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
|
||||
[**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 |
|
||||
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
|
||||
[**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)
|
||||
|
||||
# **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**
|
||||
> List<Object> sectionGetAllSectionSubSections(id)
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ Name | Type | Description | Notes
|
||||
**longitude** | **String** | | [optional]
|
||||
**meterZoneGPS** | **int** | | [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)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
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
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -115,7 +115,9 @@ class ConfigurationApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
Future<Response> configurationExportWithHttpInfo(String id,) async {
|
||||
///
|
||||
/// * [String] language:
|
||||
Future<Response> configurationExportWithHttpInfo(String id, { String? language, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/api/Configuration/{id}/export'
|
||||
.replaceAll('{id}', id);
|
||||
@ -127,6 +129,10 @@ class ConfigurationApi {
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
if (language != null) {
|
||||
queryParams.addAll(_queryParams('', 'language', language));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
@ -144,8 +150,10 @@ class ConfigurationApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [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) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
@ -213,6 +221,60 @@ class ConfigurationApi {
|
||||
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].
|
||||
/// Parameters:
|
||||
///
|
||||
|
||||
@ -203,6 +203,57 @@ class InstanceApi {
|
||||
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].
|
||||
/// Parameters:
|
||||
///
|
||||
|
||||
@ -213,6 +213,57 @@ class SectionApi {
|
||||
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].
|
||||
/// Parameters:
|
||||
///
|
||||
|
||||
@ -11,11 +11,13 @@
|
||||
part of openapi.api;
|
||||
|
||||
class ApiClient {
|
||||
ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication});
|
||||
ApiClient({this.basePath = 'http://localhost:5000', this.authentication,});
|
||||
|
||||
final String basePath;
|
||||
final Authentication? authentication;
|
||||
|
||||
var _client = Client();
|
||||
final _defaultHeaderMap = <String, String>{};
|
||||
|
||||
/// Returns the current HTTP [Client] instance to use in this class.
|
||||
///
|
||||
@ -27,15 +29,12 @@ class ApiClient {
|
||||
_client = newClient;
|
||||
}
|
||||
|
||||
final _defaultHeaderMap = <String, String>{};
|
||||
final Authentication? authentication;
|
||||
Map<String, String> get defaultHeaderMap => _defaultHeaderMap;
|
||||
|
||||
void addDefaultHeader(String key, String value) {
|
||||
_defaultHeaderMap[key] = value;
|
||||
}
|
||||
|
||||
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
|
||||
|
||||
// We don't use a Map<String, String> for queryParams.
|
||||
// If collectionFormat is 'multi', a key might appear multiple times.
|
||||
Future<Response> invokeAPI(
|
||||
@ -47,7 +46,7 @@ class ApiClient {
|
||||
Map<String, String> formParams,
|
||||
String? contentType,
|
||||
) async {
|
||||
_updateParamsForAuth(queryParams, headerParams);
|
||||
await authentication?.applyToParams(queryParams, headerParams);
|
||||
|
||||
headerParams.addAll(_defaultHeaderMap);
|
||||
if (contentType != null) {
|
||||
@ -165,16 +164,6 @@ class ApiClient {
|
||||
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
|
||||
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}) {
|
||||
try {
|
||||
switch (targetType) {
|
||||
@ -190,6 +179,8 @@ class ApiClient {
|
||||
}
|
||||
final valueString = '$value'.toLowerCase();
|
||||
return valueString == 'true' || valueString == '1';
|
||||
case 'DateTime':
|
||||
return value is DateTime ? value : DateTime.tryParse(value);
|
||||
case 'ArticleDTO':
|
||||
return ArticleDTO.fromJson(value);
|
||||
case 'ConfigurationDTO':
|
||||
|
||||
@ -20,7 +20,7 @@ class ApiKeyAuth implements Authentication {
|
||||
String apiKey = '';
|
||||
|
||||
@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';
|
||||
|
||||
if (paramValue.isNotEmpty) {
|
||||
|
||||
@ -13,5 +13,5 @@ part of openapi.api;
|
||||
// ignore: one_member_abstracts
|
||||
abstract class Authentication {
|
||||
/// 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);
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ class HttpBasicAuth implements Authentication {
|
||||
String password;
|
||||
|
||||
@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) {
|
||||
final credentials = '$username:$password';
|
||||
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
|
||||
|
||||
@ -27,7 +27,7 @@ class HttpBearerAuth implements Authentication {
|
||||
}
|
||||
|
||||
@override
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
|
||||
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
|
||||
if (_accessToken == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ class OAuth implements Authentication {
|
||||
String accessToken;
|
||||
|
||||
@override
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
|
||||
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
|
||||
if (accessToken.isNotEmpty) {
|
||||
headerParams['Authorization'] = 'Bearer $accessToken';
|
||||
}
|
||||
|
||||
@ -63,23 +63,33 @@ class ArticleDTO {
|
||||
String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (content != null) {
|
||||
_json[r'content'] = content;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.content != null) {
|
||||
json[r'content'] = this.content;
|
||||
} else {
|
||||
json[r'content'] = null;
|
||||
}
|
||||
if (isContentTop != null) {
|
||||
_json[r'isContentTop'] = isContentTop;
|
||||
if (this.isContentTop != null) {
|
||||
json[r'isContentTop'] = this.isContentTop;
|
||||
} else {
|
||||
json[r'isContentTop'] = null;
|
||||
}
|
||||
if (audioIds != null) {
|
||||
_json[r'audioIds'] = audioIds;
|
||||
if (this.audioIds != null) {
|
||||
json[r'audioIds'] = this.audioIds;
|
||||
} else {
|
||||
json[r'audioIds'] = null;
|
||||
}
|
||||
if (isReadAudioAuto != null) {
|
||||
_json[r'isReadAudioAuto'] = isReadAudioAuto;
|
||||
if (this.isReadAudioAuto != null) {
|
||||
json[r'isReadAudioAuto'] = this.isReadAudioAuto;
|
||||
} else {
|
||||
json[r'isReadAudioAuto'] = null;
|
||||
}
|
||||
if (images != null) {
|
||||
_json[r'images'] = images;
|
||||
if (this.images != null) {
|
||||
json[r'images'] = this.images;
|
||||
} else {
|
||||
json[r'images'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ArticleDTO] instance and imports its values from
|
||||
@ -101,17 +111,17 @@ class ArticleDTO {
|
||||
}());
|
||||
|
||||
return ArticleDTO(
|
||||
content: TranslationDTO.listFromJson(json[r'content']) ?? const [],
|
||||
content: TranslationDTO.listFromJson(json[r'content']),
|
||||
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'),
|
||||
images: ImageDTO.listFromJson(json[r'images']) ?? const [],
|
||||
images: ImageDTO.listFromJson(json[r'images']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ArticleDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ArticleDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ArticleDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -142,12 +152,10 @@ class ArticleDTO {
|
||||
static Map<String, List<ArticleDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ArticleDTO>>{};
|
||||
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) {
|
||||
final value = ArticleDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ArticleDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -26,6 +26,8 @@ class ConfigurationDTO {
|
||||
this.isTablet,
|
||||
this.isOffline,
|
||||
this.instanceId,
|
||||
this.sectionIds = const [],
|
||||
this.pinCode,
|
||||
});
|
||||
|
||||
String? id;
|
||||
@ -78,6 +80,16 @@ class ConfigurationDTO {
|
||||
|
||||
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
|
||||
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
||||
other.id == id &&
|
||||
@ -92,7 +104,9 @@ class ConfigurationDTO {
|
||||
other.isMobile == isMobile &&
|
||||
other.isTablet == isTablet &&
|
||||
other.isOffline == isOffline &&
|
||||
other.instanceId == instanceId;
|
||||
other.instanceId == instanceId &&
|
||||
other.sectionIds == sectionIds &&
|
||||
other.pinCode == pinCode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@ -109,53 +123,91 @@ class ConfigurationDTO {
|
||||
(isMobile == null ? 0 : isMobile!.hashCode) +
|
||||
(isTablet == null ? 0 : isTablet!.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
|
||||
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() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (title != null) {
|
||||
_json[r'title'] = title;
|
||||
if (this.title != null) {
|
||||
json[r'title'] = this.title;
|
||||
} else {
|
||||
json[r'title'] = null;
|
||||
}
|
||||
if (imageId != null) {
|
||||
_json[r'imageId'] = imageId;
|
||||
if (this.imageId != null) {
|
||||
json[r'imageId'] = this.imageId;
|
||||
} else {
|
||||
json[r'imageId'] = null;
|
||||
}
|
||||
if (imageSource != null) {
|
||||
_json[r'imageSource'] = imageSource;
|
||||
if (this.imageSource != null) {
|
||||
json[r'imageSource'] = this.imageSource;
|
||||
} else {
|
||||
json[r'imageSource'] = null;
|
||||
}
|
||||
if (primaryColor != null) {
|
||||
_json[r'primaryColor'] = primaryColor;
|
||||
if (this.primaryColor != null) {
|
||||
json[r'primaryColor'] = this.primaryColor;
|
||||
} else {
|
||||
json[r'primaryColor'] = null;
|
||||
}
|
||||
if (secondaryColor != null) {
|
||||
_json[r'secondaryColor'] = secondaryColor;
|
||||
if (this.secondaryColor != null) {
|
||||
json[r'secondaryColor'] = this.secondaryColor;
|
||||
} else {
|
||||
json[r'secondaryColor'] = null;
|
||||
}
|
||||
if (languages != null) {
|
||||
_json[r'languages'] = languages;
|
||||
if (this.languages != null) {
|
||||
json[r'languages'] = this.languages;
|
||||
} else {
|
||||
json[r'languages'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (isMobile != null) {
|
||||
_json[r'isMobile'] = isMobile;
|
||||
if (this.isMobile != null) {
|
||||
json[r'isMobile'] = this.isMobile;
|
||||
} else {
|
||||
json[r'isMobile'] = null;
|
||||
}
|
||||
if (isTablet != null) {
|
||||
_json[r'isTablet'] = isTablet;
|
||||
if (this.isTablet != null) {
|
||||
json[r'isTablet'] = this.isTablet;
|
||||
} else {
|
||||
json[r'isTablet'] = null;
|
||||
}
|
||||
if (isOffline != null) {
|
||||
_json[r'isOffline'] = isOffline;
|
||||
if (this.isOffline != null) {
|
||||
json[r'isOffline'] = this.isOffline;
|
||||
} else {
|
||||
json[r'isOffline'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
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
|
||||
@ -179,7 +231,7 @@ class ConfigurationDTO {
|
||||
return ConfigurationDTO(
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
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'),
|
||||
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||
@ -192,12 +244,16 @@ class ConfigurationDTO {
|
||||
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
||||
isOffline: mapValueOfType<bool>(json, r'isOffline'),
|
||||
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;
|
||||
}
|
||||
|
||||
static List<ConfigurationDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ConfigurationDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ConfigurationDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -228,12 +284,10 @@ class ConfigurationDTO {
|
||||
static Map<String, List<ConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ConfigurationDTO>>{};
|
||||
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) {
|
||||
final value = ConfigurationDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ConfigurationDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -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]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (identifier != null) {
|
||||
_json[r'identifier'] = identifier;
|
||||
if (this.identifier != null) {
|
||||
json[r'identifier'] = this.identifier;
|
||||
} else {
|
||||
json[r'identifier'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (ipAddressWLAN != null) {
|
||||
_json[r'ipAddressWLAN'] = ipAddressWLAN;
|
||||
if (this.ipAddressWLAN != null) {
|
||||
json[r'ipAddressWLAN'] = this.ipAddressWLAN;
|
||||
} else {
|
||||
json[r'ipAddressWLAN'] = null;
|
||||
}
|
||||
if (ipAddressETH != null) {
|
||||
_json[r'ipAddressETH'] = ipAddressETH;
|
||||
if (this.ipAddressETH != null) {
|
||||
json[r'ipAddressETH'] = this.ipAddressETH;
|
||||
} else {
|
||||
json[r'ipAddressETH'] = null;
|
||||
}
|
||||
if (configurationId != null) {
|
||||
_json[r'configurationId'] = configurationId;
|
||||
if (this.configurationId != null) {
|
||||
json[r'configurationId'] = this.configurationId;
|
||||
} else {
|
||||
json[r'configurationId'] = null;
|
||||
}
|
||||
if (configuration != null) {
|
||||
_json[r'configuration'] = configuration;
|
||||
if (this.configuration != null) {
|
||||
json[r'configuration'] = this.configuration;
|
||||
} else {
|
||||
json[r'configuration'] = null;
|
||||
}
|
||||
if (connected != null) {
|
||||
_json[r'connected'] = connected;
|
||||
if (this.connected != null) {
|
||||
json[r'connected'] = this.connected;
|
||||
} else {
|
||||
json[r'connected'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (dateUpdate != null) {
|
||||
_json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String();
|
||||
if (this.dateUpdate != null) {
|
||||
json[r'dateUpdate'] = this.dateUpdate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateUpdate'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
if (connectionLevel != null) {
|
||||
_json[r'connectionLevel'] = connectionLevel;
|
||||
if (this.connectionLevel != null) {
|
||||
json[r'connectionLevel'] = this.connectionLevel;
|
||||
} else {
|
||||
json[r'connectionLevel'] = null;
|
||||
}
|
||||
if (lastConnectionLevel != null) {
|
||||
_json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String();
|
||||
if (this.lastConnectionLevel != null) {
|
||||
json[r'lastConnectionLevel'] = this.lastConnectionLevel!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'lastConnectionLevel'] = null;
|
||||
}
|
||||
if (batteryLevel != null) {
|
||||
_json[r'batteryLevel'] = batteryLevel;
|
||||
if (this.batteryLevel != null) {
|
||||
json[r'batteryLevel'] = this.batteryLevel;
|
||||
} else {
|
||||
json[r'batteryLevel'] = null;
|
||||
}
|
||||
if (lastBatteryLevel != null) {
|
||||
_json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String();
|
||||
if (this.lastBatteryLevel != null) {
|
||||
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
|
||||
@ -219,7 +249,7 @@ class DeviceDetailDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeviceDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<DeviceDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceDetailDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -250,12 +280,10 @@ class DeviceDetailDTO {
|
||||
static Map<String, List<DeviceDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeviceDetailDTO>>{};
|
||||
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) {
|
||||
final value = DeviceDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = DeviceDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -58,20 +58,28 @@ class DeviceDetailDTOAllOf {
|
||||
String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (connectionLevel != null) {
|
||||
_json[r'connectionLevel'] = connectionLevel;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.connectionLevel != null) {
|
||||
json[r'connectionLevel'] = this.connectionLevel;
|
||||
} else {
|
||||
json[r'connectionLevel'] = null;
|
||||
}
|
||||
if (lastConnectionLevel != null) {
|
||||
_json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String();
|
||||
if (this.lastConnectionLevel != null) {
|
||||
json[r'lastConnectionLevel'] = this.lastConnectionLevel!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'lastConnectionLevel'] = null;
|
||||
}
|
||||
if (batteryLevel != null) {
|
||||
_json[r'batteryLevel'] = batteryLevel;
|
||||
if (this.batteryLevel != null) {
|
||||
json[r'batteryLevel'] = this.batteryLevel;
|
||||
} else {
|
||||
json[r'batteryLevel'] = null;
|
||||
}
|
||||
if (lastBatteryLevel != null) {
|
||||
_json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String();
|
||||
if (this.lastBatteryLevel != null) {
|
||||
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
|
||||
@ -102,7 +110,7 @@ class DeviceDetailDTOAllOf {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeviceDetailDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<DeviceDetailDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceDetailDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -133,12 +141,10 @@ class DeviceDetailDTOAllOf {
|
||||
static Map<String, List<DeviceDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeviceDetailDTOAllOf>>{};
|
||||
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) {
|
||||
final value = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -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]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (identifier != null) {
|
||||
_json[r'identifier'] = identifier;
|
||||
if (this.identifier != null) {
|
||||
json[r'identifier'] = this.identifier;
|
||||
} else {
|
||||
json[r'identifier'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (ipAddressWLAN != null) {
|
||||
_json[r'ipAddressWLAN'] = ipAddressWLAN;
|
||||
if (this.ipAddressWLAN != null) {
|
||||
json[r'ipAddressWLAN'] = this.ipAddressWLAN;
|
||||
} else {
|
||||
json[r'ipAddressWLAN'] = null;
|
||||
}
|
||||
if (ipAddressETH != null) {
|
||||
_json[r'ipAddressETH'] = ipAddressETH;
|
||||
if (this.ipAddressETH != null) {
|
||||
json[r'ipAddressETH'] = this.ipAddressETH;
|
||||
} else {
|
||||
json[r'ipAddressETH'] = null;
|
||||
}
|
||||
if (configurationId != null) {
|
||||
_json[r'configurationId'] = configurationId;
|
||||
if (this.configurationId != null) {
|
||||
json[r'configurationId'] = this.configurationId;
|
||||
} else {
|
||||
json[r'configurationId'] = null;
|
||||
}
|
||||
if (configuration != null) {
|
||||
_json[r'configuration'] = configuration;
|
||||
if (this.configuration != null) {
|
||||
json[r'configuration'] = this.configuration;
|
||||
} else {
|
||||
json[r'configuration'] = null;
|
||||
}
|
||||
if (connected != null) {
|
||||
_json[r'connected'] = connected;
|
||||
if (this.connected != null) {
|
||||
json[r'connected'] = this.connected;
|
||||
} else {
|
||||
json[r'connected'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (dateUpdate != null) {
|
||||
_json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String();
|
||||
if (this.dateUpdate != null) {
|
||||
json[r'dateUpdate'] = this.dateUpdate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateUpdate'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeviceDTO] instance and imports its values from
|
||||
@ -171,7 +193,7 @@ class DeviceDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeviceDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<DeviceDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -202,12 +224,10 @@ class DeviceDTO {
|
||||
static Map<String, List<DeviceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeviceDTO>>{};
|
||||
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) {
|
||||
final value = DeviceDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = DeviceDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -26,6 +26,8 @@ class ExportConfigurationDTO {
|
||||
this.isTablet,
|
||||
this.isOffline,
|
||||
this.instanceId,
|
||||
this.sectionIds = const [],
|
||||
this.pinCode,
|
||||
this.sections = const [],
|
||||
this.resources = const [],
|
||||
});
|
||||
@ -80,6 +82,16 @@ class ExportConfigurationDTO {
|
||||
|
||||
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<ResourceDTO>? resources;
|
||||
@ -99,6 +111,8 @@ class ExportConfigurationDTO {
|
||||
other.isTablet == isTablet &&
|
||||
other.isOffline == isOffline &&
|
||||
other.instanceId == instanceId &&
|
||||
other.sectionIds == sectionIds &&
|
||||
other.pinCode == pinCode &&
|
||||
other.sections == sections &&
|
||||
other.resources == resources;
|
||||
|
||||
@ -118,60 +132,102 @@ class ExportConfigurationDTO {
|
||||
(isTablet == null ? 0 : isTablet!.hashCode) +
|
||||
(isOffline == null ? 0 : isOffline!.hashCode) +
|
||||
(instanceId == null ? 0 : instanceId!.hashCode) +
|
||||
(sectionIds == null ? 0 : sectionIds!.hashCode) +
|
||||
(pinCode == null ? 0 : pinCode!.hashCode) +
|
||||
(sections == null ? 0 : sections!.hashCode) +
|
||||
(resources == null ? 0 : resources!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, 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() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (title != null) {
|
||||
_json[r'title'] = title;
|
||||
if (this.title != null) {
|
||||
json[r'title'] = this.title;
|
||||
} else {
|
||||
json[r'title'] = null;
|
||||
}
|
||||
if (imageId != null) {
|
||||
_json[r'imageId'] = imageId;
|
||||
if (this.imageId != null) {
|
||||
json[r'imageId'] = this.imageId;
|
||||
} else {
|
||||
json[r'imageId'] = null;
|
||||
}
|
||||
if (imageSource != null) {
|
||||
_json[r'imageSource'] = imageSource;
|
||||
if (this.imageSource != null) {
|
||||
json[r'imageSource'] = this.imageSource;
|
||||
} else {
|
||||
json[r'imageSource'] = null;
|
||||
}
|
||||
if (primaryColor != null) {
|
||||
_json[r'primaryColor'] = primaryColor;
|
||||
if (this.primaryColor != null) {
|
||||
json[r'primaryColor'] = this.primaryColor;
|
||||
} else {
|
||||
json[r'primaryColor'] = null;
|
||||
}
|
||||
if (secondaryColor != null) {
|
||||
_json[r'secondaryColor'] = secondaryColor;
|
||||
if (this.secondaryColor != null) {
|
||||
json[r'secondaryColor'] = this.secondaryColor;
|
||||
} else {
|
||||
json[r'secondaryColor'] = null;
|
||||
}
|
||||
if (languages != null) {
|
||||
_json[r'languages'] = languages;
|
||||
if (this.languages != null) {
|
||||
json[r'languages'] = this.languages;
|
||||
} else {
|
||||
json[r'languages'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (isMobile != null) {
|
||||
_json[r'isMobile'] = isMobile;
|
||||
if (this.isMobile != null) {
|
||||
json[r'isMobile'] = this.isMobile;
|
||||
} else {
|
||||
json[r'isMobile'] = null;
|
||||
}
|
||||
if (isTablet != null) {
|
||||
_json[r'isTablet'] = isTablet;
|
||||
if (this.isTablet != null) {
|
||||
json[r'isTablet'] = this.isTablet;
|
||||
} else {
|
||||
json[r'isTablet'] = null;
|
||||
}
|
||||
if (isOffline != null) {
|
||||
_json[r'isOffline'] = isOffline;
|
||||
if (this.isOffline != null) {
|
||||
json[r'isOffline'] = this.isOffline;
|
||||
} else {
|
||||
json[r'isOffline'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
if (sections != null) {
|
||||
_json[r'sections'] = sections;
|
||||
if (this.sectionIds != null) {
|
||||
json[r'sectionIds'] = this.sectionIds;
|
||||
} else {
|
||||
json[r'sectionIds'] = null;
|
||||
}
|
||||
if (resources != null) {
|
||||
_json[r'resources'] = resources;
|
||||
if (this.pinCode != null) {
|
||||
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
|
||||
@ -195,7 +251,7 @@ class ExportConfigurationDTO {
|
||||
return ExportConfigurationDTO(
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
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'),
|
||||
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||
@ -208,14 +264,18 @@ class ExportConfigurationDTO {
|
||||
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
||||
isOffline: mapValueOfType<bool>(json, r'isOffline'),
|
||||
instanceId: mapValueOfType<String>(json, r'instanceId'),
|
||||
sections: SectionDTO.listFromJson(json[r'sections']) ?? const [],
|
||||
resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [],
|
||||
sectionIds: json[r'sectionIds'] is List
|
||||
? (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;
|
||||
}
|
||||
|
||||
static List<ExportConfigurationDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ExportConfigurationDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ExportConfigurationDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -246,12 +306,10 @@ class ExportConfigurationDTO {
|
||||
static Map<String, List<ExportConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ExportConfigurationDTO>>{};
|
||||
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) {
|
||||
final value = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class ExportConfigurationDTOAllOf {
|
||||
String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (sections != null) {
|
||||
_json[r'sections'] = sections;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.sections != null) {
|
||||
json[r'sections'] = this.sections;
|
||||
} else {
|
||||
json[r'sections'] = null;
|
||||
}
|
||||
if (resources != null) {
|
||||
_json[r'resources'] = resources;
|
||||
if (this.resources != null) {
|
||||
json[r'resources'] = this.resources;
|
||||
} else {
|
||||
json[r'resources'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from
|
||||
@ -65,14 +69,14 @@ class ExportConfigurationDTOAllOf {
|
||||
}());
|
||||
|
||||
return ExportConfigurationDTOAllOf(
|
||||
sections: SectionDTO.listFromJson(json[r'sections']) ?? const [],
|
||||
resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [],
|
||||
sections: SectionDTO.listFromJson(json[r'sections']),
|
||||
resources: ResourceDTO.listFromJson(json[r'resources']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ExportConfigurationDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ExportConfigurationDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ExportConfigurationDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class ExportConfigurationDTOAllOf {
|
||||
static Map<String, List<ExportConfigurationDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ExportConfigurationDTOAllOf>>{};
|
||||
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) {
|
||||
final value = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -62,26 +62,38 @@ class GeoPointDTO {
|
||||
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (title != null) {
|
||||
_json[r'title'] = title;
|
||||
if (this.title != null) {
|
||||
json[r'title'] = this.title;
|
||||
} else {
|
||||
json[r'title'] = null;
|
||||
}
|
||||
if (description != null) {
|
||||
_json[r'description'] = description;
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
} else {
|
||||
json[r'description'] = null;
|
||||
}
|
||||
if (images != null) {
|
||||
_json[r'images'] = images;
|
||||
if (this.images != null) {
|
||||
json[r'images'] = this.images;
|
||||
} else {
|
||||
json[r'images'] = null;
|
||||
}
|
||||
if (latitude != null) {
|
||||
_json[r'latitude'] = latitude;
|
||||
if (this.latitude != null) {
|
||||
json[r'latitude'] = this.latitude;
|
||||
} else {
|
||||
json[r'latitude'] = null;
|
||||
}
|
||||
if (longitude != null) {
|
||||
_json[r'longitude'] = longitude;
|
||||
if (this.longitude != null) {
|
||||
json[r'longitude'] = this.longitude;
|
||||
} else {
|
||||
json[r'longitude'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [GeoPointDTO] instance and imports its values from
|
||||
@ -104,9 +116,9 @@ class GeoPointDTO {
|
||||
|
||||
return GeoPointDTO(
|
||||
id: mapValueOfType<int>(json, r'id'),
|
||||
title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
|
||||
description: TranslationDTO.listFromJson(json[r'description']) ?? const [],
|
||||
images: ImageGeoPoint.listFromJson(json[r'images']) ?? const [],
|
||||
title: TranslationDTO.listFromJson(json[r'title']),
|
||||
description: TranslationDTO.listFromJson(json[r'description']),
|
||||
images: ImageGeoPoint.listFromJson(json[r'images']),
|
||||
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||
);
|
||||
@ -114,7 +126,7 @@ class GeoPointDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<GeoPointDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<GeoPointDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <GeoPointDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -145,12 +157,10 @@ class GeoPointDTO {
|
||||
static Map<String, List<GeoPointDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<GeoPointDTO>>{};
|
||||
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) {
|
||||
final value = GeoPointDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = GeoPointDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -57,23 +57,33 @@ class ImageDTO {
|
||||
String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (title != null) {
|
||||
_json[r'title'] = title;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.title != null) {
|
||||
json[r'title'] = this.title;
|
||||
} else {
|
||||
json[r'title'] = null;
|
||||
}
|
||||
if (description != null) {
|
||||
_json[r'description'] = description;
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
} else {
|
||||
json[r'description'] = null;
|
||||
}
|
||||
if (resourceId != null) {
|
||||
_json[r'resourceId'] = resourceId;
|
||||
if (this.resourceId != null) {
|
||||
json[r'resourceId'] = this.resourceId;
|
||||
} else {
|
||||
json[r'resourceId'] = null;
|
||||
}
|
||||
if (source_ != null) {
|
||||
_json[r'source'] = source_;
|
||||
if (this.source_ != null) {
|
||||
json[r'source'] = this.source_;
|
||||
} else {
|
||||
json[r'source'] = null;
|
||||
}
|
||||
if (order != null) {
|
||||
_json[r'order'] = order;
|
||||
if (this.order != null) {
|
||||
json[r'order'] = this.order;
|
||||
} else {
|
||||
json[r'order'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ImageDTO] instance and imports its values from
|
||||
@ -95,8 +105,8 @@ class ImageDTO {
|
||||
}());
|
||||
|
||||
return ImageDTO(
|
||||
title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
|
||||
description: TranslationDTO.listFromJson(json[r'description']) ?? const [],
|
||||
title: TranslationDTO.listFromJson(json[r'title']),
|
||||
description: TranslationDTO.listFromJson(json[r'description']),
|
||||
resourceId: mapValueOfType<String>(json, r'resourceId'),
|
||||
source_: mapValueOfType<String>(json, r'source'),
|
||||
order: mapValueOfType<int>(json, r'order'),
|
||||
@ -105,7 +115,7 @@ class ImageDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ImageDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ImageDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ImageDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -136,12 +146,10 @@ class ImageDTO {
|
||||
static Map<String, List<ImageDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ImageDTO>>{};
|
||||
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) {
|
||||
final value = ImageDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ImageDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class ImageGeoPoint {
|
||||
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (imageResourceId != null) {
|
||||
_json[r'imageResourceId'] = imageResourceId;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.imageResourceId != null) {
|
||||
json[r'imageResourceId'] = this.imageResourceId;
|
||||
} else {
|
||||
json[r'imageResourceId'] = null;
|
||||
}
|
||||
if (imageSource != null) {
|
||||
_json[r'imageSource'] = imageSource;
|
||||
if (this.imageSource != null) {
|
||||
json[r'imageSource'] = this.imageSource;
|
||||
} else {
|
||||
json[r'imageSource'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ImageGeoPoint] instance and imports its values from
|
||||
@ -72,7 +76,7 @@ class ImageGeoPoint {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ImageGeoPoint>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ImageGeoPoint> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ImageGeoPoint>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class ImageGeoPoint {
|
||||
static Map<String, List<ImageGeoPoint>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ImageGeoPoint>>{};
|
||||
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) {
|
||||
final value = ImageGeoPoint.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ImageGeoPoint.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -16,6 +16,7 @@ class Instance {
|
||||
this.id,
|
||||
this.name,
|
||||
this.dateCreation,
|
||||
this.pinCode,
|
||||
});
|
||||
|
||||
String? id;
|
||||
@ -30,34 +31,49 @@ class Instance {
|
||||
///
|
||||
DateTime? dateCreation;
|
||||
|
||||
int? pinCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is Instance &&
|
||||
other.id == id &&
|
||||
other.name == name &&
|
||||
other.dateCreation == dateCreation;
|
||||
other.dateCreation == dateCreation &&
|
||||
other.pinCode == pinCode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id == null ? 0 : id!.hashCode) +
|
||||
(name == null ? 0 : name!.hashCode) +
|
||||
(dateCreation == null ? 0 : dateCreation!.hashCode);
|
||||
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||
(pinCode == null ? 0 : pinCode!.hashCode);
|
||||
|
||||
@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() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
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
|
||||
@ -82,12 +98,13 @@ class Instance {
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
name: mapValueOfType<String>(json, r'name'),
|
||||
dateCreation: mapDateTime(json, r'dateCreation', ''),
|
||||
pinCode: mapValueOfType<int>(json, r'pinCode'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<Instance>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<Instance> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <Instance>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -118,12 +135,10 @@ class Instance {
|
||||
static Map<String, List<Instance>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<Instance>>{};
|
||||
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) {
|
||||
final value = Instance.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = Instance.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -16,6 +16,7 @@ class InstanceDTO {
|
||||
this.id,
|
||||
this.name,
|
||||
this.dateCreation,
|
||||
this.pinCode,
|
||||
});
|
||||
|
||||
String? id;
|
||||
@ -30,34 +31,49 @@ class InstanceDTO {
|
||||
///
|
||||
DateTime? dateCreation;
|
||||
|
||||
int? pinCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is InstanceDTO &&
|
||||
other.id == id &&
|
||||
other.name == name &&
|
||||
other.dateCreation == dateCreation;
|
||||
other.dateCreation == dateCreation &&
|
||||
other.pinCode == pinCode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id == null ? 0 : id!.hashCode) +
|
||||
(name == null ? 0 : name!.hashCode) +
|
||||
(dateCreation == null ? 0 : dateCreation!.hashCode);
|
||||
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||
(pinCode == null ? 0 : pinCode!.hashCode);
|
||||
|
||||
@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() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
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
|
||||
@ -82,12 +98,13 @@ class InstanceDTO {
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
name: mapValueOfType<String>(json, r'name'),
|
||||
dateCreation: mapDateTime(json, r'dateCreation', ''),
|
||||
pinCode: mapValueOfType<int>(json, r'pinCode'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<InstanceDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<InstanceDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <InstanceDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -118,12 +135,10 @@ class InstanceDTO {
|
||||
static Map<String, List<InstanceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<InstanceDTO>>{};
|
||||
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) {
|
||||
final value = InstanceDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = InstanceDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -41,17 +41,23 @@ class LevelDTO {
|
||||
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (resourceId != null) {
|
||||
_json[r'resourceId'] = resourceId;
|
||||
if (this.resourceId != null) {
|
||||
json[r'resourceId'] = this.resourceId;
|
||||
} else {
|
||||
json[r'resourceId'] = null;
|
||||
}
|
||||
if (source_ != null) {
|
||||
_json[r'source'] = source_;
|
||||
if (this.source_ != null) {
|
||||
json[r'source'] = this.source_;
|
||||
} else {
|
||||
json[r'source'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [LevelDTO] instance and imports its values from
|
||||
@ -73,7 +79,7 @@ class LevelDTO {
|
||||
}());
|
||||
|
||||
return LevelDTO(
|
||||
label: TranslationDTO.listFromJson(json[r'label']) ?? const [],
|
||||
label: TranslationDTO.listFromJson(json[r'label']),
|
||||
resourceId: mapValueOfType<String>(json, r'resourceId'),
|
||||
source_: mapValueOfType<String>(json, r'source'),
|
||||
);
|
||||
@ -81,7 +87,7 @@ class LevelDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<LevelDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<LevelDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <LevelDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -112,12 +118,10 @@ class LevelDTO {
|
||||
static Map<String, List<LevelDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<LevelDTO>>{};
|
||||
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) {
|
||||
final value = LevelDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = LevelDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class LoginDTO {
|
||||
String toString() => 'LoginDTO[email=$email, password=$password]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (email != null) {
|
||||
_json[r'email'] = email;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.email != null) {
|
||||
json[r'email'] = this.email;
|
||||
} else {
|
||||
json[r'email'] = null;
|
||||
}
|
||||
if (password != null) {
|
||||
_json[r'password'] = password;
|
||||
if (this.password != null) {
|
||||
json[r'password'] = this.password;
|
||||
} else {
|
||||
json[r'password'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [LoginDTO] instance and imports its values from
|
||||
@ -72,7 +76,7 @@ class LoginDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<LoginDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<LoginDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <LoginDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class LoginDTO {
|
||||
static Map<String, List<LoginDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<LoginDTO>>{};
|
||||
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) {
|
||||
final value = LoginDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = LoginDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -63,23 +63,33 @@ class MapDTO {
|
||||
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (zoom != null) {
|
||||
_json[r'zoom'] = zoom;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.zoom != null) {
|
||||
json[r'zoom'] = this.zoom;
|
||||
} else {
|
||||
json[r'zoom'] = null;
|
||||
}
|
||||
if (mapType != null) {
|
||||
_json[r'mapType'] = mapType;
|
||||
if (this.mapType != null) {
|
||||
json[r'mapType'] = this.mapType;
|
||||
} else {
|
||||
json[r'mapType'] = null;
|
||||
}
|
||||
if (points != null) {
|
||||
_json[r'points'] = points;
|
||||
if (this.points != null) {
|
||||
json[r'points'] = this.points;
|
||||
} else {
|
||||
json[r'points'] = null;
|
||||
}
|
||||
if (iconResourceId != null) {
|
||||
_json[r'iconResourceId'] = iconResourceId;
|
||||
if (this.iconResourceId != null) {
|
||||
json[r'iconResourceId'] = this.iconResourceId;
|
||||
} else {
|
||||
json[r'iconResourceId'] = null;
|
||||
}
|
||||
if (iconSource != null) {
|
||||
_json[r'iconSource'] = iconSource;
|
||||
if (this.iconSource != null) {
|
||||
json[r'iconSource'] = this.iconSource;
|
||||
} else {
|
||||
json[r'iconSource'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MapDTO] instance and imports its values from
|
||||
@ -103,7 +113,7 @@ class MapDTO {
|
||||
return MapDTO(
|
||||
zoom: mapValueOfType<int>(json, r'zoom'),
|
||||
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'),
|
||||
iconSource: mapValueOfType<String>(json, r'iconSource'),
|
||||
);
|
||||
@ -111,7 +121,7 @@ class MapDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MapDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<MapDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MapDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -142,12 +152,10 @@ class MapDTO {
|
||||
static Map<String, List<MapDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MapDTO>>{};
|
||||
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) {
|
||||
final value = MapDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = MapDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -40,7 +40,7 @@ class MapTypeApp {
|
||||
|
||||
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>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
|
||||
@ -31,11 +31,13 @@ class MenuDTO {
|
||||
String toString() => 'MenuDTO[sections=$sections]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (sections != null) {
|
||||
_json[r'sections'] = sections;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.sections != null) {
|
||||
json[r'sections'] = this.sections;
|
||||
} else {
|
||||
json[r'sections'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MenuDTO] instance and imports its values from
|
||||
@ -57,13 +59,13 @@ class MenuDTO {
|
||||
}());
|
||||
|
||||
return MenuDTO(
|
||||
sections: SectionDTO.listFromJson(json[r'sections']) ?? const [],
|
||||
sections: SectionDTO.listFromJson(json[r'sections']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MenuDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<MenuDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MenuDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -94,12 +96,10 @@ class MenuDTO {
|
||||
static Map<String, List<MenuDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MenuDTO>>{};
|
||||
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) {
|
||||
final value = MenuDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = MenuDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -48,14 +48,18 @@ class PlayerMessageDTO {
|
||||
String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (configChanged != null) {
|
||||
_json[r'configChanged'] = configChanged;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.configChanged != null) {
|
||||
json[r'configChanged'] = this.configChanged;
|
||||
} else {
|
||||
json[r'configChanged'] = null;
|
||||
}
|
||||
if (isDeleted != null) {
|
||||
_json[r'isDeleted'] = isDeleted;
|
||||
if (this.isDeleted != null) {
|
||||
json[r'isDeleted'] = this.isDeleted;
|
||||
} else {
|
||||
json[r'isDeleted'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [PlayerMessageDTO] instance and imports its values from
|
||||
@ -84,7 +88,7 @@ class PlayerMessageDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<PlayerMessageDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<PlayerMessageDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <PlayerMessageDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -115,12 +119,10 @@ class PlayerMessageDTO {
|
||||
static Map<String, List<PlayerMessageDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<PlayerMessageDTO>>{};
|
||||
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) {
|
||||
final value = PlayerMessageDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = PlayerMessageDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -57,23 +57,33 @@ class QuestionDTO {
|
||||
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (responses != null) {
|
||||
_json[r'responses'] = responses;
|
||||
if (this.responses != null) {
|
||||
json[r'responses'] = this.responses;
|
||||
} else {
|
||||
json[r'responses'] = null;
|
||||
}
|
||||
if (resourceId != null) {
|
||||
_json[r'resourceId'] = resourceId;
|
||||
if (this.resourceId != null) {
|
||||
json[r'resourceId'] = this.resourceId;
|
||||
} else {
|
||||
json[r'resourceId'] = null;
|
||||
}
|
||||
if (source_ != null) {
|
||||
_json[r'source'] = source_;
|
||||
if (this.source_ != null) {
|
||||
json[r'source'] = this.source_;
|
||||
} else {
|
||||
json[r'source'] = null;
|
||||
}
|
||||
if (order != null) {
|
||||
_json[r'order'] = order;
|
||||
if (this.order != null) {
|
||||
json[r'order'] = this.order;
|
||||
} else {
|
||||
json[r'order'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [QuestionDTO] instance and imports its values from
|
||||
@ -95,8 +105,8 @@ class QuestionDTO {
|
||||
}());
|
||||
|
||||
return QuestionDTO(
|
||||
label: TranslationDTO.listFromJson(json[r'label']) ?? const [],
|
||||
responses: ResponseDTO.listFromJson(json[r'responses']) ?? const [],
|
||||
label: TranslationDTO.listFromJson(json[r'label']),
|
||||
responses: ResponseDTO.listFromJson(json[r'responses']),
|
||||
resourceId: mapValueOfType<String>(json, r'resourceId'),
|
||||
source_: mapValueOfType<String>(json, r'source'),
|
||||
order: mapValueOfType<int>(json, r'order'),
|
||||
@ -105,7 +115,7 @@ class QuestionDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<QuestionDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<QuestionDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QuestionDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -136,12 +146,10 @@ class QuestionDTO {
|
||||
static Map<String, List<QuestionDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QuestionDTO>>{};
|
||||
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) {
|
||||
final value = QuestionDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = QuestionDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -51,23 +51,33 @@ class QuizzDTO {
|
||||
String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (questions != null) {
|
||||
_json[r'questions'] = questions;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.questions != null) {
|
||||
json[r'questions'] = this.questions;
|
||||
} else {
|
||||
json[r'questions'] = null;
|
||||
}
|
||||
if (badLevel != null) {
|
||||
_json[r'bad_level'] = badLevel;
|
||||
if (this.badLevel != null) {
|
||||
json[r'bad_level'] = this.badLevel;
|
||||
} else {
|
||||
json[r'bad_level'] = null;
|
||||
}
|
||||
if (mediumLevel != null) {
|
||||
_json[r'medium_level'] = mediumLevel;
|
||||
if (this.mediumLevel != null) {
|
||||
json[r'medium_level'] = this.mediumLevel;
|
||||
} else {
|
||||
json[r'medium_level'] = null;
|
||||
}
|
||||
if (goodLevel != null) {
|
||||
_json[r'good_level'] = goodLevel;
|
||||
if (this.goodLevel != null) {
|
||||
json[r'good_level'] = this.goodLevel;
|
||||
} else {
|
||||
json[r'good_level'] = null;
|
||||
}
|
||||
if (greatLevel != null) {
|
||||
_json[r'great_level'] = greatLevel;
|
||||
if (this.greatLevel != null) {
|
||||
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
|
||||
@ -89,7 +99,7 @@ class QuizzDTO {
|
||||
}());
|
||||
|
||||
return QuizzDTO(
|
||||
questions: QuestionDTO.listFromJson(json[r'questions']) ?? const [],
|
||||
questions: QuestionDTO.listFromJson(json[r'questions']),
|
||||
badLevel: QuizzDTOBadLevel.fromJson(json[r'bad_level']),
|
||||
mediumLevel: QuizzDTOBadLevel.fromJson(json[r'medium_level']),
|
||||
goodLevel: QuizzDTOBadLevel.fromJson(json[r'good_level']),
|
||||
@ -99,7 +109,7 @@ class QuizzDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<QuizzDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<QuizzDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QuizzDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -130,12 +140,10 @@ class QuizzDTO {
|
||||
static Map<String, List<QuizzDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QuizzDTO>>{};
|
||||
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) {
|
||||
final value = QuizzDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = QuizzDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -41,17 +41,23 @@ class QuizzDTOBadLevel {
|
||||
String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, source_=$source_]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (resourceId != null) {
|
||||
_json[r'resourceId'] = resourceId;
|
||||
if (this.resourceId != null) {
|
||||
json[r'resourceId'] = this.resourceId;
|
||||
} else {
|
||||
json[r'resourceId'] = null;
|
||||
}
|
||||
if (source_ != null) {
|
||||
_json[r'source'] = source_;
|
||||
if (this.source_ != null) {
|
||||
json[r'source'] = this.source_;
|
||||
} else {
|
||||
json[r'source'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [QuizzDTOBadLevel] instance and imports its values from
|
||||
@ -73,7 +79,7 @@ class QuizzDTOBadLevel {
|
||||
}());
|
||||
|
||||
return QuizzDTOBadLevel(
|
||||
label: TranslationDTO.listFromJson(json[r'label']) ?? const [],
|
||||
label: TranslationDTO.listFromJson(json[r'label']),
|
||||
resourceId: mapValueOfType<String>(json, r'resourceId'),
|
||||
source_: mapValueOfType<String>(json, r'source'),
|
||||
);
|
||||
@ -81,7 +87,7 @@ class QuizzDTOBadLevel {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<QuizzDTOBadLevel>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<QuizzDTOBadLevel> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QuizzDTOBadLevel>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -112,12 +118,10 @@ class QuizzDTOBadLevel {
|
||||
static Map<String, List<QuizzDTOBadLevel>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QuizzDTOBadLevel>>{};
|
||||
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) {
|
||||
final value = QuizzDTOBadLevel.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = QuizzDTOBadLevel.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -68,26 +68,38 @@ class ResourceDTO {
|
||||
String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data, dateCreation=$dateCreation, instanceId=$instanceId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (data != null) {
|
||||
_json[r'data'] = data;
|
||||
if (this.data != null) {
|
||||
json[r'data'] = this.data;
|
||||
} else {
|
||||
json[r'data'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ResourceDTO] instance and imports its values from
|
||||
@ -120,7 +132,7 @@ class ResourceDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ResourceDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ResourceDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ResourceDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -151,12 +163,10 @@ class ResourceDTO {
|
||||
static Map<String, List<ResourceDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ResourceDTO>>{};
|
||||
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) {
|
||||
final value = ResourceDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ResourceDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -40,7 +40,7 @@ class ResourceType {
|
||||
|
||||
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>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
|
||||
@ -53,17 +53,23 @@ class ResponseDTO {
|
||||
String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (isGood != null) {
|
||||
_json[r'isGood'] = isGood;
|
||||
if (this.isGood != null) {
|
||||
json[r'isGood'] = this.isGood;
|
||||
} else {
|
||||
json[r'isGood'] = null;
|
||||
}
|
||||
if (order != null) {
|
||||
_json[r'order'] = order;
|
||||
if (this.order != null) {
|
||||
json[r'order'] = this.order;
|
||||
} else {
|
||||
json[r'order'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ResponseDTO] instance and imports its values from
|
||||
@ -85,7 +91,7 @@ class ResponseDTO {
|
||||
}());
|
||||
|
||||
return ResponseDTO(
|
||||
label: TranslationDTO.listFromJson(json[r'label']) ?? const [],
|
||||
label: TranslationDTO.listFromJson(json[r'label']),
|
||||
isGood: mapValueOfType<bool>(json, r'isGood'),
|
||||
order: mapValueOfType<int>(json, r'order'),
|
||||
);
|
||||
@ -93,7 +99,7 @@ class ResponseDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ResponseDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ResponseDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ResponseDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -124,12 +130,10 @@ class ResponseDTO {
|
||||
static Map<String, List<ResponseDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ResponseDTO>>{};
|
||||
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) {
|
||||
final value = ResponseDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ResponseDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -100,7 +100,7 @@ class SectionDTO {
|
||||
///
|
||||
bool? isBeacon;
|
||||
|
||||
String? beaconId;
|
||||
int? beaconId;
|
||||
|
||||
@override
|
||||
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]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (label != null) {
|
||||
_json[r'label'] = label;
|
||||
if (this.label != null) {
|
||||
json[r'label'] = this.label;
|
||||
} else {
|
||||
json[r'label'] = null;
|
||||
}
|
||||
if (title != null) {
|
||||
_json[r'title'] = title;
|
||||
if (this.title != null) {
|
||||
json[r'title'] = this.title;
|
||||
} else {
|
||||
json[r'title'] = null;
|
||||
}
|
||||
if (description != null) {
|
||||
_json[r'description'] = description;
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
} else {
|
||||
json[r'description'] = null;
|
||||
}
|
||||
if (imageId != null) {
|
||||
_json[r'imageId'] = imageId;
|
||||
if (this.imageId != null) {
|
||||
json[r'imageId'] = this.imageId;
|
||||
} else {
|
||||
json[r'imageId'] = null;
|
||||
}
|
||||
if (imageSource != null) {
|
||||
_json[r'imageSource'] = imageSource;
|
||||
if (this.imageSource != null) {
|
||||
json[r'imageSource'] = this.imageSource;
|
||||
} else {
|
||||
json[r'imageSource'] = null;
|
||||
}
|
||||
if (configurationId != null) {
|
||||
_json[r'configurationId'] = configurationId;
|
||||
if (this.configurationId != null) {
|
||||
json[r'configurationId'] = this.configurationId;
|
||||
} else {
|
||||
json[r'configurationId'] = null;
|
||||
}
|
||||
if (isSubSection != null) {
|
||||
_json[r'isSubSection'] = isSubSection;
|
||||
if (this.isSubSection != null) {
|
||||
json[r'isSubSection'] = this.isSubSection;
|
||||
} else {
|
||||
json[r'isSubSection'] = null;
|
||||
}
|
||||
if (parentId != null) {
|
||||
_json[r'parentId'] = parentId;
|
||||
if (this.parentId != null) {
|
||||
json[r'parentId'] = this.parentId;
|
||||
} else {
|
||||
json[r'parentId'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (data != null) {
|
||||
_json[r'data'] = data;
|
||||
if (this.data != null) {
|
||||
json[r'data'] = this.data;
|
||||
} else {
|
||||
json[r'data'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (order != null) {
|
||||
_json[r'order'] = order;
|
||||
if (this.order != null) {
|
||||
json[r'order'] = this.order;
|
||||
} else {
|
||||
json[r'order'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
if (latitude != null) {
|
||||
_json[r'latitude'] = latitude;
|
||||
if (this.latitude != null) {
|
||||
json[r'latitude'] = this.latitude;
|
||||
} else {
|
||||
json[r'latitude'] = null;
|
||||
}
|
||||
if (longitude != null) {
|
||||
_json[r'longitude'] = longitude;
|
||||
if (this.longitude != null) {
|
||||
json[r'longitude'] = this.longitude;
|
||||
} else {
|
||||
json[r'longitude'] = null;
|
||||
}
|
||||
if (meterZoneGPS != null) {
|
||||
_json[r'meterZoneGPS'] = meterZoneGPS;
|
||||
if (this.meterZoneGPS != null) {
|
||||
json[r'meterZoneGPS'] = this.meterZoneGPS;
|
||||
} else {
|
||||
json[r'meterZoneGPS'] = null;
|
||||
}
|
||||
if (isBeacon != null) {
|
||||
_json[r'isBeacon'] = isBeacon;
|
||||
if (this.isBeacon != null) {
|
||||
json[r'isBeacon'] = this.isBeacon;
|
||||
} else {
|
||||
json[r'isBeacon'] = null;
|
||||
}
|
||||
if (beaconId != null) {
|
||||
_json[r'beaconId'] = beaconId;
|
||||
if (this.beaconId != null) {
|
||||
json[r'beaconId'] = this.beaconId;
|
||||
} else {
|
||||
json[r'beaconId'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [SectionDTO] instance and imports its values from
|
||||
@ -233,8 +271,8 @@ class SectionDTO {
|
||||
return SectionDTO(
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
label: mapValueOfType<String>(json, r'label'),
|
||||
title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
|
||||
description: TranslationDTO.listFromJson(json[r'description']) ?? const [],
|
||||
title: TranslationDTO.listFromJson(json[r'title']),
|
||||
description: TranslationDTO.listFromJson(json[r'description']),
|
||||
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||
configurationId: mapValueOfType<String>(json, r'configurationId'),
|
||||
@ -249,13 +287,13 @@ class SectionDTO {
|
||||
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
|
||||
isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
|
||||
beaconId: mapValueOfType<String>(json, r'beaconId'),
|
||||
beaconId: mapValueOfType<int>(json, r'beaconId'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SectionDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<SectionDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SectionDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -286,12 +324,10 @@ class SectionDTO {
|
||||
static Map<String, List<SectionDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SectionDTO>>{};
|
||||
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) {
|
||||
final value = SectionDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = SectionDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -44,7 +44,7 @@ class SectionType {
|
||||
|
||||
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>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
|
||||
@ -31,11 +31,13 @@ class SliderDTO {
|
||||
String toString() => 'SliderDTO[images=$images]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (images != null) {
|
||||
_json[r'images'] = images;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.images != null) {
|
||||
json[r'images'] = this.images;
|
||||
} else {
|
||||
json[r'images'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [SliderDTO] instance and imports its values from
|
||||
@ -57,13 +59,13 @@ class SliderDTO {
|
||||
}());
|
||||
|
||||
return SliderDTO(
|
||||
images: ImageDTO.listFromJson(json[r'images']) ?? const [],
|
||||
images: ImageDTO.listFromJson(json[r'images']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SliderDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<SliderDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SliderDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -94,12 +96,10 @@ class SliderDTO {
|
||||
static Map<String, List<SliderDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SliderDTO>>{};
|
||||
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) {
|
||||
final value = SliderDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = SliderDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -73,29 +73,43 @@ class TokenDTO {
|
||||
String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (accessToken != null) {
|
||||
_json[r'access_token'] = accessToken;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.accessToken != null) {
|
||||
json[r'access_token'] = this.accessToken;
|
||||
} else {
|
||||
json[r'access_token'] = null;
|
||||
}
|
||||
if (refreshToken != null) {
|
||||
_json[r'refresh_token'] = refreshToken;
|
||||
if (this.refreshToken != null) {
|
||||
json[r'refresh_token'] = this.refreshToken;
|
||||
} else {
|
||||
json[r'refresh_token'] = null;
|
||||
}
|
||||
if (scope != null) {
|
||||
_json[r'scope'] = scope;
|
||||
if (this.scope != null) {
|
||||
json[r'scope'] = this.scope;
|
||||
} else {
|
||||
json[r'scope'] = null;
|
||||
}
|
||||
if (tokenType != null) {
|
||||
_json[r'token_type'] = tokenType;
|
||||
if (this.tokenType != null) {
|
||||
json[r'token_type'] = this.tokenType;
|
||||
} else {
|
||||
json[r'token_type'] = null;
|
||||
}
|
||||
if (expiresIn != null) {
|
||||
_json[r'expires_in'] = expiresIn;
|
||||
if (this.expiresIn != null) {
|
||||
json[r'expires_in'] = this.expiresIn;
|
||||
} else {
|
||||
json[r'expires_in'] = null;
|
||||
}
|
||||
if (expiration != null) {
|
||||
_json[r'expiration'] = expiration!.toUtc().toIso8601String();
|
||||
if (this.expiration != null) {
|
||||
json[r'expiration'] = this.expiration!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'expiration'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [TokenDTO] instance and imports its values from
|
||||
@ -129,7 +143,7 @@ class TokenDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<TokenDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<TokenDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <TokenDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -160,12 +174,10 @@ class TokenDTO {
|
||||
static Map<String, List<TokenDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<TokenDTO>>{};
|
||||
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) {
|
||||
final value = TokenDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = TokenDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class TranslationDTO {
|
||||
String toString() => 'TranslationDTO[language=$language, value=$value]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (language != null) {
|
||||
_json[r'language'] = language;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.language != null) {
|
||||
json[r'language'] = this.language;
|
||||
} else {
|
||||
json[r'language'] = null;
|
||||
}
|
||||
if (value != null) {
|
||||
_json[r'value'] = value;
|
||||
if (this.value != null) {
|
||||
json[r'value'] = this.value;
|
||||
} else {
|
||||
json[r'value'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [TranslationDTO] instance and imports its values from
|
||||
@ -72,7 +76,7 @@ class TranslationDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<TranslationDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<TranslationDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <TranslationDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class TranslationDTO {
|
||||
static Map<String, List<TranslationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<TranslationDTO>>{};
|
||||
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) {
|
||||
final value = TranslationDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = TranslationDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -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]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (email != null) {
|
||||
_json[r'email'] = email;
|
||||
if (this.email != null) {
|
||||
json[r'email'] = this.email;
|
||||
} else {
|
||||
json[r'email'] = null;
|
||||
}
|
||||
if (password != null) {
|
||||
_json[r'password'] = password;
|
||||
if (this.password != null) {
|
||||
json[r'password'] = this.password;
|
||||
} else {
|
||||
json[r'password'] = null;
|
||||
}
|
||||
if (firstName != null) {
|
||||
_json[r'firstName'] = firstName;
|
||||
if (this.firstName != null) {
|
||||
json[r'firstName'] = this.firstName;
|
||||
} else {
|
||||
json[r'firstName'] = null;
|
||||
}
|
||||
if (lastName != null) {
|
||||
_json[r'lastName'] = lastName;
|
||||
if (this.lastName != null) {
|
||||
json[r'lastName'] = this.lastName;
|
||||
} else {
|
||||
json[r'lastName'] = null;
|
||||
}
|
||||
if (token != null) {
|
||||
_json[r'token'] = token;
|
||||
if (this.token != null) {
|
||||
json[r'token'] = this.token;
|
||||
} else {
|
||||
json[r'token'] = null;
|
||||
}
|
||||
if (dateCreation != null) {
|
||||
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
|
||||
if (this.dateCreation != null) {
|
||||
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateCreation'] = null;
|
||||
}
|
||||
if (instanceId != null) {
|
||||
_json[r'instanceId'] = instanceId;
|
||||
if (this.instanceId != null) {
|
||||
json[r'instanceId'] = this.instanceId;
|
||||
} else {
|
||||
json[r'instanceId'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [User] instance and imports its values from
|
||||
@ -132,7 +148,7 @@ class User {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<User>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<User> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <User>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -163,12 +179,10 @@ class User {
|
||||
static Map<String, List<User>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<User>>{};
|
||||
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) {
|
||||
final value = User.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = User.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -46,20 +46,28 @@ class UserDetailDTO {
|
||||
String toString() => 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.id != null) {
|
||||
json[r'id'] = this.id;
|
||||
} else {
|
||||
json[r'id'] = null;
|
||||
}
|
||||
if (email != null) {
|
||||
_json[r'email'] = email;
|
||||
if (this.email != null) {
|
||||
json[r'email'] = this.email;
|
||||
} else {
|
||||
json[r'email'] = null;
|
||||
}
|
||||
if (firstName != null) {
|
||||
_json[r'firstName'] = firstName;
|
||||
if (this.firstName != null) {
|
||||
json[r'firstName'] = this.firstName;
|
||||
} else {
|
||||
json[r'firstName'] = null;
|
||||
}
|
||||
if (lastName != null) {
|
||||
_json[r'lastName'] = lastName;
|
||||
if (this.lastName != null) {
|
||||
json[r'lastName'] = this.lastName;
|
||||
} else {
|
||||
json[r'lastName'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [UserDetailDTO] instance and imports its values from
|
||||
@ -90,7 +98,7 @@ class UserDetailDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UserDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<UserDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UserDetailDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -121,12 +129,10 @@ class UserDetailDTO {
|
||||
static Map<String, List<UserDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UserDetailDTO>>{};
|
||||
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) {
|
||||
final value = UserDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = UserDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -31,11 +31,13 @@ class VideoDTO {
|
||||
String toString() => 'VideoDTO[source_=$source_]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (source_ != null) {
|
||||
_json[r'source'] = source_;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.source_ != null) {
|
||||
json[r'source'] = this.source_;
|
||||
} else {
|
||||
json[r'source'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [VideoDTO] instance and imports its values from
|
||||
@ -63,7 +65,7 @@ class VideoDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<VideoDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<VideoDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <VideoDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -94,12 +96,10 @@ class VideoDTO {
|
||||
static Map<String, List<VideoDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<VideoDTO>>{};
|
||||
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) {
|
||||
final value = VideoDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = VideoDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -31,11 +31,13 @@ class WebDTO {
|
||||
String toString() => 'WebDTO[source_=$source_]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (source_ != null) {
|
||||
_json[r'source'] = source_;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.source_ != null) {
|
||||
json[r'source'] = this.source_;
|
||||
} else {
|
||||
json[r'source'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [WebDTO] instance and imports its values from
|
||||
@ -63,7 +65,7 @@ class WebDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<WebDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<WebDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <WebDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -94,12 +96,10 @@ class WebDTO {
|
||||
static Map<String, List<WebDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<WebDTO>>{};
|
||||
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) {
|
||||
final value = WebDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = WebDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user