mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 09:01:20 +00:00
Notification + send action + update room screen + wip device screen
This commit is contained in:
parent
11cca4d044
commit
5167ad9091
@ -1,5 +1,5 @@
|
||||
#Tue Aug 01 16:05:42 CEST 2023
|
||||
VERSION_BUILD=59
|
||||
#Fri Aug 04 18:34:37 CEST 2023
|
||||
VERSION_BUILD=69
|
||||
VERSION_MAJOR=1
|
||||
VERSION_MINOR=0
|
||||
VERSION_PATCH=0
|
||||
|
||||
@ -53,9 +53,9 @@ class PushNotificationService {
|
||||
FirebaseMessaging.instance.subscribeToTopic("main");
|
||||
|
||||
if(homieAppContext != null) {
|
||||
if (homieAppContext.userId != null) {
|
||||
print('MyHomie USER ID for fcm notification = ' + homieAppContext.userId.toString());
|
||||
FirebaseMessaging.instance.subscribeToTopic(homieAppContext.userId!);
|
||||
if (homieAppContext.homeId != null) {
|
||||
print('MyHomie HOME ID for fcm notification = ' + homieAppContext.homeId.toString());
|
||||
FirebaseMessaging.instance.subscribeToTopic(homieAppContext.homeId!);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
121
lib/Screens/Main/Devices/deviceDetailPage.dart
Normal file
121
lib/Screens/Main/Devices/deviceDetailPage.dart
Normal file
@ -0,0 +1,121 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mycore_api/api.dart';
|
||||
|
||||
import 'package:mycore_api/api.dart' as API;
|
||||
import 'package:myhomie_app/Components/Alarms/getCurrentAlarmModeIcon.dart';
|
||||
import 'package:myhomie_app/Components/Custom_Navigation_Bar/CustomAppBar.dart';
|
||||
import 'package:myhomie_app/Components/check_input_container.dart';
|
||||
import 'package:myhomie_app/Components/loading_common.dart';
|
||||
import 'package:myhomie_app/Components/string_input_container.dart';
|
||||
import 'package:myhomie_app/Models/homieContext.dart';
|
||||
import 'package:myhomie_app/app_context.dart';
|
||||
import 'package:myhomie_app/constants.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DeviceDetailPage extends StatefulWidget {
|
||||
const DeviceDetailPage({Key? key, this.deviceSummaryDTO, this.deviceDetailDTO}) : super(key: key);
|
||||
|
||||
final API.DeviceSummaryDTO? deviceSummaryDTO;
|
||||
final API.DeviceDetailDTO? deviceDetailDTO;
|
||||
|
||||
@override
|
||||
State<DeviceDetailPage> createState() => _DeviceDetailPageState();
|
||||
}
|
||||
|
||||
class _DeviceDetailPageState extends State<DeviceDetailPage> {
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
API.DeviceDetailDTO? deviceDetailDTO;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appContext = Provider.of<AppContext>(context);
|
||||
Size size = MediaQuery.of(context).size;
|
||||
//final notchInset = MediaQuery.of(context).padding;
|
||||
|
||||
HomieAppContext homieAppContext = appContext.getContext();
|
||||
|
||||
//debugPrint(widget.deviceSummaryDTO.id!);
|
||||
|
||||
var deviceName = widget.deviceSummaryDTO == null ? widget.deviceDetailDTO!.name! : widget.deviceSummaryDTO!.name!;
|
||||
var deviceId = widget.deviceSummaryDTO == null ? widget.deviceDetailDTO!.id! : widget.deviceSummaryDTO!.id!;
|
||||
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: CustomAppBar(
|
||||
title: deviceName,
|
||||
//titleIcon: getAlarmModeIcon(widget.alarmMode),
|
||||
isTextSizeButton: true,
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: homieAppContext.clientAPI.deviceApi!.deviceGetDetail(deviceId),
|
||||
builder: (context, AsyncSnapshot<API.DeviceDetailDTO?> snapshot) {
|
||||
if(snapshot.data != null ) {
|
||||
deviceDetailDTO = snapshot.data;
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: size.width *1.1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: StringInputContainer(
|
||||
label: "Nom:",
|
||||
color: kMainColor,
|
||||
textColor: Colors.white,
|
||||
initialValue: deviceDetailDTO!.name,
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
deviceDetailDTO!.name = value;
|
||||
// TODO SAVE or not
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
/*Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: CheckInputContainer(
|
||||
icon: Icons.notifications_active,
|
||||
label: "Notification :",
|
||||
fontSize: 20,
|
||||
isChecked: alarmModeDetailDTO!.notification!,
|
||||
onChanged: (bool value) {
|
||||
alarmModeDetailDTO!.notification = value;
|
||||
},
|
||||
),
|
||||
),*/
|
||||
Text(
|
||||
deviceDetailDTO!.type.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const LoadingCommon();
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mycore_api/api.dart';
|
||||
import 'package:myhomie_app/Components/loading_common.dart';
|
||||
import 'package:myhomie_app/Models/homieContext.dart';
|
||||
import 'package:myhomie_app/Screens/Main/Devices/deviceDetailPage.dart';
|
||||
import 'package:myhomie_app/app_context.dart';
|
||||
import 'package:myhomie_app/constants.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DevicesScreen extends StatefulWidget {
|
||||
@ -22,8 +27,27 @@ class _DevicesScreenState extends State<DevicesScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
final appContext = Provider.of<AppContext>(context);
|
||||
HomieAppContext homieAppContext = appContext.getContext();
|
||||
|
||||
return interfaceElements();
|
||||
return FutureBuilder(
|
||||
future: homieAppContext.clientAPI.deviceApi!.deviceGetAll(homieAppContext.homeId!),
|
||||
builder: (context, AsyncSnapshot<List<DeviceSummaryDTO>?> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
print("connectionState done");
|
||||
print(snapshot);
|
||||
if(snapshot.data != null) {
|
||||
return interfaceElements(snapshot.data!);
|
||||
} else {
|
||||
return Text("No data - or error");
|
||||
}
|
||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||
print('ConnectionState.none');
|
||||
return Text("No data");
|
||||
} else {
|
||||
return Container(height: size.height * 0.2, child: LoadingCommon());
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/*if(appContext.getContext().feed != null) {
|
||||
return interfaceElements();
|
||||
@ -44,27 +68,135 @@ class _DevicesScreenState extends State<DevicesScreen> {
|
||||
}*/
|
||||
}
|
||||
|
||||
interfaceElements() {
|
||||
interfaceElements(List<DeviceSummaryDTO> devices) {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
final appContext = Provider.of<AppContext>(context);
|
||||
return RefreshIndicator(
|
||||
color: Theme.of(context).primaryColor,
|
||||
displacement: 20,
|
||||
onRefresh: () async {
|
||||
print("TODO refresh");
|
||||
//await Message.getMessages(this.messages, appContext, true, true);
|
||||
},
|
||||
child: Container(
|
||||
height: size.height * 0.8,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text("TODO Devices")
|
||||
],
|
||||
HomieAppContext homieAppContext = appContext.getContext();
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: RefreshIndicator(
|
||||
color: Theme.of(context).primaryColor,
|
||||
displacement: 20,
|
||||
onRefresh: () async {
|
||||
print("onRefresh");
|
||||
await homieAppContext.clientAPI.deviceApi!.deviceGetAll(homieAppContext.homeId!);
|
||||
},
|
||||
child: Container(
|
||||
height: size.height * 0.85,
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1),
|
||||
itemCount: devices.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
debugPrint(devices[index].toString());
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DeviceDetailPage(
|
||||
deviceSummaryDTO: devices[index]
|
||||
)
|
||||
),
|
||||
);
|
||||
/*setState(() {
|
||||
//selectedSection = menuDTO.sections[index];
|
||||
print("Hero to room detail");
|
||||
});*/
|
||||
},
|
||||
child: Container(
|
||||
decoration: boxDecorationDevice(devices[index], false),
|
||||
padding: const EdgeInsets.all(5),
|
||||
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
devices[index].name!,
|
||||
style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
|
||||
if(devices[index].type != null)
|
||||
Positioned(
|
||||
top: 5,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
getDeviceIcon(devices[index].type!),
|
||||
size: 20,
|
||||
//color: devices[index].status! ? kMainColor : kBackgroundSecondGrey,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
getDeviceIcon(DeviceType type) {
|
||||
switch(type) {
|
||||
case DeviceType.sensor:
|
||||
return Icons.sensors;
|
||||
case DeviceType.actuator:
|
||||
return Icons.devices;
|
||||
case DeviceType.camera:
|
||||
return Icons.camera_alt_outlined;
|
||||
case DeviceType.switch_:
|
||||
return Icons.toggle_off_outlined;
|
||||
case DeviceType.light:
|
||||
return Icons.light;
|
||||
case DeviceType.sound:
|
||||
return Icons.volume_up;
|
||||
case DeviceType.plug:
|
||||
return Icons.outlet_outlined;
|
||||
case DeviceType.multiplug:
|
||||
return Icons.settings_input_component_outlined;
|
||||
case DeviceType.thermostat:
|
||||
return Icons.thermostat;
|
||||
case DeviceType.valve:
|
||||
return Icons.thermostat_auto;
|
||||
case DeviceType.door:
|
||||
return Icons.door_back_door_outlined;
|
||||
case DeviceType.environment:
|
||||
return Icons.sensors_sharp;
|
||||
case DeviceType.motion:
|
||||
return Icons.directions_run;
|
||||
case DeviceType.gateway:
|
||||
return Icons.dns_outlined;
|
||||
case DeviceType.unknown:
|
||||
return Icons.question_mark;
|
||||
}
|
||||
}
|
||||
|
||||
boxDecorationDevice(DeviceSummaryDTO deviceSummaryDTO, bool isSelected) {
|
||||
return BoxDecoration(
|
||||
color: kBackgroundLight,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
/*image: roomMainDetailDTO.imageSource != null ? new DecorationImage(
|
||||
fit: BoxFit.contain,
|
||||
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null,
|
||||
image: new NetworkImage(
|
||||
section.imageSource,
|
||||
),
|
||||
): null,*/
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: kBackgroundSecondGrey,
|
||||
spreadRadius: 0.5,
|
||||
blurRadius: 6,
|
||||
offset: Offset(0, 1.5), // changes position of shadow
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -74,127 +74,125 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
print("onRefresh");
|
||||
await homieAppContext.clientAPI.roomApi!.roomGetAllWithMainDetails(homieAppContext.homeId!);
|
||||
},
|
||||
child: Container(
|
||||
height: size.height * 0.8,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1),
|
||||
itemCount: roomsMaindetails.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
debugPrint(roomsMaindetails[index].toString());
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => RoomDetailPage(
|
||||
roomMainDetailDTO: roomsMaindetails[index]
|
||||
)
|
||||
),
|
||||
);
|
||||
/*setState(() {
|
||||
//selectedSection = menuDTO.sections[index];
|
||||
print("Hero to room detail");
|
||||
});*/
|
||||
},
|
||||
child: Container(
|
||||
decoration: boxDecorationRoom(roomsMaindetails[index], false),
|
||||
padding: const EdgeInsets.all(5),
|
||||
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
||||
child: Stack(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
height: size.height * 0.88,
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1),
|
||||
itemCount: roomsMaindetails.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
debugPrint(roomsMaindetails[index].toString());
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => RoomDetailPage(
|
||||
roomMainDetailDTO: roomsMaindetails[index]
|
||||
)
|
||||
),
|
||||
);
|
||||
/*setState(() {
|
||||
//selectedSection = menuDTO.sections[index];
|
||||
print("Hero to room detail");
|
||||
});*/
|
||||
},
|
||||
child: Container(
|
||||
decoration: boxDecorationRoom(roomsMaindetails[index], false),
|
||||
padding: const EdgeInsets.all(5),
|
||||
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
||||
child: Stack(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
roomsMaindetails[index].name!,
|
||||
style: new TextStyle(fontSize: kDetailSize, color: kBackgroundSecondGrey),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
roomsMaindetails[index].name!,
|
||||
style: new TextStyle(fontSize: kDetailSize, color: kBackgroundSecondGrey),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
if(roomsMaindetails[index].isTemperature!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
left: 0,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.thermostat,
|
||||
size: 20,
|
||||
color: kMainColor,
|
||||
),
|
||||
Text(
|
||||
roomsMaindetails[index].temperature!,
|
||||
style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey),
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
|
||||
if(roomsMaindetails[index].isHumidity!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
left: roomsMaindetails[index].isTemperature! ? 60 : 0,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.water,
|
||||
size: 20,
|
||||
color: kMainColor,
|
||||
),
|
||||
Text(
|
||||
roomsMaindetails[index].humidity!,
|
||||
if(roomsMaindetails[index].isTemperature!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
left: 0,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.thermostat,
|
||||
size: 20,
|
||||
color: kMainColor,
|
||||
),
|
||||
Text(
|
||||
roomsMaindetails[index].temperature!,
|
||||
style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey),
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
|
||||
if(roomsMaindetails[index].isDoor!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 5,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.motion_photos_on_rounded,
|
||||
size: 20,
|
||||
color: !roomsMaindetails[index].door! ? kMainColor : kBackgroundSecondGrey,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
if(roomsMaindetails[index].isHumidity!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
left: roomsMaindetails[index].isTemperature! ? 60 : 0,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.water,
|
||||
size: 20,
|
||||
color: kMainColor,
|
||||
),
|
||||
Text(
|
||||
roomsMaindetails[index].humidity!,
|
||||
style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey),
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
|
||||
if(roomsMaindetails[index].isMotion!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: roomsMaindetails[index].isDoor! ? 20 : 5,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.directions_walk,
|
||||
size: 20,
|
||||
color: roomsMaindetails[index].motion! ? kMainColor : kBackgroundSecondGrey,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
],
|
||||
if(roomsMaindetails[index].isDoor!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 5,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.motion_photos_on_rounded,
|
||||
size: 20,
|
||||
color: !roomsMaindetails[index].door! ? kMainColor : kBackgroundSecondGrey,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
|
||||
if(roomsMaindetails[index].isMotion!)
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: roomsMaindetails[index].isDoor! ? 20 : 5,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.directions_walk,
|
||||
size: 20,
|
||||
color: roomsMaindetails[index].motion! ? kMainColor : kBackgroundSecondGrey,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -11,22 +11,25 @@ import 'package:myhomie_app/Components/check_input_container.dart';
|
||||
import 'package:myhomie_app/Components/loading_common.dart';
|
||||
import 'package:myhomie_app/Components/string_input_container.dart';
|
||||
import 'package:myhomie_app/Models/homieContext.dart';
|
||||
import 'package:myhomie_app/Screens/Main/Devices/deviceDetailPage.dart';
|
||||
import 'package:myhomie_app/app_context.dart';
|
||||
import 'package:myhomie_app/constants.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../Devices/devices.dart';
|
||||
|
||||
class RoomDetailPage extends StatefulWidget {
|
||||
const RoomDetailPage({Key? key, required this.roomMainDetailDTO}) : super(key: key);
|
||||
|
||||
final API.RoomMainDetailDTO roomMainDetailDTO;
|
||||
|
||||
@override
|
||||
State<RoomDetailPage> createState() => _RoomDetailPagePageState();
|
||||
State<RoomDetailPage> createState() => _RoomDetailPageState();
|
||||
}
|
||||
|
||||
class _RoomDetailPagePageState extends State<RoomDetailPage> {
|
||||
class _RoomDetailPageState extends State<RoomDetailPage> {
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
API.RoomDetailDTO? roomDetailDTO;
|
||||
late API.RoomDetailDTO roomDetailDTO;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -59,74 +62,101 @@ class _RoomDetailPagePageState extends State<RoomDetailPage> {
|
||||
future: homieAppContext.clientAPI.roomApi!.roomGetDetail(widget.roomMainDetailDTO.id!),
|
||||
builder: (context, AsyncSnapshot<API.RoomDetailDTO?> snapshot) {
|
||||
if(snapshot.data != null ) {
|
||||
roomDetailDTO = snapshot.data;
|
||||
roomDetailDTO = snapshot.data!;
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: size.width *1.1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: StringInputContainer(
|
||||
label: "Nom:",
|
||||
color: kMainColor,
|
||||
textColor: Colors.white,
|
||||
initialValue: roomDetailDTO!.name,
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
roomDetailDTO!.name = value;
|
||||
// TODO SAVE or not
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
/*Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: CheckInputContainer(
|
||||
icon: Icons.notifications_active,
|
||||
label: "Notification :",
|
||||
fontSize: 20,
|
||||
isChecked: alarmModeDetailDTO!.notification!,
|
||||
onChanged: (bool value) {
|
||||
alarmModeDetailDTO!.notification = value;
|
||||
},
|
||||
),
|
||||
),*/
|
||||
ExpansionTile(
|
||||
title: Text(
|
||||
"Devices",
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
),
|
||||
children: [
|
||||
for(var device in roomDetailDTO!.devices!)
|
||||
ExpansionTile(
|
||||
title: Text(device.name!),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text("type: "+ (device.type != null ? device.type!.value : 'no type') ),
|
||||
child: RefreshIndicator(
|
||||
color: Theme.of(context).primaryColor,
|
||||
displacement: 20,
|
||||
onRefresh: () async {
|
||||
print("onRefresh");
|
||||
//await homieAppContext.clientAPI.roomApi!.roomGetDetail(widget.roomMainDetailDTO.id!);
|
||||
// for refresh
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: size.height * 1,
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1),
|
||||
itemCount: roomDetailDTO.devices!.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onLongPress: () {
|
||||
debugPrint(roomDetailDTO.devices![index].toString());
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DeviceDetailPage(
|
||||
deviceDetailDTO: roomDetailDTO.devices![index]
|
||||
)
|
||||
),
|
||||
ListTile(
|
||||
title: Text("status: "+ device.status.toString()),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("last update date: "+ device.lastStateDate!.toLocal().toString()),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("lastState: "+ (device.lastState != null ? device.lastState! : 'no data')),
|
||||
)
|
||||
],
|
||||
);
|
||||
/*setState(() {
|
||||
//selectedSection = menuDTO.sections[index];
|
||||
print("Hero to room detail");
|
||||
});*/
|
||||
},
|
||||
onTap: () {
|
||||
//if(roomDetailDTO.devices![index].meansOfCommunications!.contains(API.MeansOfCommunication.zigbee)) {
|
||||
switch(roomDetailDTO.devices![index].type) {
|
||||
case DeviceType.light:
|
||||
case DeviceType.plug:
|
||||
debugPrint("Quick action supported !");
|
||||
List<AutomationState>? statesToSend = [];
|
||||
statesToSend.add(AutomationState(name: "state", value: "toggle"));
|
||||
API.Action action = API.Action(
|
||||
deviceId: roomDetailDTO.devices![index].id,
|
||||
groupId: null,
|
||||
type: ActionType.DEVICE,
|
||||
providerId: roomDetailDTO.devices![index].providerId,
|
||||
states: statesToSend,
|
||||
isForce: true
|
||||
);
|
||||
|
||||
print(action);
|
||||
homieAppContext.clientAPI.deviceApi!.deviceSendAction(action);
|
||||
break;
|
||||
default:
|
||||
debugPrint("Quick action not supported for this type of device");
|
||||
break;
|
||||
}
|
||||
//}
|
||||
},
|
||||
child: Container(
|
||||
decoration: boxDecorationDeviceDetail(roomDetailDTO.devices![index], false),
|
||||
padding: const EdgeInsets.all(5),
|
||||
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
roomDetailDTO.devices![index].name!,
|
||||
style: new TextStyle(fontSize: kDescriptionDetailSize, color: kBackgroundSecondGrey),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
|
||||
if(roomDetailDTO.devices![index].type != null)
|
||||
Positioned(
|
||||
top: 5,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
getDeviceIcon(roomDetailDTO.devices![index].type!),
|
||||
size: 20,
|
||||
//color: devices[index].status! ? kMainColor : kBackgroundSecondGrey,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
@ -137,3 +167,86 @@ class _RoomDetailPagePageState extends State<RoomDetailPage> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
boxDecorationDeviceDetail(DeviceDetailDTO deviceDetailDTO, bool isSelected) {
|
||||
return BoxDecoration(
|
||||
color: kBackgroundLight,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
/*image: roomMainDetailDTO.imageSource != null ? new DecorationImage(
|
||||
fit: BoxFit.contain,
|
||||
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null,
|
||||
image: new NetworkImage(
|
||||
section.imageSource,
|
||||
),
|
||||
): null,*/
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: kBackgroundSecondGrey,
|
||||
spreadRadius: 0.5,
|
||||
blurRadius: 6,
|
||||
offset: Offset(0, 1.5), // changes position of shadow
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/*SizedBox(
|
||||
width: size.width *1.1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: StringInputContainer(
|
||||
label: "Nom:",
|
||||
color: kMainColor,
|
||||
textColor: Colors.white,
|
||||
initialValue: roomDetailDTO!.name,
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
roomDetailDTO!.name = value;
|
||||
// TODO SAVE or not
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),*/
|
||||
/*Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: CheckInputContainer(
|
||||
icon: Icons.notifications_active,
|
||||
label: "Notification :",
|
||||
fontSize: 20,
|
||||
isChecked: alarmModeDetailDTO!.notification!,
|
||||
onChanged: (bool value) {
|
||||
alarmModeDetailDTO!.notification = value;
|
||||
},
|
||||
),
|
||||
),*/
|
||||
/*ExpansionTile(
|
||||
title: Text(
|
||||
"Devices",
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
),
|
||||
children: [
|
||||
for(var device in roomDetailDTO!.devices!)
|
||||
ExpansionTile(
|
||||
title: Text(device.name!),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text("type: "+ (device.type != null ? device.type!.value : 'no type') ),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("status: "+ device.status.toString()),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("last update date: "+ device.lastStateDate!.toLocal().toString()),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("lastState: "+ (device.lastState != null ? device.lastState! : 'no data')),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),*/
|
||||
@ -5,7 +5,7 @@ info:
|
||||
description: API description
|
||||
version: Version Pre-Alpha
|
||||
servers:
|
||||
- url: http://192.168.31.140
|
||||
- url: http://localhost:25049
|
||||
paths:
|
||||
/api/books:
|
||||
get:
|
||||
@ -3105,6 +3105,63 @@ paths:
|
||||
type: string
|
||||
security:
|
||||
- bearer: []
|
||||
/Notification/all:
|
||||
post:
|
||||
tags:
|
||||
- Notification
|
||||
summary: Create a fcm notification
|
||||
operationId: Notification_CreateSimpleNotification
|
||||
requestBody:
|
||||
x-name: notificationDTO
|
||||
description: notificationDTO
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/NotificationDTO'
|
||||
required: true
|
||||
x-position: 1
|
||||
responses:
|
||||
'200':
|
||||
description: bool result
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: boolean
|
||||
security:
|
||||
- bearer: []
|
||||
/Notification/home/{homeId}:
|
||||
post:
|
||||
tags:
|
||||
- Notification
|
||||
summary: Create a fcm notification for a specific home
|
||||
operationId: Notification_CreateSimpleNotificationForSpecificUser
|
||||
parameters:
|
||||
- name: homeId
|
||||
in: path
|
||||
required: true
|
||||
description: homeId
|
||||
schema:
|
||||
type: string
|
||||
nullable: true
|
||||
x-position: 1
|
||||
requestBody:
|
||||
x-name: notificationDTO
|
||||
description: notificationDTO
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/NotificationDTO'
|
||||
required: true
|
||||
x-position: 2
|
||||
responses:
|
||||
'200':
|
||||
description: bool result
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: boolean
|
||||
security:
|
||||
- bearer: []
|
||||
/api/room/{homeId}:
|
||||
get:
|
||||
tags:
|
||||
@ -3631,6 +3688,9 @@ components:
|
||||
lastStateDate:
|
||||
type: string
|
||||
format: date-time
|
||||
lastMessageDate:
|
||||
type: string
|
||||
format: date-time
|
||||
battery:
|
||||
type: boolean
|
||||
batteryStatus:
|
||||
@ -3708,6 +3768,9 @@ components:
|
||||
updatedDate:
|
||||
type: string
|
||||
format: date-time
|
||||
lastMessage:
|
||||
type: string
|
||||
nullable: true
|
||||
lastState:
|
||||
type: string
|
||||
nullable: true
|
||||
@ -3733,6 +3796,116 @@ components:
|
||||
nullable: true
|
||||
items:
|
||||
type: string
|
||||
isContact:
|
||||
type: boolean
|
||||
contact:
|
||||
type: boolean
|
||||
isIlluminance:
|
||||
type: boolean
|
||||
illuminance:
|
||||
type: integer
|
||||
format: int32
|
||||
nullable: true
|
||||
isBrightness:
|
||||
type: boolean
|
||||
brightness:
|
||||
type: integer
|
||||
format: int32
|
||||
isState:
|
||||
type: boolean
|
||||
state:
|
||||
type: boolean
|
||||
isColorTemp:
|
||||
type: boolean
|
||||
colorTemp:
|
||||
type: integer
|
||||
format: int32
|
||||
isColorXY:
|
||||
type: boolean
|
||||
colorX:
|
||||
type: integer
|
||||
format: int32
|
||||
colorY:
|
||||
type: integer
|
||||
format: int32
|
||||
isOccupation:
|
||||
type: boolean
|
||||
occupation:
|
||||
type: boolean
|
||||
isAlarm:
|
||||
type: boolean
|
||||
alarm:
|
||||
type: boolean
|
||||
isWaterLeak:
|
||||
type: boolean
|
||||
waterLeak:
|
||||
type: boolean
|
||||
isSmoke:
|
||||
type: boolean
|
||||
smoke:
|
||||
type: boolean
|
||||
isVibration:
|
||||
type: boolean
|
||||
vibration:
|
||||
type: boolean
|
||||
isAction:
|
||||
type: boolean
|
||||
action:
|
||||
type: string
|
||||
nullable: true
|
||||
isTemperature:
|
||||
type: boolean
|
||||
temperature:
|
||||
type: number
|
||||
format: decimal
|
||||
nullable: true
|
||||
isHumidity:
|
||||
type: boolean
|
||||
humidity:
|
||||
type: number
|
||||
format: decimal
|
||||
nullable: true
|
||||
isPressure:
|
||||
type: boolean
|
||||
pressure:
|
||||
type: number
|
||||
format: decimal
|
||||
nullable: true
|
||||
isAirQuality:
|
||||
type: boolean
|
||||
airQuality:
|
||||
type: string
|
||||
nullable: true
|
||||
isFanSpeed:
|
||||
type: boolean
|
||||
fanSpeed:
|
||||
type: integer
|
||||
format: int32
|
||||
isFanMode:
|
||||
type: boolean
|
||||
fanMode:
|
||||
type: string
|
||||
nullable: true
|
||||
isConsumption:
|
||||
type: boolean
|
||||
consumption:
|
||||
type: number
|
||||
format: decimal
|
||||
isCurrentPower:
|
||||
type: boolean
|
||||
currentPower:
|
||||
type: number
|
||||
format: decimal
|
||||
isVoltage:
|
||||
type: boolean
|
||||
voltage:
|
||||
type: number
|
||||
format: decimal
|
||||
isLinkQuality:
|
||||
type: boolean
|
||||
linkQuality:
|
||||
type: integer
|
||||
format: int32
|
||||
MeansOfCommunication:
|
||||
type: string
|
||||
description: ''
|
||||
@ -4757,6 +4930,35 @@ components:
|
||||
nullable: true
|
||||
items:
|
||||
type: string
|
||||
NotificationDTO:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
notificationTitle:
|
||||
type: string
|
||||
nullable: true
|
||||
notificationMessage:
|
||||
type: string
|
||||
nullable: true
|
||||
notificationLabelButton:
|
||||
type: string
|
||||
nullable: true
|
||||
title:
|
||||
type: string
|
||||
nullable: true
|
||||
body:
|
||||
type: string
|
||||
nullable: true
|
||||
type:
|
||||
type: string
|
||||
nullable: true
|
||||
isPushNotification:
|
||||
type: boolean
|
||||
isButton:
|
||||
type: boolean
|
||||
buttonLabel:
|
||||
type: string
|
||||
nullable: true
|
||||
RoomSummaryDTO:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
@ -4792,6 +4994,11 @@ components:
|
||||
humidity:
|
||||
type: string
|
||||
nullable: true
|
||||
isPressure:
|
||||
type: boolean
|
||||
pressure:
|
||||
type: string
|
||||
nullable: true
|
||||
isMotion:
|
||||
type: boolean
|
||||
motion:
|
||||
@ -4802,6 +5009,11 @@ components:
|
||||
door:
|
||||
type: boolean
|
||||
nullable: true
|
||||
isIlluminance:
|
||||
type: boolean
|
||||
illuminance:
|
||||
type: string
|
||||
nullable: true
|
||||
environmentalDevices:
|
||||
type: array
|
||||
nullable: true
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
.gitignore
|
||||
.openapi-generator-ignore
|
||||
.travis.yml
|
||||
README.md
|
||||
analysis_options.yaml
|
||||
@ -12,8 +11,8 @@ doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md
|
||||
doc/AlarmModeDTO.md
|
||||
doc/AlarmModeDetailDTO.md
|
||||
doc/AlarmModeDetailDTOAllOf.md
|
||||
doc/AlarmModeGeolocalizedMode.md
|
||||
doc/AlarmModeProgrammedMode.md
|
||||
doc/AlarmModeDetailDTOAllOfGeolocalizedMode.md
|
||||
doc/AlarmModeDetailDTOAllOfProgrammedMode.md
|
||||
doc/AlarmTriggered.md
|
||||
doc/AlarmType.md
|
||||
doc/AuthenticationApi.md
|
||||
@ -46,6 +45,9 @@ doc/EventApi.md
|
||||
doc/EventDTO.md
|
||||
doc/EventDetailDTO.md
|
||||
doc/EventDetailDTOAllOf.md
|
||||
doc/EventDetailDTOAllOfAlarmTriggered.md
|
||||
doc/EventDetailDTOAllOfAutomationTriggered.md
|
||||
doc/EventDetailDTOAllOfDeviceState.md
|
||||
doc/EventFilter.md
|
||||
doc/EventGetDeviceTypeParameter.md
|
||||
doc/EventGetEventTypeParameter.md
|
||||
@ -76,6 +78,8 @@ doc/LoginDTO.md
|
||||
doc/MQTTApi.md
|
||||
doc/MeansOfCommunication.md
|
||||
doc/MqttMessageDTO.md
|
||||
doc/NotificationApi.md
|
||||
doc/NotificationDTO.md
|
||||
doc/OddApi.md
|
||||
doc/OddNice.md
|
||||
doc/OddNiceOdds.md
|
||||
@ -127,6 +131,7 @@ lib/api/home_api.dart
|
||||
lib/api/iot_api.dart
|
||||
lib/api/layout_api.dart
|
||||
lib/api/mqtt_api.dart
|
||||
lib/api/notification_api.dart
|
||||
lib/api/odd_api.dart
|
||||
lib/api/provider_api.dart
|
||||
lib/api/room_api.dart
|
||||
@ -150,9 +155,9 @@ lib/model/alarm_mode_create_or_update_detail_dto.dart
|
||||
lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart
|
||||
lib/model/alarm_mode_detail_dto.dart
|
||||
lib/model/alarm_mode_detail_dto_all_of.dart
|
||||
lib/model/alarm_mode_detail_dto_all_of_geolocalized_mode.dart
|
||||
lib/model/alarm_mode_detail_dto_all_of_programmed_mode.dart
|
||||
lib/model/alarm_mode_dto.dart
|
||||
lib/model/alarm_mode_geolocalized_mode.dart
|
||||
lib/model/alarm_mode_programmed_mode.dart
|
||||
lib/model/alarm_triggered.dart
|
||||
lib/model/alarm_type.dart
|
||||
lib/model/automation_detail_dto.dart
|
||||
@ -177,6 +182,9 @@ lib/model/device_type.dart
|
||||
lib/model/electricity_production.dart
|
||||
lib/model/event_detail_dto.dart
|
||||
lib/model/event_detail_dto_all_of.dart
|
||||
lib/model/event_detail_dto_all_of_alarm_triggered.dart
|
||||
lib/model/event_detail_dto_all_of_automation_triggered.dart
|
||||
lib/model/event_detail_dto_all_of_device_state.dart
|
||||
lib/model/event_dto.dart
|
||||
lib/model/event_filter.dart
|
||||
lib/model/event_get_device_type_parameter.dart
|
||||
@ -201,6 +209,7 @@ lib/model/list_response_of_event_detail_dto_and_event_home_filter_request_parame
|
||||
lib/model/login_dto.dart
|
||||
lib/model/means_of_communication.dart
|
||||
lib/model/mqtt_message_dto.dart
|
||||
lib/model/notification_dto.dart
|
||||
lib/model/odd_nice.dart
|
||||
lib/model/odd_nice_odds.dart
|
||||
lib/model/odd_object.dart
|
||||
@ -228,110 +237,10 @@ lib/model/user_info.dart
|
||||
lib/model/user_info_detail_dto.dart
|
||||
lib/model/view_by.dart
|
||||
pubspec.yaml
|
||||
test/action_test.dart
|
||||
test/action_type_test.dart
|
||||
test/alarm_api_test.dart
|
||||
test/alarm_mode_create_or_update_detail_dto_all_of_test.dart
|
||||
test/alarm_mode_create_or_update_detail_dto_test.dart
|
||||
test/alarm_mode_detail_dto_all_of_test.dart
|
||||
test/alarm_mode_detail_dto_test.dart
|
||||
test/alarm_mode_dto_test.dart
|
||||
test/alarm_mode_geolocalized_mode_test.dart
|
||||
test/alarm_mode_programmed_mode_test.dart
|
||||
test/alarm_mode_test.dart
|
||||
test/alarm_triggered_test.dart
|
||||
test/alarm_type_test.dart
|
||||
test/authentication_api_test.dart
|
||||
test/automation_api_test.dart
|
||||
test/automation_detail_dto_all_of_test.dart
|
||||
test/automation_detail_dto_test.dart
|
||||
test/automation_dto_test.dart
|
||||
test/automation_state_test.dart
|
||||
test/automation_triggered_test.dart
|
||||
test/azure_ad_auth_model_test.dart
|
||||
test/azure_api_test.dart
|
||||
test/book_test.dart
|
||||
test/books_api_test.dart
|
||||
test/condition_state_test.dart
|
||||
test/condition_test.dart
|
||||
test/condition_type_test.dart
|
||||
test/condition_value_test.dart
|
||||
test/connection_status_test.dart
|
||||
test/create_or_update_home_dto_all_of_test.dart
|
||||
test/create_or_update_home_dto_test.dart
|
||||
test/device_api_test.dart
|
||||
test/device_detail_dto_all_of_test.dart
|
||||
test/device_detail_dto_test.dart
|
||||
test/device_state_test.dart
|
||||
test/device_summary_dto_test.dart
|
||||
test/device_type_test.dart
|
||||
test/electricity_production_test.dart
|
||||
test/energy_api_test.dart
|
||||
test/event_api_test.dart
|
||||
test/event_detail_dto_all_of_test.dart
|
||||
test/event_detail_dto_test.dart
|
||||
test/event_dto_test.dart
|
||||
test/event_filter_test.dart
|
||||
test/event_get_device_type_parameter_test.dart
|
||||
test/event_get_event_type_parameter_test.dart
|
||||
test/event_home_filter_all_of_test.dart
|
||||
test/event_home_filter_test.dart
|
||||
test/event_type_test.dart
|
||||
test/facebook_api_test.dart
|
||||
test/facebook_auth_model_test.dart
|
||||
test/geolocalized_mode_test.dart
|
||||
test/google_api_test.dart
|
||||
test/google_auth_model_test.dart
|
||||
test/group_api_test.dart
|
||||
test/group_create_or_update_detail_dto_all_of_test.dart
|
||||
test/group_create_or_update_detail_dto_test.dart
|
||||
test/group_detail_dto_all_of_test.dart
|
||||
test/group_detail_dto_test.dart
|
||||
test/group_summary_dto_test.dart
|
||||
test/home_api_test.dart
|
||||
test/home_detail_dto_all_of_test.dart
|
||||
test/home_detail_dto_test.dart
|
||||
test/home_dto_current_alarm_mode_test.dart
|
||||
test/home_dto_test.dart
|
||||
test/iot_api_test.dart
|
||||
test/layout_api_test.dart
|
||||
test/list_response_of_event_detail_dto_and_event_home_filter_request_parameters_test.dart
|
||||
test/list_response_of_event_detail_dto_and_event_home_filter_test.dart
|
||||
test/login_dto_test.dart
|
||||
test/means_of_communication_test.dart
|
||||
test/mqtt_api_test.dart
|
||||
test/mqtt_message_dto_test.dart
|
||||
test/odd_api_test.dart
|
||||
test/odd_nice_odds_test.dart
|
||||
test/odd_nice_test.dart
|
||||
test/odd_object_test.dart
|
||||
test/panel_menu_item_test.dart
|
||||
test/panel_section_test.dart
|
||||
test/programmed_mode_test.dart
|
||||
test/provider_api_test.dart
|
||||
test/provider_dto_test.dart
|
||||
test/provider_type_test.dart
|
||||
test/room_api_test.dart
|
||||
test/room_create_or_update_detail_dto_test.dart
|
||||
test/room_detail_dto_test.dart
|
||||
test/room_main_detail_dto_all_of_test.dart
|
||||
test/room_main_detail_dto_test.dart
|
||||
test/room_summary_dto_test.dart
|
||||
test/screen_device_api_test.dart
|
||||
test/screen_device_test.dart
|
||||
test/smart_garden_message_test.dart
|
||||
test/smart_printer_message_test.dart
|
||||
test/time_period_alarm_alarm_mode_test.dart
|
||||
test/time_period_alarm_test.dart
|
||||
test/token_api_test.dart
|
||||
test/token_dto_test.dart
|
||||
test/trigger_test.dart
|
||||
test/trigger_type_test.dart
|
||||
test/twitter_api_test.dart
|
||||
test/twitter_auth_model_test.dart
|
||||
test/user_api_test.dart
|
||||
test/user_info_detail_dto_test.dart
|
||||
test/user_info_test.dart
|
||||
test/user_test.dart
|
||||
test/values_api_test.dart
|
||||
test/view_by_test.dart
|
||||
test/alarm_mode_detail_dto_all_of_geolocalized_mode_test.dart
|
||||
test/alarm_mode_detail_dto_all_of_programmed_mode_test.dart
|
||||
test/event_detail_dto_all_of_alarm_triggered_test.dart
|
||||
test/event_detail_dto_all_of_automation_triggered_test.dart
|
||||
test/event_detail_dto_all_of_device_state_test.dart
|
||||
test/notification_api_test.dart
|
||||
test/notification_dto_test.dart
|
||||
|
||||
@ -56,7 +56,7 @@ try {
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
@ -121,6 +121,8 @@ Class | Method | HTTP request | Description
|
||||
*IOTApi* | [**iOTPostToDBSmartGarden**](doc\/IOTApi.md#iotposttodbsmartgarden) | **POST** /api/iot/smartgarden/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!)
|
||||
*LayoutApi* | [**layoutGet**](doc\/LayoutApi.md#layoutget) | **GET** /api/layout/panelSection | It's a test ! :)
|
||||
*MQTTApi* | [**mQTTPublishMessage**](doc\/MQTTApi.md#mqttpublishmessage) | **POST** /api/mqtt | Publish mqtt test
|
||||
*NotificationApi* | [**notificationCreateSimpleNotification**](doc\/NotificationApi.md#notificationcreatesimplenotification) | **POST** /Notification/all | Create a fcm notification
|
||||
*NotificationApi* | [**notificationCreateSimpleNotificationForSpecificUser**](doc\/NotificationApi.md#notificationcreatesimplenotificationforspecificuser) | **POST** /Notification/home/{homeId} | Create a fcm notification for a specific home
|
||||
*OddApi* | [**oddGetAll**](doc\/OddApi.md#oddgetall) | **GET** /api/odd/{oddRequest} | Get odds for one country and one odd value maximum
|
||||
*OddApi* | [**oddGetForCountry**](doc\/OddApi.md#oddgetforcountry) | **GET** /api/odd/country/{id}/{oddRequest} | Get odds for one country and one odd value maximum
|
||||
*ProviderApi* | [**providerCreate**](doc\/ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider
|
||||
@ -167,8 +169,8 @@ Class | Method | HTTP request | Description
|
||||
- [AlarmModeDTO](doc\/AlarmModeDTO.md)
|
||||
- [AlarmModeDetailDTO](doc\/AlarmModeDetailDTO.md)
|
||||
- [AlarmModeDetailDTOAllOf](doc\/AlarmModeDetailDTOAllOf.md)
|
||||
- [AlarmModeGeolocalizedMode](doc\/AlarmModeGeolocalizedMode.md)
|
||||
- [AlarmModeProgrammedMode](doc\/AlarmModeProgrammedMode.md)
|
||||
- [AlarmModeDetailDTOAllOfGeolocalizedMode](doc\/AlarmModeDetailDTOAllOfGeolocalizedMode.md)
|
||||
- [AlarmModeDetailDTOAllOfProgrammedMode](doc\/AlarmModeDetailDTOAllOfProgrammedMode.md)
|
||||
- [AlarmTriggered](doc\/AlarmTriggered.md)
|
||||
- [AlarmType](doc\/AlarmType.md)
|
||||
- [AutomationDTO](doc\/AutomationDTO.md)
|
||||
@ -194,6 +196,9 @@ Class | Method | HTTP request | Description
|
||||
- [EventDTO](doc\/EventDTO.md)
|
||||
- [EventDetailDTO](doc\/EventDetailDTO.md)
|
||||
- [EventDetailDTOAllOf](doc\/EventDetailDTOAllOf.md)
|
||||
- [EventDetailDTOAllOfAlarmTriggered](doc\/EventDetailDTOAllOfAlarmTriggered.md)
|
||||
- [EventDetailDTOAllOfAutomationTriggered](doc\/EventDetailDTOAllOfAutomationTriggered.md)
|
||||
- [EventDetailDTOAllOfDeviceState](doc\/EventDetailDTOAllOfDeviceState.md)
|
||||
- [EventFilter](doc\/EventFilter.md)
|
||||
- [EventGetDeviceTypeParameter](doc\/EventGetDeviceTypeParameter.md)
|
||||
- [EventGetEventTypeParameter](doc\/EventGetEventTypeParameter.md)
|
||||
@ -217,6 +222,7 @@ Class | Method | HTTP request | Description
|
||||
- [LoginDTO](doc\/LoginDTO.md)
|
||||
- [MeansOfCommunication](doc\/MeansOfCommunication.md)
|
||||
- [MqttMessageDTO](doc\/MqttMessageDTO.md)
|
||||
- [NotificationDTO](doc\/NotificationDTO.md)
|
||||
- [OddNice](doc\/OddNice.md)
|
||||
- [OddNiceOdds](doc\/OddNiceOdds.md)
|
||||
- [OddObject](doc\/OddObject.md)
|
||||
@ -248,7 +254,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:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -17,8 +17,8 @@ Name | Type | Description | Notes
|
||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeProgrammedMode**](AlarmModeProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeGeolocalizedMode**](AlarmModeGeolocalizedMode.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeDetailDTOAllOfProgrammedMode**](AlarmModeDetailDTOAllOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeDetailDTOAllOfGeolocalizedMode**](AlarmModeDetailDTOAllOfGeolocalizedMode.md) | | [optional]
|
||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||
**devicesIds** | **List<String>** | | [optional] [default to const []]
|
||||
|
||||
@ -19,8 +19,8 @@ Name | Type | Description | Notes
|
||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeDetailDTOAllOfProgrammedMode**](AlarmModeDetailDTOAllOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeDetailDTOAllOfGeolocalizedMode**](AlarmModeDetailDTOAllOfGeolocalizedMode.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeDetailDTOAllOfProgrammedMode**](AlarmModeDetailDTOAllOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeDetailDTOAllOfGeolocalizedMode**](AlarmModeDetailDTOAllOfGeolocalizedMode.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ Name | Type | Description | Notes
|
||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||
**devices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeDetailDTOAllOfProgrammedMode**](AlarmModeDetailDTOAllOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeDetailDTOAllOfGeolocalizedMode**](AlarmModeDetailDTOAllOfGeolocalizedMode.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@ Name | Type | Description | Notes
|
||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||
**devices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeDetailDTOAllOfProgrammedMode**](AlarmModeDetailDTOAllOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeDetailDTOAllOfGeolocalizedMode**](AlarmModeDetailDTOAllOfGeolocalizedMode.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
mycore_api/doc/AlarmModeDetailDTOAllOfGeolocalizedMode.md
Normal file
18
mycore_api/doc/AlarmModeDetailDTOAllOfGeolocalizedMode.md
Normal file
@ -0,0 +1,18 @@
|
||||
# mycore_api.model.AlarmModeDetailDTOAllOfGeolocalizedMode
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**latitude** | **String** | | [optional]
|
||||
**longitude** | **String** | | [optional]
|
||||
**homeMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.md) | | [optional]
|
||||
**absentMode** | [**TimePeriodAlarmAlarmMode**](TimePeriodAlarmAlarmMode.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
21
mycore_api/doc/AlarmModeDetailDTOAllOfProgrammedMode.md
Normal file
21
mycore_api/doc/AlarmModeDetailDTOAllOfProgrammedMode.md
Normal file
@ -0,0 +1,21 @@
|
||||
# mycore_api.model.AlarmModeDetailDTOAllOfProgrammedMode
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**monday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
**tuesday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
**wednesday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
**thursday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
**friday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
**saturday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
**sunday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||
|
||||
[[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:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -20,6 +20,7 @@ Name | Type | Description | Notes
|
||||
**providerId** | **String** | | [optional]
|
||||
**providerName** | **String** | | [optional]
|
||||
**lastStateDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**lastMessageDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**battery** | **bool** | | [optional]
|
||||
**batteryStatus** | **int** | | [optional]
|
||||
**firmwareVersion** | **String** | | [optional]
|
||||
@ -28,6 +29,7 @@ Name | Type | Description | Notes
|
||||
**meansOfCommunications** | [**List<MeansOfCommunication>**](MeansOfCommunication.md) | | [optional] [default to const []]
|
||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**lastMessage** | **String** | | [optional]
|
||||
**lastState** | **String** | | [optional]
|
||||
**ipAddress** | **String** | | [optional]
|
||||
**serviceIdentification** | **String** | | [optional]
|
||||
@ -35,6 +37,51 @@ Name | Type | Description | Notes
|
||||
**groupIds** | **List<String>** | | [optional] [default to const []]
|
||||
**properties** | **String** | | [optional]
|
||||
**supportedOperations** | **List<String>** | | [optional] [default to const []]
|
||||
**isContact** | **bool** | | [optional]
|
||||
**contact** | **bool** | | [optional]
|
||||
**isIlluminance** | **bool** | | [optional]
|
||||
**illuminance** | **int** | | [optional]
|
||||
**isBrightness** | **bool** | | [optional]
|
||||
**brightness** | **int** | | [optional]
|
||||
**isState** | **bool** | | [optional]
|
||||
**state** | **bool** | | [optional]
|
||||
**isColorTemp** | **bool** | | [optional]
|
||||
**colorTemp** | **int** | | [optional]
|
||||
**isColorXY** | **bool** | | [optional]
|
||||
**colorX** | **int** | | [optional]
|
||||
**colorY** | **int** | | [optional]
|
||||
**isOccupation** | **bool** | | [optional]
|
||||
**occupation** | **bool** | | [optional]
|
||||
**isAlarm** | **bool** | | [optional]
|
||||
**alarm** | **bool** | | [optional]
|
||||
**isWaterLeak** | **bool** | | [optional]
|
||||
**waterLeak** | **bool** | | [optional]
|
||||
**isSmoke** | **bool** | | [optional]
|
||||
**smoke** | **bool** | | [optional]
|
||||
**isVibration** | **bool** | | [optional]
|
||||
**vibration** | **bool** | | [optional]
|
||||
**isAction** | **bool** | | [optional]
|
||||
**action** | **String** | | [optional]
|
||||
**isTemperature** | **bool** | | [optional]
|
||||
**temperature** | **num** | | [optional]
|
||||
**isHumidity** | **bool** | | [optional]
|
||||
**humidity** | **num** | | [optional]
|
||||
**isPressure** | **bool** | | [optional]
|
||||
**pressure** | **num** | | [optional]
|
||||
**isAirQuality** | **bool** | | [optional]
|
||||
**airQuality** | **String** | | [optional]
|
||||
**isFanSpeed** | **bool** | | [optional]
|
||||
**fanSpeed** | **int** | | [optional]
|
||||
**isFanMode** | **bool** | | [optional]
|
||||
**fanMode** | **String** | | [optional]
|
||||
**isConsumption** | **bool** | | [optional]
|
||||
**consumption** | **num** | | [optional]
|
||||
**isCurrentPower** | **bool** | | [optional]
|
||||
**currentPower** | **num** | | [optional]
|
||||
**isVoltage** | **bool** | | [optional]
|
||||
**voltage** | **num** | | [optional]
|
||||
**isLinkQuality** | **bool** | | [optional]
|
||||
**linkQuality** | **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)
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ Name | Type | Description | Notes
|
||||
**meansOfCommunications** | [**List<MeansOfCommunication>**](MeansOfCommunication.md) | | [optional] [default to const []]
|
||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**lastMessage** | **String** | | [optional]
|
||||
**lastState** | **String** | | [optional]
|
||||
**ipAddress** | **String** | | [optional]
|
||||
**serviceIdentification** | **String** | | [optional]
|
||||
@ -21,6 +22,51 @@ Name | Type | Description | Notes
|
||||
**groupIds** | **List<String>** | | [optional] [default to const []]
|
||||
**properties** | **String** | | [optional]
|
||||
**supportedOperations** | **List<String>** | | [optional] [default to const []]
|
||||
**isContact** | **bool** | | [optional]
|
||||
**contact** | **bool** | | [optional]
|
||||
**isIlluminance** | **bool** | | [optional]
|
||||
**illuminance** | **int** | | [optional]
|
||||
**isBrightness** | **bool** | | [optional]
|
||||
**brightness** | **int** | | [optional]
|
||||
**isState** | **bool** | | [optional]
|
||||
**state** | **bool** | | [optional]
|
||||
**isColorTemp** | **bool** | | [optional]
|
||||
**colorTemp** | **int** | | [optional]
|
||||
**isColorXY** | **bool** | | [optional]
|
||||
**colorX** | **int** | | [optional]
|
||||
**colorY** | **int** | | [optional]
|
||||
**isOccupation** | **bool** | | [optional]
|
||||
**occupation** | **bool** | | [optional]
|
||||
**isAlarm** | **bool** | | [optional]
|
||||
**alarm** | **bool** | | [optional]
|
||||
**isWaterLeak** | **bool** | | [optional]
|
||||
**waterLeak** | **bool** | | [optional]
|
||||
**isSmoke** | **bool** | | [optional]
|
||||
**smoke** | **bool** | | [optional]
|
||||
**isVibration** | **bool** | | [optional]
|
||||
**vibration** | **bool** | | [optional]
|
||||
**isAction** | **bool** | | [optional]
|
||||
**action** | **String** | | [optional]
|
||||
**isTemperature** | **bool** | | [optional]
|
||||
**temperature** | **num** | | [optional]
|
||||
**isHumidity** | **bool** | | [optional]
|
||||
**humidity** | **num** | | [optional]
|
||||
**isPressure** | **bool** | | [optional]
|
||||
**pressure** | **num** | | [optional]
|
||||
**isAirQuality** | **bool** | | [optional]
|
||||
**airQuality** | **String** | | [optional]
|
||||
**isFanSpeed** | **bool** | | [optional]
|
||||
**fanSpeed** | **int** | | [optional]
|
||||
**isFanMode** | **bool** | | [optional]
|
||||
**fanMode** | **String** | | [optional]
|
||||
**isConsumption** | **bool** | | [optional]
|
||||
**consumption** | **num** | | [optional]
|
||||
**isCurrentPower** | **bool** | | [optional]
|
||||
**currentPower** | **num** | | [optional]
|
||||
**isVoltage** | **bool** | | [optional]
|
||||
**voltage** | **num** | | [optional]
|
||||
**isLinkQuality** | **bool** | | [optional]
|
||||
**linkQuality** | **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)
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ Name | Type | Description | Notes
|
||||
**providerId** | **String** | | [optional]
|
||||
**providerName** | **String** | | [optional]
|
||||
**lastStateDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**lastMessageDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**battery** | **bool** | | [optional]
|
||||
**batteryStatus** | **int** | | [optional]
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -13,9 +13,9 @@ Name | Type | Description | Notes
|
||||
**date** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**type** | [**EventType**](EventType.md) | | [optional]
|
||||
**roomId** | **String** | | [optional]
|
||||
**deviceState** | [**OneOfDeviceState**](OneOfDeviceState.md) | | [optional]
|
||||
**automationTriggered** | [**OneOfAutomationTriggered**](OneOfAutomationTriggered.md) | | [optional]
|
||||
**alarmTriggered** | [**OneOfAlarmTriggered**](OneOfAlarmTriggered.md) | | [optional]
|
||||
**deviceState** | [**EventDetailDTOAllOfDeviceState**](EventDetailDTOAllOfDeviceState.md) | | [optional]
|
||||
**automationTriggered** | [**EventDetailDTOAllOfAutomationTriggered**](EventDetailDTOAllOfAutomationTriggered.md) | | [optional]
|
||||
**alarmTriggered** | [**EventDetailDTOAllOfAlarmTriggered**](EventDetailDTOAllOfAlarmTriggered.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -8,9 +8,9 @@ import 'package:mycore_api/api.dart';
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**deviceState** | [**OneOfDeviceState**](OneOfDeviceState.md) | | [optional]
|
||||
**automationTriggered** | [**OneOfAutomationTriggered**](OneOfAutomationTriggered.md) | | [optional]
|
||||
**alarmTriggered** | [**OneOfAlarmTriggered**](OneOfAlarmTriggered.md) | | [optional]
|
||||
**deviceState** | [**EventDetailDTOAllOfDeviceState**](EventDetailDTOAllOfDeviceState.md) | | [optional]
|
||||
**automationTriggered** | [**EventDetailDTOAllOfAutomationTriggered**](EventDetailDTOAllOfAutomationTriggered.md) | | [optional]
|
||||
**alarmTriggered** | [**EventDetailDTOAllOfAlarmTriggered**](EventDetailDTOAllOfAlarmTriggered.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
17
mycore_api/doc/EventDetailDTOAllOfAlarmTriggered.md
Normal file
17
mycore_api/doc/EventDetailDTOAllOfAlarmTriggered.md
Normal file
@ -0,0 +1,17 @@
|
||||
# mycore_api.model.EventDetailDTOAllOfAlarmTriggered
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**alarmModeId** | **String** | | [optional]
|
||||
**alarmModeName** | **String** | | [optional]
|
||||
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
16
mycore_api/doc/EventDetailDTOAllOfAutomationTriggered.md
Normal file
16
mycore_api/doc/EventDetailDTOAllOfAutomationTriggered.md
Normal file
@ -0,0 +1,16 @@
|
||||
# mycore_api.model.EventDetailDTOAllOfAutomationTriggered
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**automationId** | **String** | | [optional]
|
||||
**automationName** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
mycore_api/doc/EventDetailDTOAllOfDeviceState.md
Normal file
18
mycore_api/doc/EventDetailDTOAllOfDeviceState.md
Normal file
@ -0,0 +1,18 @@
|
||||
# mycore_api.model.EventDetailDTOAllOfDeviceState
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**deviceId** | **String** | | [optional]
|
||||
**deviceName** | **String** | | [optional]
|
||||
**message** | **String** | | [optional]
|
||||
**deviceType** | [**DeviceType**](DeviceType.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
103
mycore_api/doc/NotificationApi.md
Normal file
103
mycore_api/doc/NotificationApi.md
Normal file
@ -0,0 +1,103 @@
|
||||
# mycore_api.api.NotificationApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**notificationCreateSimpleNotification**](NotificationApi.md#notificationcreatesimplenotification) | **POST** /Notification/all | Create a fcm notification
|
||||
[**notificationCreateSimpleNotificationForSpecificUser**](NotificationApi.md#notificationcreatesimplenotificationforspecificuser) | **POST** /Notification/home/{homeId} | Create a fcm notification for a specific home
|
||||
|
||||
|
||||
# **notificationCreateSimpleNotification**
|
||||
> bool notificationCreateSimpleNotification(notificationDTO)
|
||||
|
||||
Create a fcm notification
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: bearer
|
||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
final api_instance = NotificationApi();
|
||||
final notificationDTO = NotificationDTO(); // NotificationDTO | notificationDTO
|
||||
|
||||
try {
|
||||
final result = api_instance.notificationCreateSimpleNotification(notificationDTO);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling NotificationApi->notificationCreateSimpleNotification: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**notificationDTO** | [**NotificationDTO**](NotificationDTO.md)| notificationDTO |
|
||||
|
||||
### Return type
|
||||
|
||||
**bool**
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer](../README.md#bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **notificationCreateSimpleNotificationForSpecificUser**
|
||||
> bool notificationCreateSimpleNotificationForSpecificUser(homeId, notificationDTO)
|
||||
|
||||
Create a fcm notification for a specific home
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: bearer
|
||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
final api_instance = NotificationApi();
|
||||
final homeId = homeId_example; // String | homeId
|
||||
final notificationDTO = NotificationDTO(); // NotificationDTO | notificationDTO
|
||||
|
||||
try {
|
||||
final result = api_instance.notificationCreateSimpleNotificationForSpecificUser(homeId, notificationDTO);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling NotificationApi->notificationCreateSimpleNotificationForSpecificUser: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**homeId** | **String**| homeId |
|
||||
**notificationDTO** | [**NotificationDTO**](NotificationDTO.md)| notificationDTO |
|
||||
|
||||
### Return type
|
||||
|
||||
**bool**
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer](../README.md#bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
23
mycore_api/doc/NotificationDTO.md
Normal file
23
mycore_api/doc/NotificationDTO.md
Normal file
@ -0,0 +1,23 @@
|
||||
# mycore_api.model.NotificationDTO
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**notificationTitle** | **String** | | [optional]
|
||||
**notificationMessage** | **String** | | [optional]
|
||||
**notificationLabelButton** | **String** | | [optional]
|
||||
**title** | **String** | | [optional]
|
||||
**body** | **String** | | [optional]
|
||||
**type** | **String** | | [optional]
|
||||
**isPushNotification** | **bool** | | [optional]
|
||||
**isButton** | **bool** | | [optional]
|
||||
**buttonLabel** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -17,10 +17,14 @@ Name | Type | Description | Notes
|
||||
**temperature** | **String** | | [optional]
|
||||
**isHumidity** | **bool** | | [optional]
|
||||
**humidity** | **String** | | [optional]
|
||||
**isPressure** | **bool** | | [optional]
|
||||
**pressure** | **String** | | [optional]
|
||||
**isMotion** | **bool** | | [optional]
|
||||
**motion** | **bool** | | [optional]
|
||||
**isDoor** | **bool** | | [optional]
|
||||
**door** | **bool** | | [optional]
|
||||
**isIlluminance** | **bool** | | [optional]
|
||||
**illuminance** | **String** | | [optional]
|
||||
**environmentalDevices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||
**securityDevices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||
|
||||
|
||||
@ -14,10 +14,14 @@ Name | Type | Description | Notes
|
||||
**temperature** | **String** | | [optional]
|
||||
**isHumidity** | **bool** | | [optional]
|
||||
**humidity** | **String** | | [optional]
|
||||
**isPressure** | **bool** | | [optional]
|
||||
**pressure** | **String** | | [optional]
|
||||
**isMotion** | **bool** | | [optional]
|
||||
**motion** | **bool** | | [optional]
|
||||
**isDoor** | **bool** | | [optional]
|
||||
**door** | **bool** | | [optional]
|
||||
**isIlluminance** | **bool** | | [optional]
|
||||
**illuminance** | **String** | | [optional]
|
||||
**environmentalDevices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||
**securityDevices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -17,8 +17,8 @@ Name | Type | Description | Notes
|
||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeProgrammedMode**](AlarmModeProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeGeolocalizedMode**](AlarmModeGeolocalizedMode.md) | | [optional]
|
||||
**programmedMode** | [**AlarmModeDetailDTOAllOfProgrammedMode**](AlarmModeDetailDTOAllOfProgrammedMode.md) | | [optional]
|
||||
**geolocalizedMode** | [**AlarmModeDetailDTOAllOfGeolocalizedMode**](AlarmModeDetailDTOAllOfGeolocalizedMode.md) | | [optional]
|
||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||
**devicesIds** | **List<String>** | | [optional] [default to const []]
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import 'package:mycore_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://192.168.31.140*
|
||||
All URIs are relative to *http://localhost:25049*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
|
||||
@ -42,6 +42,7 @@ part 'api/home_api.dart';
|
||||
part 'api/iot_api.dart';
|
||||
part 'api/layout_api.dart';
|
||||
part 'api/mqtt_api.dart';
|
||||
part 'api/notification_api.dart';
|
||||
part 'api/odd_api.dart';
|
||||
part 'api/provider_api.dart';
|
||||
part 'api/room_api.dart';
|
||||
@ -59,8 +60,8 @@ part 'model/alarm_mode_create_or_update_detail_dto_all_of.dart';
|
||||
part 'model/alarm_mode_dto.dart';
|
||||
part 'model/alarm_mode_detail_dto.dart';
|
||||
part 'model/alarm_mode_detail_dto_all_of.dart';
|
||||
part 'model/alarm_mode_geolocalized_mode.dart';
|
||||
part 'model/alarm_mode_programmed_mode.dart';
|
||||
part 'model/alarm_mode_detail_dto_all_of_geolocalized_mode.dart';
|
||||
part 'model/alarm_mode_detail_dto_all_of_programmed_mode.dart';
|
||||
part 'model/alarm_triggered.dart';
|
||||
part 'model/alarm_type.dart';
|
||||
part 'model/automation_dto.dart';
|
||||
@ -86,7 +87,12 @@ part 'model/electricity_production.dart';
|
||||
part 'model/event_dto.dart';
|
||||
part 'model/event_detail_dto.dart';
|
||||
part 'model/event_detail_dto_all_of.dart';
|
||||
part 'model/event_detail_dto_all_of_alarm_triggered.dart';
|
||||
part 'model/event_detail_dto_all_of_automation_triggered.dart';
|
||||
part 'model/event_detail_dto_all_of_device_state.dart';
|
||||
part 'model/event_filter.dart';
|
||||
part 'model/event_get_device_type_parameter.dart';
|
||||
part 'model/event_get_event_type_parameter.dart';
|
||||
part 'model/event_home_filter.dart';
|
||||
part 'model/event_home_filter_all_of.dart';
|
||||
part 'model/event_type.dart';
|
||||
@ -99,12 +105,15 @@ part 'model/group_detail_dto.dart';
|
||||
part 'model/group_detail_dto_all_of.dart';
|
||||
part 'model/group_summary_dto.dart';
|
||||
part 'model/home_dto.dart';
|
||||
part 'model/home_dto_current_alarm_mode.dart';
|
||||
part 'model/home_detail_dto.dart';
|
||||
part 'model/home_detail_dto_all_of.dart';
|
||||
part 'model/list_response_of_event_detail_dto_and_event_home_filter.dart';
|
||||
part 'model/list_response_of_event_detail_dto_and_event_home_filter_request_parameters.dart';
|
||||
part 'model/login_dto.dart';
|
||||
part 'model/means_of_communication.dart';
|
||||
part 'model/mqtt_message_dto.dart';
|
||||
part 'model/notification_dto.dart';
|
||||
part 'model/odd_nice.dart';
|
||||
part 'model/odd_nice_odds.dart';
|
||||
part 'model/odd_object.dart';
|
||||
@ -122,6 +131,7 @@ part 'model/screen_device.dart';
|
||||
part 'model/smart_garden_message.dart';
|
||||
part 'model/smart_printer_message.dart';
|
||||
part 'model/time_period_alarm.dart';
|
||||
part 'model/time_period_alarm_alarm_mode.dart';
|
||||
part 'model/token_dto.dart';
|
||||
part 'model/trigger.dart';
|
||||
part 'model/trigger_type.dart';
|
||||
|
||||
@ -150,7 +150,7 @@ class EventApi {
|
||||
/// * [EventGetEventTypeParameter] eventType:
|
||||
///
|
||||
/// * [EventGetDeviceTypeParameter] deviceType:
|
||||
Future<Response> eventGetWithHttpInfo(String homeId, { String? deviceId, String? roomId, int? startIndex, int? count, DateTime? dateStart, DateTime? dateEnd, EventType? eventType, DeviceType? deviceType, }) async {
|
||||
Future<Response> eventGetWithHttpInfo(String homeId, { String? deviceId, String? roomId, int? startIndex, int? count, DateTime? dateStart, DateTime? dateEnd, EventGetEventTypeParameter? eventType, EventGetDeviceTypeParameter? deviceType, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/api/event/{homeId}'
|
||||
.replaceAll('{homeId}', homeId);
|
||||
@ -223,7 +223,7 @@ class EventApi {
|
||||
/// * [EventGetEventTypeParameter] eventType:
|
||||
///
|
||||
/// * [EventGetDeviceTypeParameter] deviceType:
|
||||
Future<ListResponseOfEventDetailDTOAndEventHomeFilter?> eventGet(String homeId, { String? deviceId, String? roomId, int? startIndex, int? count, DateTime? dateStart, DateTime? dateEnd, EventType? eventType,DeviceType? deviceType, }) async {
|
||||
Future<ListResponseOfEventDetailDTOAndEventHomeFilter?> eventGet(String homeId, { String? deviceId, String? roomId, int? startIndex, int? count, DateTime? dateStart, DateTime? dateEnd, EventGetEventTypeParameter? eventType, EventGetDeviceTypeParameter? deviceType, }) async {
|
||||
final response = await eventGetWithHttpInfo(homeId, deviceId: deviceId, roomId: roomId, startIndex: startIndex, count: count, dateStart: dateStart, dateEnd: dateEnd, eventType: eventType, deviceType: deviceType, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
|
||||
133
mycore_api/lib/api/notification_api.dart
Normal file
133
mycore_api/lib/api/notification_api.dart
Normal file
@ -0,0 +1,133 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
class NotificationApi {
|
||||
NotificationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Create a fcm notification
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [NotificationDTO] notificationDTO (required):
|
||||
/// notificationDTO
|
||||
Future<Response> notificationCreateSimpleNotificationWithHttpInfo(NotificationDTO notificationDTO,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/Notification/all';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = notificationDTO;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Create a fcm notification
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [NotificationDTO] notificationDTO (required):
|
||||
/// notificationDTO
|
||||
Future<bool?> notificationCreateSimpleNotification(NotificationDTO notificationDTO,) async {
|
||||
final response = await notificationCreateSimpleNotificationWithHttpInfo(notificationDTO,);
|
||||
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), 'bool',) as bool;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Create a fcm notification for a specific home
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] homeId (required):
|
||||
/// homeId
|
||||
///
|
||||
/// * [NotificationDTO] notificationDTO (required):
|
||||
/// notificationDTO
|
||||
Future<Response> notificationCreateSimpleNotificationForSpecificUserWithHttpInfo(String homeId, NotificationDTO notificationDTO,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/Notification/home/{homeId}'
|
||||
.replaceAll('{homeId}', homeId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = notificationDTO;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Create a fcm notification for a specific home
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] homeId (required):
|
||||
/// homeId
|
||||
///
|
||||
/// * [NotificationDTO] notificationDTO (required):
|
||||
/// notificationDTO
|
||||
Future<bool?> notificationCreateSimpleNotificationForSpecificUser(String homeId, NotificationDTO notificationDTO,) async {
|
||||
final response = await notificationCreateSimpleNotificationForSpecificUserWithHttpInfo(homeId, notificationDTO,);
|
||||
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), 'bool',) as bool;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -11,11 +11,13 @@
|
||||
part of openapi.api;
|
||||
|
||||
class ApiClient {
|
||||
ApiClient({this.basePath = 'http://192.168.31.140', this.authentication});
|
||||
ApiClient({this.basePath = 'http://localhost:25049', 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 'Action':
|
||||
return Action.fromJson(value);
|
||||
case 'ActionType':
|
||||
@ -206,10 +197,10 @@ class ApiClient {
|
||||
return AlarmModeDetailDTO.fromJson(value);
|
||||
case 'AlarmModeDetailDTOAllOf':
|
||||
return AlarmModeDetailDTOAllOf.fromJson(value);
|
||||
case 'AlarmModeGeolocalizedMode':
|
||||
return AlarmModeGeolocalizedMode.fromJson(value);
|
||||
case 'AlarmModeProgrammedMode':
|
||||
return AlarmModeProgrammedMode.fromJson(value);
|
||||
case 'AlarmModeDetailDTOAllOfGeolocalizedMode':
|
||||
return AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(value);
|
||||
case 'AlarmModeDetailDTOAllOfProgrammedMode':
|
||||
return AlarmModeDetailDTOAllOfProgrammedMode.fromJson(value);
|
||||
case 'AlarmTriggered':
|
||||
return AlarmTriggered.fromJson(value);
|
||||
case 'AlarmType':
|
||||
@ -260,8 +251,18 @@ class ApiClient {
|
||||
return EventDetailDTO.fromJson(value);
|
||||
case 'EventDetailDTOAllOf':
|
||||
return EventDetailDTOAllOf.fromJson(value);
|
||||
case 'EventDetailDTOAllOfAlarmTriggered':
|
||||
return EventDetailDTOAllOfAlarmTriggered.fromJson(value);
|
||||
case 'EventDetailDTOAllOfAutomationTriggered':
|
||||
return EventDetailDTOAllOfAutomationTriggered.fromJson(value);
|
||||
case 'EventDetailDTOAllOfDeviceState':
|
||||
return EventDetailDTOAllOfDeviceState.fromJson(value);
|
||||
case 'EventFilter':
|
||||
return EventFilter.fromJson(value);
|
||||
case 'EventGetDeviceTypeParameter':
|
||||
return EventGetDeviceTypeParameter.fromJson(value);
|
||||
case 'EventGetEventTypeParameter':
|
||||
return EventGetEventTypeParameter.fromJson(value);
|
||||
case 'EventHomeFilter':
|
||||
return EventHomeFilter.fromJson(value);
|
||||
case 'EventHomeFilterAllOf':
|
||||
@ -286,18 +287,24 @@ class ApiClient {
|
||||
return GroupSummaryDTO.fromJson(value);
|
||||
case 'HomeDTO':
|
||||
return HomeDTO.fromJson(value);
|
||||
case 'HomeDTOCurrentAlarmMode':
|
||||
return HomeDTOCurrentAlarmMode.fromJson(value);
|
||||
case 'HomeDetailDTO':
|
||||
return HomeDetailDTO.fromJson(value);
|
||||
case 'HomeDetailDTOAllOf':
|
||||
return HomeDetailDTOAllOf.fromJson(value);
|
||||
case 'ListResponseOfEventDetailDTOAndEventHomeFilter':
|
||||
return ListResponseOfEventDetailDTOAndEventHomeFilter.fromJson(value);
|
||||
case 'ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters':
|
||||
return ListResponseOfEventDetailDTOAndEventHomeFilterRequestParameters.fromJson(value);
|
||||
case 'LoginDTO':
|
||||
return LoginDTO.fromJson(value);
|
||||
case 'MeansOfCommunication':
|
||||
return MeansOfCommunicationTypeTransformer().decode(value);
|
||||
case 'MqttMessageDTO':
|
||||
return MqttMessageDTO.fromJson(value);
|
||||
case 'NotificationDTO':
|
||||
return NotificationDTO.fromJson(value);
|
||||
case 'OddNice':
|
||||
return OddNice.fromJson(value);
|
||||
case 'OddNiceOdds':
|
||||
@ -332,6 +339,8 @@ class ApiClient {
|
||||
return SmartPrinterMessage.fromJson(value);
|
||||
case 'TimePeriodAlarm':
|
||||
return TimePeriodAlarm.fromJson(value);
|
||||
case 'TimePeriodAlarmAlarmMode':
|
||||
return TimePeriodAlarmAlarmMode.fromJson(value);
|
||||
case 'TokenDTO':
|
||||
return TokenDTO.fromJson(value);
|
||||
case 'Trigger':
|
||||
|
||||
@ -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';
|
||||
}
|
||||
|
||||
@ -73,29 +73,43 @@ class Action {
|
||||
String toString() => 'Action[groupId=$groupId, deviceId=$deviceId, states=$states, rawRequest=$rawRequest, providerId=$providerId, type=$type, isForce=$isForce]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (groupId != null) {
|
||||
_json[r'groupId'] = groupId;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.groupId != null) {
|
||||
json[r'groupId'] = this.groupId;
|
||||
} else {
|
||||
json[r'groupId'] = null;
|
||||
}
|
||||
if (deviceId != null) {
|
||||
_json[r'deviceId'] = deviceId;
|
||||
if (this.deviceId != null) {
|
||||
json[r'deviceId'] = this.deviceId;
|
||||
} else {
|
||||
json[r'deviceId'] = null;
|
||||
}
|
||||
if (states != null) {
|
||||
_json[r'states'] = states;
|
||||
if (this.states != null) {
|
||||
json[r'states'] = this.states;
|
||||
} else {
|
||||
json[r'states'] = null;
|
||||
}
|
||||
if (rawRequest != null) {
|
||||
_json[r'rawRequest'] = rawRequest;
|
||||
if (this.rawRequest != null) {
|
||||
json[r'rawRequest'] = this.rawRequest;
|
||||
} else {
|
||||
json[r'rawRequest'] = null;
|
||||
}
|
||||
if (providerId != null) {
|
||||
_json[r'providerId'] = providerId;
|
||||
if (this.providerId != null) {
|
||||
json[r'providerId'] = this.providerId;
|
||||
} else {
|
||||
json[r'providerId'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (isForce != null) {
|
||||
_json[r'isForce'] = isForce;
|
||||
if (this.isForce != null) {
|
||||
json[r'isForce'] = this.isForce;
|
||||
} else {
|
||||
json[r'isForce'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [Action] instance and imports its values from
|
||||
@ -119,7 +133,7 @@ class Action {
|
||||
return Action(
|
||||
groupId: mapValueOfType<String>(json, r'groupId'),
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId'),
|
||||
states: AutomationState.listFromJson(json[r'states']) ?? const [],
|
||||
states: AutomationState.listFromJson(json[r'states']),
|
||||
rawRequest: mapValueOfType<String>(json, r'rawRequest'),
|
||||
providerId: mapValueOfType<String>(json, r'providerId'),
|
||||
type: ActionType.fromJson(json[r'type']),
|
||||
@ -129,7 +143,7 @@ class Action {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<Action>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<Action> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <Action>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -160,12 +174,10 @@ class Action {
|
||||
static Map<String, List<Action>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<Action>>{};
|
||||
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 = Action.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = Action.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -42,7 +42,7 @@ class ActionType {
|
||||
|
||||
static ActionType? fromJson(dynamic value) => ActionTypeTypeTransformer().decode(value);
|
||||
|
||||
static List<ActionType>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ActionType> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ActionType>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -75,7 +75,7 @@ class ActionTypeTypeTransformer {
|
||||
/// and users are still using an old app with the old code.
|
||||
ActionType? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
switch (data) {
|
||||
case r'DELAY': return ActionType.DELAY;
|
||||
case r'DEVICE': return ActionType.DEVICE;
|
||||
case r'HTTP': return ActionType.HTTP;
|
||||
|
||||
@ -83,9 +83,9 @@ class AlarmMode {
|
||||
///
|
||||
AlarmType? type;
|
||||
|
||||
AlarmModeProgrammedMode? programmedMode;
|
||||
AlarmModeDetailDTOAllOfProgrammedMode? programmedMode;
|
||||
|
||||
AlarmModeGeolocalizedMode? geolocalizedMode;
|
||||
AlarmModeDetailDTOAllOfGeolocalizedMode? geolocalizedMode;
|
||||
|
||||
List<Trigger>? triggers;
|
||||
|
||||
@ -132,50 +132,78 @@ class AlarmMode {
|
||||
String toString() => 'AlarmMode[id=$id, homeId=$homeId, name=$name, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, type=$type, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode, triggers=$triggers, actions=$actions, devicesIds=$devicesIds]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (activated != null) {
|
||||
_json[r'activated'] = activated;
|
||||
if (this.activated != null) {
|
||||
json[r'activated'] = this.activated;
|
||||
} else {
|
||||
json[r'activated'] = null;
|
||||
}
|
||||
if (isDefault != null) {
|
||||
_json[r'isDefault'] = isDefault;
|
||||
if (this.isDefault != null) {
|
||||
json[r'isDefault'] = this.isDefault;
|
||||
} else {
|
||||
json[r'isDefault'] = null;
|
||||
}
|
||||
if (notification != null) {
|
||||
_json[r'notification'] = notification;
|
||||
if (this.notification != null) {
|
||||
json[r'notification'] = this.notification;
|
||||
} else {
|
||||
json[r'notification'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (programmedMode != null) {
|
||||
_json[r'programmedMode'] = programmedMode;
|
||||
if (this.programmedMode != null) {
|
||||
json[r'programmedMode'] = this.programmedMode;
|
||||
} else {
|
||||
json[r'programmedMode'] = null;
|
||||
}
|
||||
if (geolocalizedMode != null) {
|
||||
_json[r'geolocalizedMode'] = geolocalizedMode;
|
||||
if (this.geolocalizedMode != null) {
|
||||
json[r'geolocalizedMode'] = this.geolocalizedMode;
|
||||
} else {
|
||||
json[r'geolocalizedMode'] = null;
|
||||
}
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (devicesIds != null) {
|
||||
_json[r'devicesIds'] = devicesIds;
|
||||
if (this.devicesIds != null) {
|
||||
json[r'devicesIds'] = this.devicesIds;
|
||||
} else {
|
||||
json[r'devicesIds'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmMode] instance and imports its values from
|
||||
@ -206,10 +234,10 @@ class AlarmMode {
|
||||
createdDate: mapDateTime(json, r'createdDate', ''),
|
||||
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||
type: AlarmType.fromJson(json[r'type']),
|
||||
programmedMode: AlarmModeProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: AlarmModeGeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
programmedMode: AlarmModeDetailDTOAllOfProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
devicesIds: json[r'devicesIds'] is List
|
||||
? (json[r'devicesIds'] as List).cast<String>()
|
||||
: const [],
|
||||
@ -218,7 +246,7 @@ class AlarmMode {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmMode>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmMode> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmMode>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -249,12 +277,10 @@ class AlarmMode {
|
||||
static Map<String, List<AlarmMode>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmMode>>{};
|
||||
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 = AlarmMode.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmMode.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -86,9 +86,9 @@ class AlarmModeCreateOrUpdateDetailDTO {
|
||||
|
||||
List<Action>? actions;
|
||||
|
||||
ProgrammedMode? programmedMode;
|
||||
AlarmModeDetailDTOAllOfProgrammedMode? programmedMode;
|
||||
|
||||
GeolocalizedMode? geolocalizedMode;
|
||||
AlarmModeDetailDTOAllOfGeolocalizedMode? geolocalizedMode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTO &&
|
||||
@ -127,47 +127,73 @@ class AlarmModeCreateOrUpdateDetailDTO {
|
||||
String toString() => 'AlarmModeCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (activated != null) {
|
||||
_json[r'activated'] = activated;
|
||||
if (this.activated != null) {
|
||||
json[r'activated'] = this.activated;
|
||||
} else {
|
||||
json[r'activated'] = null;
|
||||
}
|
||||
if (isDefault != null) {
|
||||
_json[r'isDefault'] = isDefault;
|
||||
if (this.isDefault != null) {
|
||||
json[r'isDefault'] = this.isDefault;
|
||||
} else {
|
||||
json[r'isDefault'] = null;
|
||||
}
|
||||
if (notification != null) {
|
||||
_json[r'notification'] = notification;
|
||||
if (this.notification != null) {
|
||||
json[r'notification'] = this.notification;
|
||||
} else {
|
||||
json[r'notification'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (programmedMode != null) {
|
||||
_json[r'programmedMode'] = programmedMode;
|
||||
if (this.programmedMode != null) {
|
||||
json[r'programmedMode'] = this.programmedMode;
|
||||
} else {
|
||||
json[r'programmedMode'] = null;
|
||||
}
|
||||
if (geolocalizedMode != null) {
|
||||
_json[r'geolocalizedMode'] = geolocalizedMode;
|
||||
if (this.geolocalizedMode != null) {
|
||||
json[r'geolocalizedMode'] = this.geolocalizedMode;
|
||||
} else {
|
||||
json[r'geolocalizedMode'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeCreateOrUpdateDetailDTO] instance and imports its values from
|
||||
@ -198,16 +224,16 @@ class AlarmModeCreateOrUpdateDetailDTO {
|
||||
notification: mapValueOfType<bool>(json, r'notification'),
|
||||
createdDate: mapDateTime(json, r'createdDate', ''),
|
||||
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
programmedMode: AlarmModeDetailDTOAllOfProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeCreateOrUpdateDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmModeCreateOrUpdateDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeCreateOrUpdateDetailDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -238,12 +264,10 @@ class AlarmModeCreateOrUpdateDetailDTO {
|
||||
static Map<String, List<AlarmModeCreateOrUpdateDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeCreateOrUpdateDetailDTO>>{};
|
||||
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 = AlarmModeCreateOrUpdateDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmModeCreateOrUpdateDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -23,9 +23,9 @@ class AlarmModeCreateOrUpdateDetailDTOAllOf {
|
||||
|
||||
List<Action>? actions;
|
||||
|
||||
ProgrammedMode? programmedMode;
|
||||
AlarmModeDetailDTOAllOfProgrammedMode? programmedMode;
|
||||
|
||||
GeolocalizedMode? geolocalizedMode;
|
||||
AlarmModeDetailDTOAllOfGeolocalizedMode? geolocalizedMode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTOAllOf &&
|
||||
@ -46,20 +46,28 @@ class AlarmModeCreateOrUpdateDetailDTOAllOf {
|
||||
String toString() => 'AlarmModeCreateOrUpdateDetailDTOAllOf[triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (programmedMode != null) {
|
||||
_json[r'programmedMode'] = programmedMode;
|
||||
if (this.programmedMode != null) {
|
||||
json[r'programmedMode'] = this.programmedMode;
|
||||
} else {
|
||||
json[r'programmedMode'] = null;
|
||||
}
|
||||
if (geolocalizedMode != null) {
|
||||
_json[r'geolocalizedMode'] = geolocalizedMode;
|
||||
if (this.geolocalizedMode != null) {
|
||||
json[r'geolocalizedMode'] = this.geolocalizedMode;
|
||||
} else {
|
||||
json[r'geolocalizedMode'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance and imports its values from
|
||||
@ -81,16 +89,16 @@ class AlarmModeCreateOrUpdateDetailDTOAllOf {
|
||||
}());
|
||||
|
||||
return AlarmModeCreateOrUpdateDetailDTOAllOf(
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
programmedMode: AlarmModeDetailDTOAllOfProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeCreateOrUpdateDetailDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmModeCreateOrUpdateDetailDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeCreateOrUpdateDetailDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -121,12 +129,10 @@ class AlarmModeCreateOrUpdateDetailDTOAllOf {
|
||||
static Map<String, List<AlarmModeCreateOrUpdateDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeCreateOrUpdateDetailDTOAllOf>>{};
|
||||
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 = AlarmModeCreateOrUpdateDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmModeCreateOrUpdateDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -89,9 +89,9 @@ class AlarmModeDetailDTO {
|
||||
|
||||
List<DeviceDetailDTO>? devices;
|
||||
|
||||
ProgrammedMode? programmedMode;
|
||||
AlarmModeDetailDTOAllOfProgrammedMode? programmedMode;
|
||||
|
||||
GeolocalizedMode? geolocalizedMode;
|
||||
AlarmModeDetailDTOAllOfGeolocalizedMode? geolocalizedMode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTO &&
|
||||
@ -132,50 +132,78 @@ class AlarmModeDetailDTO {
|
||||
String toString() => 'AlarmModeDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, actions=$actions, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (activated != null) {
|
||||
_json[r'activated'] = activated;
|
||||
if (this.activated != null) {
|
||||
json[r'activated'] = this.activated;
|
||||
} else {
|
||||
json[r'activated'] = null;
|
||||
}
|
||||
if (isDefault != null) {
|
||||
_json[r'isDefault'] = isDefault;
|
||||
if (this.isDefault != null) {
|
||||
json[r'isDefault'] = this.isDefault;
|
||||
} else {
|
||||
json[r'isDefault'] = null;
|
||||
}
|
||||
if (notification != null) {
|
||||
_json[r'notification'] = notification;
|
||||
if (this.notification != null) {
|
||||
json[r'notification'] = this.notification;
|
||||
} else {
|
||||
json[r'notification'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (devices != null) {
|
||||
_json[r'devices'] = devices;
|
||||
if (this.devices != null) {
|
||||
json[r'devices'] = this.devices;
|
||||
} else {
|
||||
json[r'devices'] = null;
|
||||
}
|
||||
if (programmedMode != null) {
|
||||
_json[r'programmedMode'] = programmedMode;
|
||||
if (this.programmedMode != null) {
|
||||
json[r'programmedMode'] = this.programmedMode;
|
||||
} else {
|
||||
json[r'programmedMode'] = null;
|
||||
}
|
||||
if (geolocalizedMode != null) {
|
||||
_json[r'geolocalizedMode'] = geolocalizedMode;
|
||||
if (this.geolocalizedMode != null) {
|
||||
json[r'geolocalizedMode'] = this.geolocalizedMode;
|
||||
} else {
|
||||
json[r'geolocalizedMode'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeDetailDTO] instance and imports its values from
|
||||
@ -206,17 +234,17 @@ class AlarmModeDetailDTO {
|
||||
notification: mapValueOfType<bool>(json, r'notification'),
|
||||
createdDate: mapDateTime(json, r'createdDate', ''),
|
||||
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? const [],
|
||||
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']),
|
||||
programmedMode: AlarmModeDetailDTOAllOfProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmModeDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeDetailDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -247,12 +275,10 @@ class AlarmModeDetailDTO {
|
||||
static Map<String, List<AlarmModeDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeDetailDTO>>{};
|
||||
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 = AlarmModeDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmModeDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -26,9 +26,9 @@ class AlarmModeDetailDTOAllOf {
|
||||
|
||||
List<DeviceDetailDTO>? devices;
|
||||
|
||||
ProgrammedMode? programmedMode;
|
||||
AlarmModeDetailDTOAllOfProgrammedMode? programmedMode;
|
||||
|
||||
GeolocalizedMode? geolocalizedMode;
|
||||
AlarmModeDetailDTOAllOfGeolocalizedMode? geolocalizedMode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTOAllOf &&
|
||||
@ -51,23 +51,33 @@ class AlarmModeDetailDTOAllOf {
|
||||
String toString() => 'AlarmModeDetailDTOAllOf[triggers=$triggers, actions=$actions, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (devices != null) {
|
||||
_json[r'devices'] = devices;
|
||||
if (this.devices != null) {
|
||||
json[r'devices'] = this.devices;
|
||||
} else {
|
||||
json[r'devices'] = null;
|
||||
}
|
||||
if (programmedMode != null) {
|
||||
_json[r'programmedMode'] = programmedMode;
|
||||
if (this.programmedMode != null) {
|
||||
json[r'programmedMode'] = this.programmedMode;
|
||||
} else {
|
||||
json[r'programmedMode'] = null;
|
||||
}
|
||||
if (geolocalizedMode != null) {
|
||||
_json[r'geolocalizedMode'] = geolocalizedMode;
|
||||
if (this.geolocalizedMode != null) {
|
||||
json[r'geolocalizedMode'] = this.geolocalizedMode;
|
||||
} else {
|
||||
json[r'geolocalizedMode'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeDetailDTOAllOf] instance and imports its values from
|
||||
@ -89,17 +99,17 @@ class AlarmModeDetailDTOAllOf {
|
||||
}());
|
||||
|
||||
return AlarmModeDetailDTOAllOf(
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? const [],
|
||||
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']),
|
||||
programmedMode: AlarmModeDetailDTOAllOfProgrammedMode.fromJson(json[r'programmedMode']),
|
||||
geolocalizedMode: AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeDetailDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmModeDetailDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeDetailDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -130,12 +140,10 @@ class AlarmModeDetailDTOAllOf {
|
||||
static Map<String, List<AlarmModeDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeDetailDTOAllOf>>{};
|
||||
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 = AlarmModeDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmModeDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -0,0 +1,145 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AlarmModeDetailDTOAllOfGeolocalizedMode {
|
||||
/// Returns a new [AlarmModeDetailDTOAllOfGeolocalizedMode] instance.
|
||||
AlarmModeDetailDTOAllOfGeolocalizedMode({
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.homeMode,
|
||||
this.absentMode,
|
||||
});
|
||||
|
||||
String? latitude;
|
||||
|
||||
String? longitude;
|
||||
|
||||
TimePeriodAlarmAlarmMode? homeMode;
|
||||
|
||||
TimePeriodAlarmAlarmMode? absentMode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTOAllOfGeolocalizedMode &&
|
||||
other.latitude == latitude &&
|
||||
other.longitude == longitude &&
|
||||
other.homeMode == homeMode &&
|
||||
other.absentMode == absentMode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(latitude == null ? 0 : latitude!.hashCode) +
|
||||
(longitude == null ? 0 : longitude!.hashCode) +
|
||||
(homeMode == null ? 0 : homeMode!.hashCode) +
|
||||
(absentMode == null ? 0 : absentMode!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AlarmModeDetailDTOAllOfGeolocalizedMode[latitude=$latitude, longitude=$longitude, homeMode=$homeMode, absentMode=$absentMode]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.latitude != null) {
|
||||
json[r'latitude'] = this.latitude;
|
||||
} else {
|
||||
json[r'latitude'] = null;
|
||||
}
|
||||
if (this.longitude != null) {
|
||||
json[r'longitude'] = this.longitude;
|
||||
} else {
|
||||
json[r'longitude'] = null;
|
||||
}
|
||||
if (this.homeMode != null) {
|
||||
json[r'homeMode'] = this.homeMode;
|
||||
} else {
|
||||
json[r'homeMode'] = null;
|
||||
}
|
||||
if (this.absentMode != null) {
|
||||
json[r'absentMode'] = this.absentMode;
|
||||
} else {
|
||||
json[r'absentMode'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeDetailDTOAllOfGeolocalizedMode] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AlarmModeDetailDTOAllOfGeolocalizedMode? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AlarmModeDetailDTOAllOfGeolocalizedMode[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AlarmModeDetailDTOAllOfGeolocalizedMode[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AlarmModeDetailDTOAllOfGeolocalizedMode(
|
||||
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||
homeMode: TimePeriodAlarmAlarmMode.fromJson(json[r'homeMode']),
|
||||
absentMode: TimePeriodAlarmAlarmMode.fromJson(json[r'absentMode']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeDetailDTOAllOfGeolocalizedMode> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeDetailDTOAllOfGeolocalizedMode>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AlarmModeDetailDTOAllOfGeolocalizedMode> mapFromJson(dynamic json) {
|
||||
final map = <String, AlarmModeDetailDTOAllOfGeolocalizedMode>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AlarmModeDetailDTOAllOfGeolocalizedMode.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AlarmModeDetailDTOAllOfGeolocalizedMode-objects as value to a dart map
|
||||
static Map<String, List<AlarmModeDetailDTOAllOfGeolocalizedMode>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeDetailDTOAllOfGeolocalizedMode>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AlarmModeDetailDTOAllOfGeolocalizedMode.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,178 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AlarmModeDetailDTOAllOfProgrammedMode {
|
||||
/// Returns a new [AlarmModeDetailDTOAllOfProgrammedMode] instance.
|
||||
AlarmModeDetailDTOAllOfProgrammedMode({
|
||||
this.monday = const [],
|
||||
this.tuesday = const [],
|
||||
this.wednesday = const [],
|
||||
this.thursday = const [],
|
||||
this.friday = const [],
|
||||
this.saturday = const [],
|
||||
this.sunday = const [],
|
||||
});
|
||||
|
||||
List<TimePeriodAlarm>? monday;
|
||||
|
||||
List<TimePeriodAlarm>? tuesday;
|
||||
|
||||
List<TimePeriodAlarm>? wednesday;
|
||||
|
||||
List<TimePeriodAlarm>? thursday;
|
||||
|
||||
List<TimePeriodAlarm>? friday;
|
||||
|
||||
List<TimePeriodAlarm>? saturday;
|
||||
|
||||
List<TimePeriodAlarm>? sunday;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTOAllOfProgrammedMode &&
|
||||
other.monday == monday &&
|
||||
other.tuesday == tuesday &&
|
||||
other.wednesday == wednesday &&
|
||||
other.thursday == thursday &&
|
||||
other.friday == friday &&
|
||||
other.saturday == saturday &&
|
||||
other.sunday == sunday;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(monday == null ? 0 : monday!.hashCode) +
|
||||
(tuesday == null ? 0 : tuesday!.hashCode) +
|
||||
(wednesday == null ? 0 : wednesday!.hashCode) +
|
||||
(thursday == null ? 0 : thursday!.hashCode) +
|
||||
(friday == null ? 0 : friday!.hashCode) +
|
||||
(saturday == null ? 0 : saturday!.hashCode) +
|
||||
(sunday == null ? 0 : sunday!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AlarmModeDetailDTOAllOfProgrammedMode[monday=$monday, tuesday=$tuesday, wednesday=$wednesday, thursday=$thursday, friday=$friday, saturday=$saturday, sunday=$sunday]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.monday != null) {
|
||||
json[r'monday'] = this.monday;
|
||||
} else {
|
||||
json[r'monday'] = null;
|
||||
}
|
||||
if (this.tuesday != null) {
|
||||
json[r'tuesday'] = this.tuesday;
|
||||
} else {
|
||||
json[r'tuesday'] = null;
|
||||
}
|
||||
if (this.wednesday != null) {
|
||||
json[r'wednesday'] = this.wednesday;
|
||||
} else {
|
||||
json[r'wednesday'] = null;
|
||||
}
|
||||
if (this.thursday != null) {
|
||||
json[r'thursday'] = this.thursday;
|
||||
} else {
|
||||
json[r'thursday'] = null;
|
||||
}
|
||||
if (this.friday != null) {
|
||||
json[r'friday'] = this.friday;
|
||||
} else {
|
||||
json[r'friday'] = null;
|
||||
}
|
||||
if (this.saturday != null) {
|
||||
json[r'saturday'] = this.saturday;
|
||||
} else {
|
||||
json[r'saturday'] = null;
|
||||
}
|
||||
if (this.sunday != null) {
|
||||
json[r'sunday'] = this.sunday;
|
||||
} else {
|
||||
json[r'sunday'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeDetailDTOAllOfProgrammedMode] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AlarmModeDetailDTOAllOfProgrammedMode? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AlarmModeDetailDTOAllOfProgrammedMode[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AlarmModeDetailDTOAllOfProgrammedMode[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AlarmModeDetailDTOAllOfProgrammedMode(
|
||||
monday: TimePeriodAlarm.listFromJson(json[r'monday']),
|
||||
tuesday: TimePeriodAlarm.listFromJson(json[r'tuesday']),
|
||||
wednesday: TimePeriodAlarm.listFromJson(json[r'wednesday']),
|
||||
thursday: TimePeriodAlarm.listFromJson(json[r'thursday']),
|
||||
friday: TimePeriodAlarm.listFromJson(json[r'friday']),
|
||||
saturday: TimePeriodAlarm.listFromJson(json[r'saturday']),
|
||||
sunday: TimePeriodAlarm.listFromJson(json[r'sunday']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeDetailDTOAllOfProgrammedMode> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeDetailDTOAllOfProgrammedMode>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AlarmModeDetailDTOAllOfProgrammedMode.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AlarmModeDetailDTOAllOfProgrammedMode> mapFromJson(dynamic json) {
|
||||
final map = <String, AlarmModeDetailDTOAllOfProgrammedMode>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AlarmModeDetailDTOAllOfProgrammedMode.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AlarmModeDetailDTOAllOfProgrammedMode-objects as value to a dart map
|
||||
static Map<String, List<AlarmModeDetailDTOAllOfProgrammedMode>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeDetailDTOAllOfProgrammedMode>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AlarmModeDetailDTOAllOfProgrammedMode.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
@ -107,35 +107,53 @@ class AlarmModeDTO {
|
||||
String toString() => 'AlarmModeDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (activated != null) {
|
||||
_json[r'activated'] = activated;
|
||||
if (this.activated != null) {
|
||||
json[r'activated'] = this.activated;
|
||||
} else {
|
||||
json[r'activated'] = null;
|
||||
}
|
||||
if (isDefault != null) {
|
||||
_json[r'isDefault'] = isDefault;
|
||||
if (this.isDefault != null) {
|
||||
json[r'isDefault'] = this.isDefault;
|
||||
} else {
|
||||
json[r'isDefault'] = null;
|
||||
}
|
||||
if (notification != null) {
|
||||
_json[r'notification'] = notification;
|
||||
if (this.notification != null) {
|
||||
json[r'notification'] = this.notification;
|
||||
} else {
|
||||
json[r'notification'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmModeDTO] instance and imports its values from
|
||||
@ -171,7 +189,7 @@ class AlarmModeDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmModeDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmModeDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmModeDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -202,12 +220,10 @@ class AlarmModeDTO {
|
||||
static Map<String, List<AlarmModeDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmModeDTO>>{};
|
||||
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 = AlarmModeDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmModeDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -47,17 +47,23 @@ class AlarmTriggered {
|
||||
String toString() => 'AlarmTriggered[alarmModeId=$alarmModeId, alarmModeName=$alarmModeName, type=$type]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (alarmModeId != null) {
|
||||
_json[r'alarmModeId'] = alarmModeId;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.alarmModeId != null) {
|
||||
json[r'alarmModeId'] = this.alarmModeId;
|
||||
} else {
|
||||
json[r'alarmModeId'] = null;
|
||||
}
|
||||
if (alarmModeName != null) {
|
||||
_json[r'alarmModeName'] = alarmModeName;
|
||||
if (this.alarmModeName != null) {
|
||||
json[r'alarmModeName'] = this.alarmModeName;
|
||||
} else {
|
||||
json[r'alarmModeName'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlarmTriggered] instance and imports its values from
|
||||
@ -87,7 +93,7 @@ class AlarmTriggered {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlarmTriggered>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmTriggered> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmTriggered>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -118,12 +124,10 @@ class AlarmTriggered {
|
||||
static Map<String, List<AlarmTriggered>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlarmTriggered>>{};
|
||||
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 = AlarmTriggered.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AlarmTriggered.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -42,7 +42,7 @@ class AlarmType {
|
||||
|
||||
static AlarmType? fromJson(dynamic value) => AlarmTypeTypeTransformer().decode(value);
|
||||
|
||||
static List<AlarmType>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AlarmType> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlarmType>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -75,7 +75,7 @@ class AlarmTypeTypeTransformer {
|
||||
/// and users are still using an old app with the old code.
|
||||
AlarmType? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
switch (data) {
|
||||
case r'Home': return AlarmType.home;
|
||||
case r'Absent': return AlarmType.absent;
|
||||
case r'Geolocalized': return AlarmType.geolocalized;
|
||||
|
||||
@ -99,41 +99,63 @@ class AutomationDetailDTO {
|
||||
String toString() => 'AutomationDetailDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds, devices=$devices]';
|
||||
|
||||
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 (active != null) {
|
||||
_json[r'active'] = active;
|
||||
if (this.active != null) {
|
||||
json[r'active'] = this.active;
|
||||
} else {
|
||||
json[r'active'] = null;
|
||||
}
|
||||
if (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (conditions != null) {
|
||||
_json[r'conditions'] = conditions;
|
||||
if (this.conditions != null) {
|
||||
json[r'conditions'] = this.conditions;
|
||||
} else {
|
||||
json[r'conditions'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (devicesIds != null) {
|
||||
_json[r'devicesIds'] = devicesIds;
|
||||
if (this.devicesIds != null) {
|
||||
json[r'devicesIds'] = this.devicesIds;
|
||||
} else {
|
||||
json[r'devicesIds'] = null;
|
||||
}
|
||||
if (devices != null) {
|
||||
_json[r'devices'] = devices;
|
||||
if (this.devices != null) {
|
||||
json[r'devices'] = this.devices;
|
||||
} else {
|
||||
json[r'devices'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AutomationDetailDTO] instance and imports its values from
|
||||
@ -161,19 +183,19 @@ class AutomationDetailDTO {
|
||||
homeId: mapValueOfType<String>(json, r'homeId'),
|
||||
createdDate: mapDateTime(json, r'createdDate', ''),
|
||||
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
conditions: Condition.listFromJson(json[r'conditions']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
conditions: Condition.listFromJson(json[r'conditions']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
devicesIds: json[r'devicesIds'] is List
|
||||
? (json[r'devicesIds'] as List).cast<String>()
|
||||
: const [],
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? const [],
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AutomationDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AutomationDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AutomationDetailDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -204,12 +226,10 @@ class AutomationDetailDTO {
|
||||
static Map<String, List<AutomationDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AutomationDetailDTO>>{};
|
||||
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 = AutomationDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AutomationDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -51,23 +51,33 @@ class AutomationDetailDTOAllOf {
|
||||
String toString() => 'AutomationDetailDTOAllOf[triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds, devices=$devices]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (triggers != null) {
|
||||
_json[r'triggers'] = triggers;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.triggers != null) {
|
||||
json[r'triggers'] = this.triggers;
|
||||
} else {
|
||||
json[r'triggers'] = null;
|
||||
}
|
||||
if (conditions != null) {
|
||||
_json[r'conditions'] = conditions;
|
||||
if (this.conditions != null) {
|
||||
json[r'conditions'] = this.conditions;
|
||||
} else {
|
||||
json[r'conditions'] = null;
|
||||
}
|
||||
if (actions != null) {
|
||||
_json[r'actions'] = actions;
|
||||
if (this.actions != null) {
|
||||
json[r'actions'] = this.actions;
|
||||
} else {
|
||||
json[r'actions'] = null;
|
||||
}
|
||||
if (devicesIds != null) {
|
||||
_json[r'devicesIds'] = devicesIds;
|
||||
if (this.devicesIds != null) {
|
||||
json[r'devicesIds'] = this.devicesIds;
|
||||
} else {
|
||||
json[r'devicesIds'] = null;
|
||||
}
|
||||
if (devices != null) {
|
||||
_json[r'devices'] = devices;
|
||||
if (this.devices != null) {
|
||||
json[r'devices'] = this.devices;
|
||||
} else {
|
||||
json[r'devices'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AutomationDetailDTOAllOf] instance and imports its values from
|
||||
@ -89,19 +99,19 @@ class AutomationDetailDTOAllOf {
|
||||
}());
|
||||
|
||||
return AutomationDetailDTOAllOf(
|
||||
triggers: Trigger.listFromJson(json[r'triggers']) ?? const [],
|
||||
conditions: Condition.listFromJson(json[r'conditions']) ?? const [],
|
||||
actions: Action.listFromJson(json[r'actions']) ?? const [],
|
||||
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||
conditions: Condition.listFromJson(json[r'conditions']),
|
||||
actions: Action.listFromJson(json[r'actions']),
|
||||
devicesIds: json[r'devicesIds'] is List
|
||||
? (json[r'devicesIds'] as List).cast<String>()
|
||||
: const [],
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']) ?? const [],
|
||||
devices: DeviceDetailDTO.listFromJson(json[r'devices']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AutomationDetailDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AutomationDetailDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AutomationDetailDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -132,12 +142,10 @@ class AutomationDetailDTOAllOf {
|
||||
static Map<String, List<AutomationDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AutomationDetailDTOAllOf>>{};
|
||||
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 = AutomationDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AutomationDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -74,26 +74,38 @@ class AutomationDTO {
|
||||
String toString() => 'AutomationDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate]';
|
||||
|
||||
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 (active != null) {
|
||||
_json[r'active'] = active;
|
||||
if (this.active != null) {
|
||||
json[r'active'] = this.active;
|
||||
} else {
|
||||
json[r'active'] = null;
|
||||
}
|
||||
if (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AutomationDTO] instance and imports its values from
|
||||
@ -126,7 +138,7 @@ class AutomationDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AutomationDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AutomationDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AutomationDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -157,12 +169,10 @@ class AutomationDTO {
|
||||
static Map<String, List<AutomationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AutomationDTO>>{};
|
||||
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 = AutomationDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AutomationDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class AutomationState {
|
||||
String toString() => 'AutomationState[name=$name, value=$value]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = 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 [AutomationState] instance and imports its values from
|
||||
@ -72,7 +76,7 @@ class AutomationState {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AutomationState>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AutomationState> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AutomationState>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class AutomationState {
|
||||
static Map<String, List<AutomationState>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AutomationState>>{};
|
||||
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 = AutomationState.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AutomationState.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class AutomationTriggered {
|
||||
String toString() => 'AutomationTriggered[automationId=$automationId, automationName=$automationName]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (automationId != null) {
|
||||
_json[r'automationId'] = automationId;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.automationId != null) {
|
||||
json[r'automationId'] = this.automationId;
|
||||
} else {
|
||||
json[r'automationId'] = null;
|
||||
}
|
||||
if (automationName != null) {
|
||||
_json[r'automationName'] = automationName;
|
||||
if (this.automationName != null) {
|
||||
json[r'automationName'] = this.automationName;
|
||||
} else {
|
||||
json[r'automationName'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AutomationTriggered] instance and imports its values from
|
||||
@ -72,7 +76,7 @@ class AutomationTriggered {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AutomationTriggered>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AutomationTriggered> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AutomationTriggered>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class AutomationTriggered {
|
||||
static Map<String, List<AutomationTriggered>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AutomationTriggered>>{};
|
||||
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 = AutomationTriggered.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AutomationTriggered.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -31,11 +31,13 @@ class AzureADAuthModel {
|
||||
String toString() => 'AzureADAuthModel[apiKey=$apiKey]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (apiKey != null) {
|
||||
_json[r'apiKey'] = apiKey;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.apiKey != null) {
|
||||
json[r'apiKey'] = this.apiKey;
|
||||
} else {
|
||||
json[r'apiKey'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AzureADAuthModel] instance and imports its values from
|
||||
@ -63,7 +65,7 @@ class AzureADAuthModel {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AzureADAuthModel>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<AzureADAuthModel> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AzureADAuthModel>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -94,12 +96,10 @@ class AzureADAuthModel {
|
||||
static Map<String, List<AzureADAuthModel>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AzureADAuthModel>>{};
|
||||
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 = AzureADAuthModel.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = AzureADAuthModel.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -57,23 +57,33 @@ class Book {
|
||||
String toString() => 'Book[id=$id, bookName=$bookName, price=$price, category=$category, author=$author]';
|
||||
|
||||
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 (bookName != null) {
|
||||
_json[r'bookName'] = bookName;
|
||||
if (this.bookName != null) {
|
||||
json[r'bookName'] = this.bookName;
|
||||
} else {
|
||||
json[r'bookName'] = null;
|
||||
}
|
||||
if (price != null) {
|
||||
_json[r'price'] = price;
|
||||
if (this.price != null) {
|
||||
json[r'price'] = this.price;
|
||||
} else {
|
||||
json[r'price'] = null;
|
||||
}
|
||||
if (category != null) {
|
||||
_json[r'category'] = category;
|
||||
if (this.category != null) {
|
||||
json[r'category'] = this.category;
|
||||
} else {
|
||||
json[r'category'] = null;
|
||||
}
|
||||
if (author != null) {
|
||||
_json[r'author'] = author;
|
||||
if (this.author != null) {
|
||||
json[r'author'] = this.author;
|
||||
} else {
|
||||
json[r'author'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [Book] instance and imports its values from
|
||||
@ -107,7 +117,7 @@ class Book {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<Book>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<Book> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <Book>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -138,12 +148,10 @@ class Book {
|
||||
static Map<String, List<Book>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<Book>>{};
|
||||
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 = Book.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = Book.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -68,26 +68,38 @@ class Condition {
|
||||
String toString() => 'Condition[deviceId=$deviceId, state=$state, startTime=$startTime, endTime=$endTime, type=$type, value=$value]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (deviceId != null) {
|
||||
_json[r'deviceId'] = deviceId;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.deviceId != null) {
|
||||
json[r'deviceId'] = this.deviceId;
|
||||
} else {
|
||||
json[r'deviceId'] = null;
|
||||
}
|
||||
if (state != null) {
|
||||
_json[r'state'] = state;
|
||||
if (this.state != null) {
|
||||
json[r'state'] = this.state;
|
||||
} else {
|
||||
json[r'state'] = null;
|
||||
}
|
||||
if (startTime != null) {
|
||||
_json[r'startTime'] = startTime;
|
||||
if (this.startTime != null) {
|
||||
json[r'startTime'] = this.startTime;
|
||||
} else {
|
||||
json[r'startTime'] = null;
|
||||
}
|
||||
if (endTime != null) {
|
||||
_json[r'endTime'] = endTime;
|
||||
if (this.endTime != null) {
|
||||
json[r'endTime'] = this.endTime;
|
||||
} else {
|
||||
json[r'endTime'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = 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 [Condition] instance and imports its values from
|
||||
@ -120,7 +132,7 @@ class Condition {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<Condition>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<Condition> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <Condition>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -151,12 +163,10 @@ class Condition {
|
||||
static Map<String, List<Condition>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<Condition>>{};
|
||||
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 = Condition.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = Condition.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -36,14 +36,18 @@ class ConditionState {
|
||||
String toString() => 'ConditionState[name=$name, value=$value]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = 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 [ConditionState] instance and imports its values from
|
||||
@ -72,7 +76,7 @@ class ConditionState {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ConditionState>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ConditionState> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ConditionState>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -103,12 +107,10 @@ class ConditionState {
|
||||
static Map<String, List<ConditionState>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ConditionState>>{};
|
||||
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 = ConditionState.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ConditionState.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -34,7 +34,7 @@ class ConditionType {
|
||||
|
||||
static ConditionType? fromJson(dynamic value) => ConditionTypeTypeTransformer().decode(value);
|
||||
|
||||
static List<ConditionType>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ConditionType> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ConditionType>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -67,7 +67,7 @@ class ConditionTypeTypeTransformer {
|
||||
/// and users are still using an old app with the old code.
|
||||
ConditionType? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
switch (data) {
|
||||
case r'STATE': return ConditionType.STATE;
|
||||
case r'TIME': return ConditionType.TIME;
|
||||
default:
|
||||
|
||||
@ -42,7 +42,7 @@ class ConditionValue {
|
||||
|
||||
static ConditionValue? fromJson(dynamic value) => ConditionValueTypeTransformer().decode(value);
|
||||
|
||||
static List<ConditionValue>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ConditionValue> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ConditionValue>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -75,7 +75,7 @@ class ConditionValueTypeTransformer {
|
||||
/// and users are still using an old app with the old code.
|
||||
ConditionValue? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
switch (data) {
|
||||
case r'EQUAL': return ConditionValue.EQUAL;
|
||||
case r'NOT_EQUAL': return ConditionValue.NOT_EQUAL;
|
||||
case r'BIGGER': return ConditionValue.BIGGER;
|
||||
|
||||
@ -36,7 +36,7 @@ class ConnectionStatus {
|
||||
|
||||
static ConnectionStatus? fromJson(dynamic value) => ConnectionStatusTypeTransformer().decode(value);
|
||||
|
||||
static List<ConnectionStatus>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ConnectionStatus> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ConnectionStatus>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -69,7 +69,7 @@ class ConnectionStatusTypeTransformer {
|
||||
/// and users are still using an old app with the old code.
|
||||
ConnectionStatus? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
switch (data) {
|
||||
case r'Connected': return ConnectionStatus.connected;
|
||||
case r'Disconnected': return ConnectionStatus.disconnected;
|
||||
case r'Unknown': return ConnectionStatus.unknown;
|
||||
|
||||
@ -43,7 +43,7 @@ class CreateOrUpdateHomeDTO {
|
||||
///
|
||||
bool? isDefault;
|
||||
|
||||
AlarmMode? currentAlarmMode;
|
||||
HomeDTOCurrentAlarmMode? currentAlarmMode;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
@ -90,32 +90,48 @@ class CreateOrUpdateHomeDTO {
|
||||
String toString() => 'CreateOrUpdateHomeDTO[id=$id, name=$name, isAlarm=$isAlarm, isDefault=$isDefault, currentAlarmMode=$currentAlarmMode, createdDate=$createdDate, updatedDate=$updatedDate, usersIds=$usersIds]';
|
||||
|
||||
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 (isAlarm != null) {
|
||||
_json[r'isAlarm'] = isAlarm;
|
||||
if (this.isAlarm != null) {
|
||||
json[r'isAlarm'] = this.isAlarm;
|
||||
} else {
|
||||
json[r'isAlarm'] = null;
|
||||
}
|
||||
if (isDefault != null) {
|
||||
_json[r'isDefault'] = isDefault;
|
||||
if (this.isDefault != null) {
|
||||
json[r'isDefault'] = this.isDefault;
|
||||
} else {
|
||||
json[r'isDefault'] = null;
|
||||
}
|
||||
if (currentAlarmMode != null) {
|
||||
_json[r'currentAlarmMode'] = currentAlarmMode;
|
||||
if (this.currentAlarmMode != null) {
|
||||
json[r'currentAlarmMode'] = this.currentAlarmMode;
|
||||
} else {
|
||||
json[r'currentAlarmMode'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
if (usersIds != null) {
|
||||
_json[r'usersIds'] = usersIds;
|
||||
if (this.usersIds != null) {
|
||||
json[r'usersIds'] = this.usersIds;
|
||||
} else {
|
||||
json[r'usersIds'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateOrUpdateHomeDTO] instance and imports its values from
|
||||
@ -141,7 +157,7 @@ class CreateOrUpdateHomeDTO {
|
||||
name: mapValueOfType<String>(json, r'name'),
|
||||
isAlarm: mapValueOfType<bool>(json, r'isAlarm'),
|
||||
isDefault: mapValueOfType<bool>(json, r'isDefault'),
|
||||
currentAlarmMode: AlarmMode.fromJson(json[r'currentAlarmMode']),
|
||||
currentAlarmMode: HomeDTOCurrentAlarmMode.fromJson(json[r'currentAlarmMode']),
|
||||
createdDate: mapDateTime(json, r'createdDate', ''),
|
||||
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||
usersIds: json[r'usersIds'] is List
|
||||
@ -152,7 +168,7 @@ class CreateOrUpdateHomeDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateOrUpdateHomeDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<CreateOrUpdateHomeDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateOrUpdateHomeDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -183,12 +199,10 @@ class CreateOrUpdateHomeDTO {
|
||||
static Map<String, List<CreateOrUpdateHomeDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateOrUpdateHomeDTO>>{};
|
||||
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 = CreateOrUpdateHomeDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = CreateOrUpdateHomeDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -31,11 +31,13 @@ class CreateOrUpdateHomeDTOAllOf {
|
||||
String toString() => 'CreateOrUpdateHomeDTOAllOf[usersIds=$usersIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (usersIds != null) {
|
||||
_json[r'usersIds'] = usersIds;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.usersIds != null) {
|
||||
json[r'usersIds'] = this.usersIds;
|
||||
} else {
|
||||
json[r'usersIds'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateOrUpdateHomeDTOAllOf] instance and imports its values from
|
||||
@ -65,7 +67,7 @@ class CreateOrUpdateHomeDTOAllOf {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateOrUpdateHomeDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<CreateOrUpdateHomeDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateOrUpdateHomeDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -96,12 +98,10 @@ class CreateOrUpdateHomeDTOAllOf {
|
||||
static Map<String, List<CreateOrUpdateHomeDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateOrUpdateHomeDTOAllOf>>{};
|
||||
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 = CreateOrUpdateHomeDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = CreateOrUpdateHomeDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,7 @@ class DeviceDetailDTOAllOf {
|
||||
this.meansOfCommunications = const [],
|
||||
this.createdDate,
|
||||
this.updatedDate,
|
||||
this.lastMessage,
|
||||
this.lastState,
|
||||
this.ipAddress,
|
||||
this.serviceIdentification,
|
||||
@ -26,6 +27,51 @@ class DeviceDetailDTOAllOf {
|
||||
this.groupIds = const [],
|
||||
this.properties,
|
||||
this.supportedOperations = const [],
|
||||
this.isContact,
|
||||
this.contact,
|
||||
this.isIlluminance,
|
||||
this.illuminance,
|
||||
this.isBrightness,
|
||||
this.brightness,
|
||||
this.isState,
|
||||
this.state,
|
||||
this.isColorTemp,
|
||||
this.colorTemp,
|
||||
this.isColorXY,
|
||||
this.colorX,
|
||||
this.colorY,
|
||||
this.isOccupation,
|
||||
this.occupation,
|
||||
this.isAlarm,
|
||||
this.alarm,
|
||||
this.isWaterLeak,
|
||||
this.waterLeak,
|
||||
this.isSmoke,
|
||||
this.smoke,
|
||||
this.isVibration,
|
||||
this.vibration,
|
||||
this.isAction,
|
||||
this.action,
|
||||
this.isTemperature,
|
||||
this.temperature,
|
||||
this.isHumidity,
|
||||
this.humidity,
|
||||
this.isPressure,
|
||||
this.pressure,
|
||||
this.isAirQuality,
|
||||
this.airQuality,
|
||||
this.isFanSpeed,
|
||||
this.fanSpeed,
|
||||
this.isFanMode,
|
||||
this.fanMode,
|
||||
this.isConsumption,
|
||||
this.consumption,
|
||||
this.isCurrentPower,
|
||||
this.currentPower,
|
||||
this.isVoltage,
|
||||
this.voltage,
|
||||
this.isLinkQuality,
|
||||
this.linkQuality,
|
||||
});
|
||||
|
||||
String? firmwareVersion;
|
||||
@ -58,6 +104,8 @@ class DeviceDetailDTOAllOf {
|
||||
///
|
||||
DateTime? updatedDate;
|
||||
|
||||
String? lastMessage;
|
||||
|
||||
String? lastState;
|
||||
|
||||
String? ipAddress;
|
||||
@ -72,6 +120,324 @@ class DeviceDetailDTOAllOf {
|
||||
|
||||
List<String>? supportedOperations;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isContact;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? contact;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isIlluminance;
|
||||
|
||||
int? illuminance;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isBrightness;
|
||||
|
||||
///
|
||||
/// 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? brightness;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isState;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? state;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isColorTemp;
|
||||
|
||||
///
|
||||
/// 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? colorTemp;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isColorXY;
|
||||
|
||||
///
|
||||
/// 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? colorX;
|
||||
|
||||
///
|
||||
/// 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? colorY;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isOccupation;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? occupation;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isAlarm;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? alarm;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isWaterLeak;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? waterLeak;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isSmoke;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? smoke;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isVibration;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? vibration;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isAction;
|
||||
|
||||
String? action;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isTemperature;
|
||||
|
||||
num? temperature;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isHumidity;
|
||||
|
||||
num? humidity;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isPressure;
|
||||
|
||||
num? pressure;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isAirQuality;
|
||||
|
||||
String? airQuality;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isFanSpeed;
|
||||
|
||||
///
|
||||
/// 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? fanSpeed;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isFanMode;
|
||||
|
||||
String? fanMode;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isConsumption;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
num? consumption;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isCurrentPower;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
num? currentPower;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isVoltage;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
num? voltage;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool? isLinkQuality;
|
||||
|
||||
///
|
||||
/// 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? linkQuality;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf &&
|
||||
other.firmwareVersion == firmwareVersion &&
|
||||
@ -80,13 +446,59 @@ class DeviceDetailDTOAllOf {
|
||||
other.meansOfCommunications == meansOfCommunications &&
|
||||
other.createdDate == createdDate &&
|
||||
other.updatedDate == updatedDate &&
|
||||
other.lastMessage == lastMessage &&
|
||||
other.lastState == lastState &&
|
||||
other.ipAddress == ipAddress &&
|
||||
other.serviceIdentification == serviceIdentification &&
|
||||
other.manufacturerName == manufacturerName &&
|
||||
other.groupIds == groupIds &&
|
||||
other.properties == properties &&
|
||||
other.supportedOperations == supportedOperations;
|
||||
other.supportedOperations == supportedOperations &&
|
||||
other.isContact == isContact &&
|
||||
other.contact == contact &&
|
||||
other.isIlluminance == isIlluminance &&
|
||||
other.illuminance == illuminance &&
|
||||
other.isBrightness == isBrightness &&
|
||||
other.brightness == brightness &&
|
||||
other.isState == isState &&
|
||||
other.state == state &&
|
||||
other.isColorTemp == isColorTemp &&
|
||||
other.colorTemp == colorTemp &&
|
||||
other.isColorXY == isColorXY &&
|
||||
other.colorX == colorX &&
|
||||
other.colorY == colorY &&
|
||||
other.isOccupation == isOccupation &&
|
||||
other.occupation == occupation &&
|
||||
other.isAlarm == isAlarm &&
|
||||
other.alarm == alarm &&
|
||||
other.isWaterLeak == isWaterLeak &&
|
||||
other.waterLeak == waterLeak &&
|
||||
other.isSmoke == isSmoke &&
|
||||
other.smoke == smoke &&
|
||||
other.isVibration == isVibration &&
|
||||
other.vibration == vibration &&
|
||||
other.isAction == isAction &&
|
||||
other.action == action &&
|
||||
other.isTemperature == isTemperature &&
|
||||
other.temperature == temperature &&
|
||||
other.isHumidity == isHumidity &&
|
||||
other.humidity == humidity &&
|
||||
other.isPressure == isPressure &&
|
||||
other.pressure == pressure &&
|
||||
other.isAirQuality == isAirQuality &&
|
||||
other.airQuality == airQuality &&
|
||||
other.isFanSpeed == isFanSpeed &&
|
||||
other.fanSpeed == fanSpeed &&
|
||||
other.isFanMode == isFanMode &&
|
||||
other.fanMode == fanMode &&
|
||||
other.isConsumption == isConsumption &&
|
||||
other.consumption == consumption &&
|
||||
other.isCurrentPower == isCurrentPower &&
|
||||
other.currentPower == currentPower &&
|
||||
other.isVoltage == isVoltage &&
|
||||
other.voltage == voltage &&
|
||||
other.isLinkQuality == isLinkQuality &&
|
||||
other.linkQuality == linkQuality;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@ -97,59 +509,361 @@ class DeviceDetailDTOAllOf {
|
||||
(meansOfCommunications == null ? 0 : meansOfCommunications!.hashCode) +
|
||||
(createdDate == null ? 0 : createdDate!.hashCode) +
|
||||
(updatedDate == null ? 0 : updatedDate!.hashCode) +
|
||||
(lastMessage == null ? 0 : lastMessage!.hashCode) +
|
||||
(lastState == null ? 0 : lastState!.hashCode) +
|
||||
(ipAddress == null ? 0 : ipAddress!.hashCode) +
|
||||
(serviceIdentification == null ? 0 : serviceIdentification!.hashCode) +
|
||||
(manufacturerName == null ? 0 : manufacturerName!.hashCode) +
|
||||
(groupIds == null ? 0 : groupIds!.hashCode) +
|
||||
(properties == null ? 0 : properties!.hashCode) +
|
||||
(supportedOperations == null ? 0 : supportedOperations!.hashCode);
|
||||
(supportedOperations == null ? 0 : supportedOperations!.hashCode) +
|
||||
(isContact == null ? 0 : isContact!.hashCode) +
|
||||
(contact == null ? 0 : contact!.hashCode) +
|
||||
(isIlluminance == null ? 0 : isIlluminance!.hashCode) +
|
||||
(illuminance == null ? 0 : illuminance!.hashCode) +
|
||||
(isBrightness == null ? 0 : isBrightness!.hashCode) +
|
||||
(brightness == null ? 0 : brightness!.hashCode) +
|
||||
(isState == null ? 0 : isState!.hashCode) +
|
||||
(state == null ? 0 : state!.hashCode) +
|
||||
(isColorTemp == null ? 0 : isColorTemp!.hashCode) +
|
||||
(colorTemp == null ? 0 : colorTemp!.hashCode) +
|
||||
(isColorXY == null ? 0 : isColorXY!.hashCode) +
|
||||
(colorX == null ? 0 : colorX!.hashCode) +
|
||||
(colorY == null ? 0 : colorY!.hashCode) +
|
||||
(isOccupation == null ? 0 : isOccupation!.hashCode) +
|
||||
(occupation == null ? 0 : occupation!.hashCode) +
|
||||
(isAlarm == null ? 0 : isAlarm!.hashCode) +
|
||||
(alarm == null ? 0 : alarm!.hashCode) +
|
||||
(isWaterLeak == null ? 0 : isWaterLeak!.hashCode) +
|
||||
(waterLeak == null ? 0 : waterLeak!.hashCode) +
|
||||
(isSmoke == null ? 0 : isSmoke!.hashCode) +
|
||||
(smoke == null ? 0 : smoke!.hashCode) +
|
||||
(isVibration == null ? 0 : isVibration!.hashCode) +
|
||||
(vibration == null ? 0 : vibration!.hashCode) +
|
||||
(isAction == null ? 0 : isAction!.hashCode) +
|
||||
(action == null ? 0 : action!.hashCode) +
|
||||
(isTemperature == null ? 0 : isTemperature!.hashCode) +
|
||||
(temperature == null ? 0 : temperature!.hashCode) +
|
||||
(isHumidity == null ? 0 : isHumidity!.hashCode) +
|
||||
(humidity == null ? 0 : humidity!.hashCode) +
|
||||
(isPressure == null ? 0 : isPressure!.hashCode) +
|
||||
(pressure == null ? 0 : pressure!.hashCode) +
|
||||
(isAirQuality == null ? 0 : isAirQuality!.hashCode) +
|
||||
(airQuality == null ? 0 : airQuality!.hashCode) +
|
||||
(isFanSpeed == null ? 0 : isFanSpeed!.hashCode) +
|
||||
(fanSpeed == null ? 0 : fanSpeed!.hashCode) +
|
||||
(isFanMode == null ? 0 : isFanMode!.hashCode) +
|
||||
(fanMode == null ? 0 : fanMode!.hashCode) +
|
||||
(isConsumption == null ? 0 : isConsumption!.hashCode) +
|
||||
(consumption == null ? 0 : consumption!.hashCode) +
|
||||
(isCurrentPower == null ? 0 : isCurrentPower!.hashCode) +
|
||||
(currentPower == null ? 0 : currentPower!.hashCode) +
|
||||
(isVoltage == null ? 0 : isVoltage!.hashCode) +
|
||||
(voltage == null ? 0 : voltage!.hashCode) +
|
||||
(isLinkQuality == null ? 0 : isLinkQuality!.hashCode) +
|
||||
(linkQuality == null ? 0 : linkQuality!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]';
|
||||
String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastMessage=$lastMessage, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations, isContact=$isContact, contact=$contact, isIlluminance=$isIlluminance, illuminance=$illuminance, isBrightness=$isBrightness, brightness=$brightness, isState=$isState, state=$state, isColorTemp=$isColorTemp, colorTemp=$colorTemp, isColorXY=$isColorXY, colorX=$colorX, colorY=$colorY, isOccupation=$isOccupation, occupation=$occupation, isAlarm=$isAlarm, alarm=$alarm, isWaterLeak=$isWaterLeak, waterLeak=$waterLeak, isSmoke=$isSmoke, smoke=$smoke, isVibration=$isVibration, vibration=$vibration, isAction=$isAction, action=$action, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isPressure=$isPressure, pressure=$pressure, isAirQuality=$isAirQuality, airQuality=$airQuality, isFanSpeed=$isFanSpeed, fanSpeed=$fanSpeed, isFanMode=$isFanMode, fanMode=$fanMode, isConsumption=$isConsumption, consumption=$consumption, isCurrentPower=$isCurrentPower, currentPower=$currentPower, isVoltage=$isVoltage, voltage=$voltage, isLinkQuality=$isLinkQuality, linkQuality=$linkQuality]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (firmwareVersion != null) {
|
||||
_json[r'firmwareVersion'] = firmwareVersion;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.firmwareVersion != null) {
|
||||
json[r'firmwareVersion'] = this.firmwareVersion;
|
||||
} else {
|
||||
json[r'firmwareVersion'] = null;
|
||||
}
|
||||
if (hardwareVersion != null) {
|
||||
_json[r'hardwareVersion'] = hardwareVersion;
|
||||
if (this.hardwareVersion != null) {
|
||||
json[r'hardwareVersion'] = this.hardwareVersion;
|
||||
} else {
|
||||
json[r'hardwareVersion'] = null;
|
||||
}
|
||||
if (port != null) {
|
||||
_json[r'port'] = port;
|
||||
if (this.port != null) {
|
||||
json[r'port'] = this.port;
|
||||
} else {
|
||||
json[r'port'] = null;
|
||||
}
|
||||
if (meansOfCommunications != null) {
|
||||
_json[r'meansOfCommunications'] = meansOfCommunications;
|
||||
if (this.meansOfCommunications != null) {
|
||||
json[r'meansOfCommunications'] = this.meansOfCommunications;
|
||||
} else {
|
||||
json[r'meansOfCommunications'] = null;
|
||||
}
|
||||
if (createdDate != null) {
|
||||
_json[r'createdDate'] = createdDate!.toUtc().toIso8601String();
|
||||
if (this.createdDate != null) {
|
||||
json[r'createdDate'] = this.createdDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'createdDate'] = null;
|
||||
}
|
||||
if (updatedDate != null) {
|
||||
_json[r'updatedDate'] = updatedDate!.toUtc().toIso8601String();
|
||||
if (this.updatedDate != null) {
|
||||
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'updatedDate'] = null;
|
||||
}
|
||||
if (lastState != null) {
|
||||
_json[r'lastState'] = lastState;
|
||||
if (this.lastMessage != null) {
|
||||
json[r'lastMessage'] = this.lastMessage;
|
||||
} else {
|
||||
json[r'lastMessage'] = null;
|
||||
}
|
||||
if (ipAddress != null) {
|
||||
_json[r'ipAddress'] = ipAddress;
|
||||
if (this.lastState != null) {
|
||||
json[r'lastState'] = this.lastState;
|
||||
} else {
|
||||
json[r'lastState'] = null;
|
||||
}
|
||||
if (serviceIdentification != null) {
|
||||
_json[r'serviceIdentification'] = serviceIdentification;
|
||||
if (this.ipAddress != null) {
|
||||
json[r'ipAddress'] = this.ipAddress;
|
||||
} else {
|
||||
json[r'ipAddress'] = null;
|
||||
}
|
||||
if (manufacturerName != null) {
|
||||
_json[r'manufacturerName'] = manufacturerName;
|
||||
if (this.serviceIdentification != null) {
|
||||
json[r'serviceIdentification'] = this.serviceIdentification;
|
||||
} else {
|
||||
json[r'serviceIdentification'] = null;
|
||||
}
|
||||
if (groupIds != null) {
|
||||
_json[r'groupIds'] = groupIds;
|
||||
if (this.manufacturerName != null) {
|
||||
json[r'manufacturerName'] = this.manufacturerName;
|
||||
} else {
|
||||
json[r'manufacturerName'] = null;
|
||||
}
|
||||
if (properties != null) {
|
||||
_json[r'properties'] = properties;
|
||||
if (this.groupIds != null) {
|
||||
json[r'groupIds'] = this.groupIds;
|
||||
} else {
|
||||
json[r'groupIds'] = null;
|
||||
}
|
||||
if (supportedOperations != null) {
|
||||
_json[r'supportedOperations'] = supportedOperations;
|
||||
if (this.properties != null) {
|
||||
json[r'properties'] = this.properties;
|
||||
} else {
|
||||
json[r'properties'] = null;
|
||||
}
|
||||
return _json;
|
||||
if (this.supportedOperations != null) {
|
||||
json[r'supportedOperations'] = this.supportedOperations;
|
||||
} else {
|
||||
json[r'supportedOperations'] = null;
|
||||
}
|
||||
if (this.isContact != null) {
|
||||
json[r'isContact'] = this.isContact;
|
||||
} else {
|
||||
json[r'isContact'] = null;
|
||||
}
|
||||
if (this.contact != null) {
|
||||
json[r'contact'] = this.contact;
|
||||
} else {
|
||||
json[r'contact'] = null;
|
||||
}
|
||||
if (this.isIlluminance != null) {
|
||||
json[r'isIlluminance'] = this.isIlluminance;
|
||||
} else {
|
||||
json[r'isIlluminance'] = null;
|
||||
}
|
||||
if (this.illuminance != null) {
|
||||
json[r'illuminance'] = this.illuminance;
|
||||
} else {
|
||||
json[r'illuminance'] = null;
|
||||
}
|
||||
if (this.isBrightness != null) {
|
||||
json[r'isBrightness'] = this.isBrightness;
|
||||
} else {
|
||||
json[r'isBrightness'] = null;
|
||||
}
|
||||
if (this.brightness != null) {
|
||||
json[r'brightness'] = this.brightness;
|
||||
} else {
|
||||
json[r'brightness'] = null;
|
||||
}
|
||||
if (this.isState != null) {
|
||||
json[r'isState'] = this.isState;
|
||||
} else {
|
||||
json[r'isState'] = null;
|
||||
}
|
||||
if (this.state != null) {
|
||||
json[r'state'] = this.state;
|
||||
} else {
|
||||
json[r'state'] = null;
|
||||
}
|
||||
if (this.isColorTemp != null) {
|
||||
json[r'isColorTemp'] = this.isColorTemp;
|
||||
} else {
|
||||
json[r'isColorTemp'] = null;
|
||||
}
|
||||
if (this.colorTemp != null) {
|
||||
json[r'colorTemp'] = this.colorTemp;
|
||||
} else {
|
||||
json[r'colorTemp'] = null;
|
||||
}
|
||||
if (this.isColorXY != null) {
|
||||
json[r'isColorXY'] = this.isColorXY;
|
||||
} else {
|
||||
json[r'isColorXY'] = null;
|
||||
}
|
||||
if (this.colorX != null) {
|
||||
json[r'colorX'] = this.colorX;
|
||||
} else {
|
||||
json[r'colorX'] = null;
|
||||
}
|
||||
if (this.colorY != null) {
|
||||
json[r'colorY'] = this.colorY;
|
||||
} else {
|
||||
json[r'colorY'] = null;
|
||||
}
|
||||
if (this.isOccupation != null) {
|
||||
json[r'isOccupation'] = this.isOccupation;
|
||||
} else {
|
||||
json[r'isOccupation'] = null;
|
||||
}
|
||||
if (this.occupation != null) {
|
||||
json[r'occupation'] = this.occupation;
|
||||
} else {
|
||||
json[r'occupation'] = null;
|
||||
}
|
||||
if (this.isAlarm != null) {
|
||||
json[r'isAlarm'] = this.isAlarm;
|
||||
} else {
|
||||
json[r'isAlarm'] = null;
|
||||
}
|
||||
if (this.alarm != null) {
|
||||
json[r'alarm'] = this.alarm;
|
||||
} else {
|
||||
json[r'alarm'] = null;
|
||||
}
|
||||
if (this.isWaterLeak != null) {
|
||||
json[r'isWaterLeak'] = this.isWaterLeak;
|
||||
} else {
|
||||
json[r'isWaterLeak'] = null;
|
||||
}
|
||||
if (this.waterLeak != null) {
|
||||
json[r'waterLeak'] = this.waterLeak;
|
||||
} else {
|
||||
json[r'waterLeak'] = null;
|
||||
}
|
||||
if (this.isSmoke != null) {
|
||||
json[r'isSmoke'] = this.isSmoke;
|
||||
} else {
|
||||
json[r'isSmoke'] = null;
|
||||
}
|
||||
if (this.smoke != null) {
|
||||
json[r'smoke'] = this.smoke;
|
||||
} else {
|
||||
json[r'smoke'] = null;
|
||||
}
|
||||
if (this.isVibration != null) {
|
||||
json[r'isVibration'] = this.isVibration;
|
||||
} else {
|
||||
json[r'isVibration'] = null;
|
||||
}
|
||||
if (this.vibration != null) {
|
||||
json[r'vibration'] = this.vibration;
|
||||
} else {
|
||||
json[r'vibration'] = null;
|
||||
}
|
||||
if (this.isAction != null) {
|
||||
json[r'isAction'] = this.isAction;
|
||||
} else {
|
||||
json[r'isAction'] = null;
|
||||
}
|
||||
if (this.action != null) {
|
||||
json[r'action'] = this.action;
|
||||
} else {
|
||||
json[r'action'] = null;
|
||||
}
|
||||
if (this.isTemperature != null) {
|
||||
json[r'isTemperature'] = this.isTemperature;
|
||||
} else {
|
||||
json[r'isTemperature'] = null;
|
||||
}
|
||||
if (this.temperature != null) {
|
||||
json[r'temperature'] = this.temperature;
|
||||
} else {
|
||||
json[r'temperature'] = null;
|
||||
}
|
||||
if (this.isHumidity != null) {
|
||||
json[r'isHumidity'] = this.isHumidity;
|
||||
} else {
|
||||
json[r'isHumidity'] = null;
|
||||
}
|
||||
if (this.humidity != null) {
|
||||
json[r'humidity'] = this.humidity;
|
||||
} else {
|
||||
json[r'humidity'] = null;
|
||||
}
|
||||
if (this.isPressure != null) {
|
||||
json[r'isPressure'] = this.isPressure;
|
||||
} else {
|
||||
json[r'isPressure'] = null;
|
||||
}
|
||||
if (this.pressure != null) {
|
||||
json[r'pressure'] = this.pressure;
|
||||
} else {
|
||||
json[r'pressure'] = null;
|
||||
}
|
||||
if (this.isAirQuality != null) {
|
||||
json[r'isAirQuality'] = this.isAirQuality;
|
||||
} else {
|
||||
json[r'isAirQuality'] = null;
|
||||
}
|
||||
if (this.airQuality != null) {
|
||||
json[r'airQuality'] = this.airQuality;
|
||||
} else {
|
||||
json[r'airQuality'] = null;
|
||||
}
|
||||
if (this.isFanSpeed != null) {
|
||||
json[r'isFanSpeed'] = this.isFanSpeed;
|
||||
} else {
|
||||
json[r'isFanSpeed'] = null;
|
||||
}
|
||||
if (this.fanSpeed != null) {
|
||||
json[r'fanSpeed'] = this.fanSpeed;
|
||||
} else {
|
||||
json[r'fanSpeed'] = null;
|
||||
}
|
||||
if (this.isFanMode != null) {
|
||||
json[r'isFanMode'] = this.isFanMode;
|
||||
} else {
|
||||
json[r'isFanMode'] = null;
|
||||
}
|
||||
if (this.fanMode != null) {
|
||||
json[r'fanMode'] = this.fanMode;
|
||||
} else {
|
||||
json[r'fanMode'] = null;
|
||||
}
|
||||
if (this.isConsumption != null) {
|
||||
json[r'isConsumption'] = this.isConsumption;
|
||||
} else {
|
||||
json[r'isConsumption'] = null;
|
||||
}
|
||||
if (this.consumption != null) {
|
||||
json[r'consumption'] = this.consumption;
|
||||
} else {
|
||||
json[r'consumption'] = null;
|
||||
}
|
||||
if (this.isCurrentPower != null) {
|
||||
json[r'isCurrentPower'] = this.isCurrentPower;
|
||||
} else {
|
||||
json[r'isCurrentPower'] = null;
|
||||
}
|
||||
if (this.currentPower != null) {
|
||||
json[r'currentPower'] = this.currentPower;
|
||||
} else {
|
||||
json[r'currentPower'] = null;
|
||||
}
|
||||
if (this.isVoltage != null) {
|
||||
json[r'isVoltage'] = this.isVoltage;
|
||||
} else {
|
||||
json[r'isVoltage'] = null;
|
||||
}
|
||||
if (this.voltage != null) {
|
||||
json[r'voltage'] = this.voltage;
|
||||
} else {
|
||||
json[r'voltage'] = null;
|
||||
}
|
||||
if (this.isLinkQuality != null) {
|
||||
json[r'isLinkQuality'] = this.isLinkQuality;
|
||||
} else {
|
||||
json[r'isLinkQuality'] = null;
|
||||
}
|
||||
if (this.linkQuality != null) {
|
||||
json[r'linkQuality'] = this.linkQuality;
|
||||
} else {
|
||||
json[r'linkQuality'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from
|
||||
@ -174,9 +888,10 @@ class DeviceDetailDTOAllOf {
|
||||
firmwareVersion: mapValueOfType<String>(json, r'firmwareVersion'),
|
||||
hardwareVersion: mapValueOfType<String>(json, r'hardwareVersion'),
|
||||
port: mapValueOfType<int>(json, r'port'),
|
||||
meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']) ?? const [],
|
||||
meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']),
|
||||
createdDate: mapDateTime(json, r'createdDate', ''),
|
||||
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||
lastMessage: mapValueOfType<String>(json, r'lastMessage'),
|
||||
lastState: mapValueOfType<String>(json, r'lastState'),
|
||||
ipAddress: mapValueOfType<String>(json, r'ipAddress'),
|
||||
serviceIdentification: mapValueOfType<String>(json, r'serviceIdentification'),
|
||||
@ -188,12 +903,69 @@ class DeviceDetailDTOAllOf {
|
||||
supportedOperations: json[r'supportedOperations'] is List
|
||||
? (json[r'supportedOperations'] as List).cast<String>()
|
||||
: const [],
|
||||
isContact: mapValueOfType<bool>(json, r'isContact'),
|
||||
contact: mapValueOfType<bool>(json, r'contact'),
|
||||
isIlluminance: mapValueOfType<bool>(json, r'isIlluminance'),
|
||||
illuminance: mapValueOfType<int>(json, r'illuminance'),
|
||||
isBrightness: mapValueOfType<bool>(json, r'isBrightness'),
|
||||
brightness: mapValueOfType<int>(json, r'brightness'),
|
||||
isState: mapValueOfType<bool>(json, r'isState'),
|
||||
state: mapValueOfType<bool>(json, r'state'),
|
||||
isColorTemp: mapValueOfType<bool>(json, r'isColorTemp'),
|
||||
colorTemp: mapValueOfType<int>(json, r'colorTemp'),
|
||||
isColorXY: mapValueOfType<bool>(json, r'isColorXY'),
|
||||
colorX: mapValueOfType<int>(json, r'colorX'),
|
||||
colorY: mapValueOfType<int>(json, r'colorY'),
|
||||
isOccupation: mapValueOfType<bool>(json, r'isOccupation'),
|
||||
occupation: mapValueOfType<bool>(json, r'occupation'),
|
||||
isAlarm: mapValueOfType<bool>(json, r'isAlarm'),
|
||||
alarm: mapValueOfType<bool>(json, r'alarm'),
|
||||
isWaterLeak: mapValueOfType<bool>(json, r'isWaterLeak'),
|
||||
waterLeak: mapValueOfType<bool>(json, r'waterLeak'),
|
||||
isSmoke: mapValueOfType<bool>(json, r'isSmoke'),
|
||||
smoke: mapValueOfType<bool>(json, r'smoke'),
|
||||
isVibration: mapValueOfType<bool>(json, r'isVibration'),
|
||||
vibration: mapValueOfType<bool>(json, r'vibration'),
|
||||
isAction: mapValueOfType<bool>(json, r'isAction'),
|
||||
action: mapValueOfType<String>(json, r'action'),
|
||||
isTemperature: mapValueOfType<bool>(json, r'isTemperature'),
|
||||
temperature: json[r'temperature'] == null
|
||||
? null
|
||||
: num.parse(json[r'temperature'].toString()),
|
||||
isHumidity: mapValueOfType<bool>(json, r'isHumidity'),
|
||||
humidity: json[r'humidity'] == null
|
||||
? null
|
||||
: num.parse(json[r'humidity'].toString()),
|
||||
isPressure: mapValueOfType<bool>(json, r'isPressure'),
|
||||
pressure: json[r'pressure'] == null
|
||||
? null
|
||||
: num.parse(json[r'pressure'].toString()),
|
||||
isAirQuality: mapValueOfType<bool>(json, r'isAirQuality'),
|
||||
airQuality: mapValueOfType<String>(json, r'airQuality'),
|
||||
isFanSpeed: mapValueOfType<bool>(json, r'isFanSpeed'),
|
||||
fanSpeed: mapValueOfType<int>(json, r'fanSpeed'),
|
||||
isFanMode: mapValueOfType<bool>(json, r'isFanMode'),
|
||||
fanMode: mapValueOfType<String>(json, r'fanMode'),
|
||||
isConsumption: mapValueOfType<bool>(json, r'isConsumption'),
|
||||
consumption: json[r'consumption'] == null
|
||||
? null
|
||||
: num.parse(json[r'consumption'].toString()),
|
||||
isCurrentPower: mapValueOfType<bool>(json, r'isCurrentPower'),
|
||||
currentPower: json[r'currentPower'] == null
|
||||
? null
|
||||
: num.parse(json[r'currentPower'].toString()),
|
||||
isVoltage: mapValueOfType<bool>(json, r'isVoltage'),
|
||||
voltage: json[r'voltage'] == null
|
||||
? null
|
||||
: num.parse(json[r'voltage'].toString()),
|
||||
isLinkQuality: mapValueOfType<bool>(json, r'isLinkQuality'),
|
||||
linkQuality: mapValueOfType<int>(json, r'linkQuality'),
|
||||
);
|
||||
}
|
||||
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) {
|
||||
@ -224,12 +996,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;
|
||||
|
||||
@ -52,20 +52,28 @@ class DeviceState {
|
||||
String toString() => 'DeviceState[deviceId=$deviceId, deviceName=$deviceName, message=$message, deviceType=$deviceType]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (deviceId != null) {
|
||||
_json[r'deviceId'] = deviceId;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.deviceId != null) {
|
||||
json[r'deviceId'] = this.deviceId;
|
||||
} else {
|
||||
json[r'deviceId'] = null;
|
||||
}
|
||||
if (deviceName != null) {
|
||||
_json[r'deviceName'] = deviceName;
|
||||
if (this.deviceName != null) {
|
||||
json[r'deviceName'] = this.deviceName;
|
||||
} else {
|
||||
json[r'deviceName'] = null;
|
||||
}
|
||||
if (message != null) {
|
||||
_json[r'message'] = message;
|
||||
if (this.message != null) {
|
||||
json[r'message'] = this.message;
|
||||
} else {
|
||||
json[r'message'] = null;
|
||||
}
|
||||
if (deviceType != null) {
|
||||
_json[r'deviceType'] = deviceType;
|
||||
if (this.deviceType != null) {
|
||||
json[r'deviceType'] = this.deviceType;
|
||||
} else {
|
||||
json[r'deviceType'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeviceState] instance and imports its values from
|
||||
@ -96,7 +104,7 @@ class DeviceState {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeviceState>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<DeviceState> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceState>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -127,12 +135,10 @@ class DeviceState {
|
||||
static Map<String, List<DeviceState>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeviceState>>{};
|
||||
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 = DeviceState.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = DeviceState.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -25,6 +25,7 @@ class DeviceSummaryDTO {
|
||||
this.providerId,
|
||||
this.providerName,
|
||||
this.lastStateDate,
|
||||
this.lastMessageDate,
|
||||
this.battery,
|
||||
this.batteryStatus,
|
||||
});
|
||||
@ -77,6 +78,14 @@ class DeviceSummaryDTO {
|
||||
///
|
||||
DateTime? lastStateDate;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
DateTime? lastMessageDate;
|
||||
|
||||
///
|
||||
/// 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
|
||||
@ -107,6 +116,7 @@ class DeviceSummaryDTO {
|
||||
other.providerId == providerId &&
|
||||
other.providerName == providerName &&
|
||||
other.lastStateDate == lastStateDate &&
|
||||
other.lastMessageDate == lastMessageDate &&
|
||||
other.battery == battery &&
|
||||
other.batteryStatus == batteryStatus;
|
||||
|
||||
@ -125,57 +135,91 @@ class DeviceSummaryDTO {
|
||||
(providerId == null ? 0 : providerId!.hashCode) +
|
||||
(providerName == null ? 0 : providerName!.hashCode) +
|
||||
(lastStateDate == null ? 0 : lastStateDate!.hashCode) +
|
||||
(lastMessageDate == null ? 0 : lastMessageDate!.hashCode) +
|
||||
(battery == null ? 0 : battery!.hashCode) +
|
||||
(batteryStatus == null ? 0 : batteryStatus!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'DeviceSummaryDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus]';
|
||||
String toString() => 'DeviceSummaryDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, lastMessageDate=$lastMessageDate, battery=$battery, batteryStatus=$batteryStatus]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (description != null) {
|
||||
_json[r'description'] = description;
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
} else {
|
||||
json[r'description'] = null;
|
||||
}
|
||||
if (name != null) {
|
||||
_json[r'name'] = name;
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
json[r'name'] = null;
|
||||
}
|
||||
if (model != null) {
|
||||
_json[r'model'] = model;
|
||||
if (this.model != null) {
|
||||
json[r'model'] = this.model;
|
||||
} else {
|
||||
json[r'model'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (status != null) {
|
||||
_json[r'status'] = status;
|
||||
if (this.status != null) {
|
||||
json[r'status'] = this.status;
|
||||
} else {
|
||||
json[r'status'] = null;
|
||||
}
|
||||
if (connectionStatus != null) {
|
||||
_json[r'connectionStatus'] = connectionStatus;
|
||||
if (this.connectionStatus != null) {
|
||||
json[r'connectionStatus'] = this.connectionStatus;
|
||||
} else {
|
||||
json[r'connectionStatus'] = null;
|
||||
}
|
||||
if (roomId != null) {
|
||||
_json[r'roomId'] = roomId;
|
||||
if (this.roomId != null) {
|
||||
json[r'roomId'] = this.roomId;
|
||||
} else {
|
||||
json[r'roomId'] = null;
|
||||
}
|
||||
if (providerId != null) {
|
||||
_json[r'providerId'] = providerId;
|
||||
if (this.providerId != null) {
|
||||
json[r'providerId'] = this.providerId;
|
||||
} else {
|
||||
json[r'providerId'] = null;
|
||||
}
|
||||
if (providerName != null) {
|
||||
_json[r'providerName'] = providerName;
|
||||
if (this.providerName != null) {
|
||||
json[r'providerName'] = this.providerName;
|
||||
} else {
|
||||
json[r'providerName'] = null;
|
||||
}
|
||||
if (lastStateDate != null) {
|
||||
_json[r'lastStateDate'] = lastStateDate!.toUtc().toIso8601String();
|
||||
if (this.lastStateDate != null) {
|
||||
json[r'lastStateDate'] = this.lastStateDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'lastStateDate'] = null;
|
||||
}
|
||||
if (battery != null) {
|
||||
_json[r'battery'] = battery;
|
||||
if (this.lastMessageDate != null) {
|
||||
json[r'lastMessageDate'] = this.lastMessageDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'lastMessageDate'] = null;
|
||||
}
|
||||
if (batteryStatus != null) {
|
||||
_json[r'batteryStatus'] = batteryStatus;
|
||||
if (this.battery != null) {
|
||||
json[r'battery'] = this.battery;
|
||||
} else {
|
||||
json[r'battery'] = null;
|
||||
}
|
||||
return _json;
|
||||
if (this.batteryStatus != null) {
|
||||
json[r'batteryStatus'] = this.batteryStatus;
|
||||
} else {
|
||||
json[r'batteryStatus'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeviceSummaryDTO] instance and imports its values from
|
||||
@ -209,6 +253,7 @@ class DeviceSummaryDTO {
|
||||
providerId: mapValueOfType<String>(json, r'providerId'),
|
||||
providerName: mapValueOfType<String>(json, r'providerName'),
|
||||
lastStateDate: mapDateTime(json, r'lastStateDate', ''),
|
||||
lastMessageDate: mapDateTime(json, r'lastMessageDate', ''),
|
||||
battery: mapValueOfType<bool>(json, r'battery'),
|
||||
batteryStatus: mapValueOfType<int>(json, r'batteryStatus'),
|
||||
);
|
||||
@ -216,7 +261,7 @@ class DeviceSummaryDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeviceSummaryDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<DeviceSummaryDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceSummaryDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -247,12 +292,10 @@ class DeviceSummaryDTO {
|
||||
static Map<String, List<DeviceSummaryDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeviceSummaryDTO>>{};
|
||||
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 = DeviceSummaryDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = DeviceSummaryDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -60,7 +60,7 @@ class DeviceType {
|
||||
|
||||
static DeviceType? fromJson(dynamic value) => DeviceTypeTypeTransformer().decode(value);
|
||||
|
||||
static List<DeviceType>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<DeviceType> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceType>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -93,7 +93,7 @@ class DeviceTypeTypeTransformer {
|
||||
/// and users are still using an old app with the old code.
|
||||
DeviceType? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
switch (data) {
|
||||
case r'Sensor': return DeviceType.sensor;
|
||||
case r'Actuator': return DeviceType.actuator;
|
||||
case r'Camera': return DeviceType.camera;
|
||||
|
||||
@ -74,26 +74,38 @@ class ElectricityProduction {
|
||||
String toString() => 'ElectricityProduction[id=$id, deviceId=$deviceId, homeId=$homeId, watt=$watt, ampere=$ampere, timestamp=$timestamp]';
|
||||
|
||||
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 (deviceId != null) {
|
||||
_json[r'deviceId'] = deviceId;
|
||||
if (this.deviceId != null) {
|
||||
json[r'deviceId'] = this.deviceId;
|
||||
} else {
|
||||
json[r'deviceId'] = null;
|
||||
}
|
||||
if (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (watt != null) {
|
||||
_json[r'watt'] = watt;
|
||||
if (this.watt != null) {
|
||||
json[r'watt'] = this.watt;
|
||||
} else {
|
||||
json[r'watt'] = null;
|
||||
}
|
||||
if (ampere != null) {
|
||||
_json[r'ampere'] = ampere;
|
||||
if (this.ampere != null) {
|
||||
json[r'ampere'] = this.ampere;
|
||||
} else {
|
||||
json[r'ampere'] = null;
|
||||
}
|
||||
if (timestamp != null) {
|
||||
_json[r'timestamp'] = timestamp!.toUtc().toIso8601String();
|
||||
if (this.timestamp != null) {
|
||||
json[r'timestamp'] = this.timestamp!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'timestamp'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ElectricityProduction] instance and imports its values from
|
||||
@ -126,7 +138,7 @@ class ElectricityProduction {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ElectricityProduction>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<ElectricityProduction> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ElectricityProduction>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -157,12 +169,10 @@ class ElectricityProduction {
|
||||
static Map<String, List<ElectricityProduction>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ElectricityProduction>>{};
|
||||
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 = ElectricityProduction.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = ElectricityProduction.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -45,11 +45,11 @@ class EventDetailDTO {
|
||||
|
||||
String? roomId;
|
||||
|
||||
DeviceState? deviceState;
|
||||
EventDetailDTOAllOfDeviceState? deviceState;
|
||||
|
||||
AutomationTriggered? automationTriggered;
|
||||
EventDetailDTOAllOfAutomationTriggered? automationTriggered;
|
||||
|
||||
AlarmTriggered? alarmTriggered;
|
||||
EventDetailDTOAllOfAlarmTriggered? alarmTriggered;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventDetailDTO &&
|
||||
@ -78,32 +78,48 @@ class EventDetailDTO {
|
||||
String toString() => 'EventDetailDTO[id=$id, homeId=$homeId, date=$date, type=$type, roomId=$roomId, deviceState=$deviceState, automationTriggered=$automationTriggered, alarmTriggered=$alarmTriggered]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (date != null) {
|
||||
_json[r'date'] = date!.toUtc().toIso8601String();
|
||||
if (this.date != null) {
|
||||
json[r'date'] = this.date!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'date'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (roomId != null) {
|
||||
_json[r'roomId'] = roomId;
|
||||
if (this.roomId != null) {
|
||||
json[r'roomId'] = this.roomId;
|
||||
} else {
|
||||
json[r'roomId'] = null;
|
||||
}
|
||||
if (deviceState != null) {
|
||||
_json[r'deviceState'] = deviceState;
|
||||
if (this.deviceState != null) {
|
||||
json[r'deviceState'] = this.deviceState;
|
||||
} else {
|
||||
json[r'deviceState'] = null;
|
||||
}
|
||||
if (automationTriggered != null) {
|
||||
_json[r'automationTriggered'] = automationTriggered;
|
||||
if (this.automationTriggered != null) {
|
||||
json[r'automationTriggered'] = this.automationTriggered;
|
||||
} else {
|
||||
json[r'automationTriggered'] = null;
|
||||
}
|
||||
if (alarmTriggered != null) {
|
||||
_json[r'alarmTriggered'] = alarmTriggered;
|
||||
if (this.alarmTriggered != null) {
|
||||
json[r'alarmTriggered'] = this.alarmTriggered;
|
||||
} else {
|
||||
json[r'alarmTriggered'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventDetailDTO] instance and imports its values from
|
||||
@ -130,15 +146,15 @@ class EventDetailDTO {
|
||||
date: mapDateTime(json, r'date', ''),
|
||||
type: EventType.fromJson(json[r'type']),
|
||||
roomId: mapValueOfType<String>(json, r'roomId'),
|
||||
deviceState: DeviceState.fromJson(json[r'deviceState']),
|
||||
automationTriggered: AutomationTriggered.fromJson(json[r'automationTriggered']),
|
||||
alarmTriggered: AlarmTriggered.fromJson(json[r'alarmTriggered']),
|
||||
deviceState: EventDetailDTOAllOfDeviceState.fromJson(json[r'deviceState']),
|
||||
automationTriggered: EventDetailDTOAllOfAutomationTriggered.fromJson(json[r'automationTriggered']),
|
||||
alarmTriggered: EventDetailDTOAllOfAlarmTriggered.fromJson(json[r'alarmTriggered']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<EventDetailDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventDetailDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -169,12 +185,10 @@ class EventDetailDTO {
|
||||
static Map<String, List<EventDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventDetailDTO>>{};
|
||||
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 = EventDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = EventDetailDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -18,11 +18,11 @@ class EventDetailDTOAllOf {
|
||||
this.alarmTriggered,
|
||||
});
|
||||
|
||||
DeviceState? deviceState;
|
||||
EventDetailDTOAllOfDeviceState? deviceState;
|
||||
|
||||
AutomationTriggered? automationTriggered;
|
||||
EventDetailDTOAllOfAutomationTriggered? automationTriggered;
|
||||
|
||||
AlarmTriggered? alarmTriggered;
|
||||
EventDetailDTOAllOfAlarmTriggered? alarmTriggered;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventDetailDTOAllOf &&
|
||||
@ -41,17 +41,23 @@ class EventDetailDTOAllOf {
|
||||
String toString() => 'EventDetailDTOAllOf[deviceState=$deviceState, automationTriggered=$automationTriggered, alarmTriggered=$alarmTriggered]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (deviceState != null) {
|
||||
_json[r'deviceState'] = deviceState;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.deviceState != null) {
|
||||
json[r'deviceState'] = this.deviceState;
|
||||
} else {
|
||||
json[r'deviceState'] = null;
|
||||
}
|
||||
if (automationTriggered != null) {
|
||||
_json[r'automationTriggered'] = automationTriggered;
|
||||
if (this.automationTriggered != null) {
|
||||
json[r'automationTriggered'] = this.automationTriggered;
|
||||
} else {
|
||||
json[r'automationTriggered'] = null;
|
||||
}
|
||||
if (alarmTriggered != null) {
|
||||
_json[r'alarmTriggered'] = alarmTriggered;
|
||||
if (this.alarmTriggered != null) {
|
||||
json[r'alarmTriggered'] = this.alarmTriggered;
|
||||
} else {
|
||||
json[r'alarmTriggered'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventDetailDTOAllOf] instance and imports its values from
|
||||
@ -73,15 +79,15 @@ class EventDetailDTOAllOf {
|
||||
}());
|
||||
|
||||
return EventDetailDTOAllOf(
|
||||
deviceState: DeviceState.fromJson(json[r'deviceState']),
|
||||
automationTriggered: AutomationTriggered.fromJson(json[r'automationTriggered']),
|
||||
alarmTriggered: AlarmTriggered.fromJson(json[r'alarmTriggered']),
|
||||
deviceState: EventDetailDTOAllOfDeviceState.fromJson(json[r'deviceState']),
|
||||
automationTriggered: EventDetailDTOAllOfAutomationTriggered.fromJson(json[r'automationTriggered']),
|
||||
alarmTriggered: EventDetailDTOAllOfAlarmTriggered.fromJson(json[r'alarmTriggered']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventDetailDTOAllOf>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<EventDetailDTOAllOf> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventDetailDTOAllOf>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -112,12 +118,10 @@ class EventDetailDTOAllOf {
|
||||
static Map<String, List<EventDetailDTOAllOf>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventDetailDTOAllOf>>{};
|
||||
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 = EventDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = EventDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -0,0 +1,140 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class EventDetailDTOAllOfAlarmTriggered {
|
||||
/// Returns a new [EventDetailDTOAllOfAlarmTriggered] instance.
|
||||
EventDetailDTOAllOfAlarmTriggered({
|
||||
this.alarmModeId,
|
||||
this.alarmModeName,
|
||||
this.type,
|
||||
});
|
||||
|
||||
String? alarmModeId;
|
||||
|
||||
String? alarmModeName;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
AlarmType? type;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventDetailDTOAllOfAlarmTriggered &&
|
||||
other.alarmModeId == alarmModeId &&
|
||||
other.alarmModeName == alarmModeName &&
|
||||
other.type == type;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(alarmModeId == null ? 0 : alarmModeId!.hashCode) +
|
||||
(alarmModeName == null ? 0 : alarmModeName!.hashCode) +
|
||||
(type == null ? 0 : type!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'EventDetailDTOAllOfAlarmTriggered[alarmModeId=$alarmModeId, alarmModeName=$alarmModeName, type=$type]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.alarmModeId != null) {
|
||||
json[r'alarmModeId'] = this.alarmModeId;
|
||||
} else {
|
||||
json[r'alarmModeId'] = null;
|
||||
}
|
||||
if (this.alarmModeName != null) {
|
||||
json[r'alarmModeName'] = this.alarmModeName;
|
||||
} else {
|
||||
json[r'alarmModeName'] = null;
|
||||
}
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventDetailDTOAllOfAlarmTriggered] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static EventDetailDTOAllOfAlarmTriggered? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "EventDetailDTOAllOfAlarmTriggered[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "EventDetailDTOAllOfAlarmTriggered[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return EventDetailDTOAllOfAlarmTriggered(
|
||||
alarmModeId: mapValueOfType<String>(json, r'alarmModeId'),
|
||||
alarmModeName: mapValueOfType<String>(json, r'alarmModeName'),
|
||||
type: AlarmType.fromJson(json[r'type']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventDetailDTOAllOfAlarmTriggered> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventDetailDTOAllOfAlarmTriggered>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = EventDetailDTOAllOfAlarmTriggered.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, EventDetailDTOAllOfAlarmTriggered> mapFromJson(dynamic json) {
|
||||
final map = <String, EventDetailDTOAllOfAlarmTriggered>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = EventDetailDTOAllOfAlarmTriggered.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of EventDetailDTOAllOfAlarmTriggered-objects as value to a dart map
|
||||
static Map<String, List<EventDetailDTOAllOfAlarmTriggered>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventDetailDTOAllOfAlarmTriggered>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = EventDetailDTOAllOfAlarmTriggered.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,123 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class EventDetailDTOAllOfAutomationTriggered {
|
||||
/// Returns a new [EventDetailDTOAllOfAutomationTriggered] instance.
|
||||
EventDetailDTOAllOfAutomationTriggered({
|
||||
this.automationId,
|
||||
this.automationName,
|
||||
});
|
||||
|
||||
String? automationId;
|
||||
|
||||
String? automationName;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventDetailDTOAllOfAutomationTriggered &&
|
||||
other.automationId == automationId &&
|
||||
other.automationName == automationName;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(automationId == null ? 0 : automationId!.hashCode) +
|
||||
(automationName == null ? 0 : automationName!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'EventDetailDTOAllOfAutomationTriggered[automationId=$automationId, automationName=$automationName]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.automationId != null) {
|
||||
json[r'automationId'] = this.automationId;
|
||||
} else {
|
||||
json[r'automationId'] = null;
|
||||
}
|
||||
if (this.automationName != null) {
|
||||
json[r'automationName'] = this.automationName;
|
||||
} else {
|
||||
json[r'automationName'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventDetailDTOAllOfAutomationTriggered] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static EventDetailDTOAllOfAutomationTriggered? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "EventDetailDTOAllOfAutomationTriggered[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "EventDetailDTOAllOfAutomationTriggered[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return EventDetailDTOAllOfAutomationTriggered(
|
||||
automationId: mapValueOfType<String>(json, r'automationId'),
|
||||
automationName: mapValueOfType<String>(json, r'automationName'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventDetailDTOAllOfAutomationTriggered> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventDetailDTOAllOfAutomationTriggered>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = EventDetailDTOAllOfAutomationTriggered.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, EventDetailDTOAllOfAutomationTriggered> mapFromJson(dynamic json) {
|
||||
final map = <String, EventDetailDTOAllOfAutomationTriggered>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = EventDetailDTOAllOfAutomationTriggered.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of EventDetailDTOAllOfAutomationTriggered-objects as value to a dart map
|
||||
static Map<String, List<EventDetailDTOAllOfAutomationTriggered>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventDetailDTOAllOfAutomationTriggered>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = EventDetailDTOAllOfAutomationTriggered.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
151
mycore_api/lib/model/event_detail_dto_all_of_device_state.dart
Normal file
151
mycore_api/lib/model/event_detail_dto_all_of_device_state.dart
Normal file
@ -0,0 +1,151 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class EventDetailDTOAllOfDeviceState {
|
||||
/// Returns a new [EventDetailDTOAllOfDeviceState] instance.
|
||||
EventDetailDTOAllOfDeviceState({
|
||||
this.deviceId,
|
||||
this.deviceName,
|
||||
this.message,
|
||||
this.deviceType,
|
||||
});
|
||||
|
||||
String? deviceId;
|
||||
|
||||
String? deviceName;
|
||||
|
||||
String? message;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
DeviceType? deviceType;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventDetailDTOAllOfDeviceState &&
|
||||
other.deviceId == deviceId &&
|
||||
other.deviceName == deviceName &&
|
||||
other.message == message &&
|
||||
other.deviceType == deviceType;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(deviceId == null ? 0 : deviceId!.hashCode) +
|
||||
(deviceName == null ? 0 : deviceName!.hashCode) +
|
||||
(message == null ? 0 : message!.hashCode) +
|
||||
(deviceType == null ? 0 : deviceType!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'EventDetailDTOAllOfDeviceState[deviceId=$deviceId, deviceName=$deviceName, message=$message, deviceType=$deviceType]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.deviceId != null) {
|
||||
json[r'deviceId'] = this.deviceId;
|
||||
} else {
|
||||
json[r'deviceId'] = null;
|
||||
}
|
||||
if (this.deviceName != null) {
|
||||
json[r'deviceName'] = this.deviceName;
|
||||
} else {
|
||||
json[r'deviceName'] = null;
|
||||
}
|
||||
if (this.message != null) {
|
||||
json[r'message'] = this.message;
|
||||
} else {
|
||||
json[r'message'] = null;
|
||||
}
|
||||
if (this.deviceType != null) {
|
||||
json[r'deviceType'] = this.deviceType;
|
||||
} else {
|
||||
json[r'deviceType'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventDetailDTOAllOfDeviceState] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static EventDetailDTOAllOfDeviceState? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "EventDetailDTOAllOfDeviceState[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "EventDetailDTOAllOfDeviceState[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return EventDetailDTOAllOfDeviceState(
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId'),
|
||||
deviceName: mapValueOfType<String>(json, r'deviceName'),
|
||||
message: mapValueOfType<String>(json, r'message'),
|
||||
deviceType: DeviceType.fromJson(json[r'deviceType']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventDetailDTOAllOfDeviceState> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventDetailDTOAllOfDeviceState>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = EventDetailDTOAllOfDeviceState.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, EventDetailDTOAllOfDeviceState> mapFromJson(dynamic json) {
|
||||
final map = <String, EventDetailDTOAllOfDeviceState>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = EventDetailDTOAllOfDeviceState.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of EventDetailDTOAllOfDeviceState-objects as value to a dart map
|
||||
static Map<String, List<EventDetailDTOAllOfDeviceState>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventDetailDTOAllOfDeviceState>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = EventDetailDTOAllOfDeviceState.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
@ -63,23 +63,33 @@ class EventDTO {
|
||||
String toString() => 'EventDTO[id=$id, homeId=$homeId, date=$date, type=$type, roomId=$roomId]';
|
||||
|
||||
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 (homeId != null) {
|
||||
_json[r'homeId'] = homeId;
|
||||
if (this.homeId != null) {
|
||||
json[r'homeId'] = this.homeId;
|
||||
} else {
|
||||
json[r'homeId'] = null;
|
||||
}
|
||||
if (date != null) {
|
||||
_json[r'date'] = date!.toUtc().toIso8601String();
|
||||
if (this.date != null) {
|
||||
json[r'date'] = this.date!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'date'] = null;
|
||||
}
|
||||
if (type != null) {
|
||||
_json[r'type'] = type;
|
||||
if (this.type != null) {
|
||||
json[r'type'] = this.type;
|
||||
} else {
|
||||
json[r'type'] = null;
|
||||
}
|
||||
if (roomId != null) {
|
||||
_json[r'roomId'] = roomId;
|
||||
if (this.roomId != null) {
|
||||
json[r'roomId'] = this.roomId;
|
||||
} else {
|
||||
json[r'roomId'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventDTO] instance and imports its values from
|
||||
@ -111,7 +121,7 @@ class EventDTO {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventDTO>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<EventDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventDTO>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -142,12 +152,10 @@ class EventDTO {
|
||||
static Map<String, List<EventDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventDTO>>{};
|
||||
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 = EventDTO.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = EventDTO.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@ -41,9 +41,9 @@ class EventFilter {
|
||||
|
||||
DateTime? dateEnd;
|
||||
|
||||
EventType? eventType;
|
||||
EventGetEventTypeParameter? eventType;
|
||||
|
||||
DeviceType? deviceType;
|
||||
EventGetDeviceTypeParameter? deviceType;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventFilter &&
|
||||
@ -68,26 +68,38 @@ class EventFilter {
|
||||
String toString() => 'EventFilter[startIndex=$startIndex, count=$count, dateStart=$dateStart, dateEnd=$dateEnd, eventType=$eventType, deviceType=$deviceType]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (startIndex != null) {
|
||||
_json[r'startIndex'] = startIndex;
|
||||
final json = <String, dynamic>{};
|
||||
if (this.startIndex != null) {
|
||||
json[r'startIndex'] = this.startIndex;
|
||||
} else {
|
||||
json[r'startIndex'] = null;
|
||||
}
|
||||
if (count != null) {
|
||||
_json[r'count'] = count;
|
||||
if (this.count != null) {
|
||||
json[r'count'] = this.count;
|
||||
} else {
|
||||
json[r'count'] = null;
|
||||
}
|
||||
if (dateStart != null) {
|
||||
_json[r'dateStart'] = dateStart!.toUtc().toIso8601String();
|
||||
if (this.dateStart != null) {
|
||||
json[r'dateStart'] = this.dateStart!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateStart'] = null;
|
||||
}
|
||||
if (dateEnd != null) {
|
||||
_json[r'dateEnd'] = dateEnd!.toUtc().toIso8601String();
|
||||
if (this.dateEnd != null) {
|
||||
json[r'dateEnd'] = this.dateEnd!.toUtc().toIso8601String();
|
||||
} else {
|
||||
json[r'dateEnd'] = null;
|
||||
}
|
||||
if (eventType != null) {
|
||||
_json[r'eventType'] = eventType;
|
||||
if (this.eventType != null) {
|
||||
json[r'eventType'] = this.eventType;
|
||||
} else {
|
||||
json[r'eventType'] = null;
|
||||
}
|
||||
if (deviceType != null) {
|
||||
_json[r'deviceType'] = deviceType;
|
||||
if (this.deviceType != null) {
|
||||
json[r'deviceType'] = this.deviceType;
|
||||
} else {
|
||||
json[r'deviceType'] = null;
|
||||
}
|
||||
return _json;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [EventFilter] instance and imports its values from
|
||||
@ -113,14 +125,14 @@ class EventFilter {
|
||||
count: mapValueOfType<int>(json, r'count'),
|
||||
dateStart: mapDateTime(json, r'dateStart', ''),
|
||||
dateEnd: mapDateTime(json, r'dateEnd', ''),
|
||||
eventType:EventType.fromJson(json[r'eventType']),
|
||||
deviceType: DeviceType.fromJson(json[r'deviceType']),
|
||||
eventType: EventGetEventTypeParameter.fromJson(json[r'eventType']),
|
||||
deviceType: EventGetDeviceTypeParameter.fromJson(json[r'deviceType']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EventFilter>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
static List<EventFilter> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <EventFilter>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -151,12 +163,10 @@ class EventFilter {
|
||||
static Map<String, List<EventFilter>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<EventFilter>>{};
|
||||
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 = EventFilter.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
map[entry.key] = EventFilter.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user