import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart'; class MsgNotificationEntity { int? errorCode; String? description; String? errorMsg; MsgNoticeData? data; MsgNotificationEntity( {this.errorCode, this.description, this.errorMsg, this.data}); MsgNotificationEntity.fromJson(Map json) { errorCode = json['errorCode']; description = json['description']; errorMsg = json['errorMsg']; data = json['data'] != null ? MsgNoticeData.fromJson(json['data']) : null; } Map toJson() { final Map data = {}; data['errorCode'] = errorCode; data['description'] = description; data['errorMsg'] = errorMsg; if (this.data != null) { data['data'] = this.data!.toJson(); } return data; } } class MsgNoticeData { int? dayNotOpenDoorState; int? dayNotOpenDoorValue; List? dayNotOpenDoorNoticeWayList; int? doorNotCloseState; int? tamperAlarmState; int? lowElecNoticeState; List? lowElecNoticeWayList; List? coercionOpenDoorNoticeList; int? doorbellNoticeState; int? someoneAtDoorNoticeState; MsgNoticeData( {this.dayNotOpenDoorState, this.dayNotOpenDoorValue, this.dayNotOpenDoorNoticeWayList, this.doorNotCloseState, this.tamperAlarmState, this.lowElecNoticeState, this.lowElecNoticeWayList, this.coercionOpenDoorNoticeList, this.doorbellNoticeState, this.someoneAtDoorNoticeState}); MsgNoticeData.fromJson(Map json) { dayNotOpenDoorState = json['dayNotOpenDoorState']; dayNotOpenDoorValue = json['dayNotOpenDoorValue']; if (json['dayNotOpenDoorNoticeWayList'] != null) { dayNotOpenDoorNoticeWayList = []; json['dayNotOpenDoorNoticeWayList'].forEach((v) { dayNotOpenDoorNoticeWayList!.add(NoticeWay.fromJson(v)); }); } doorNotCloseState = json['doorNotCloseState']; tamperAlarmState = json['tamperAlarmState']; lowElecNoticeState = json['lowElecNoticeState']; if (json['lowElecNoticeWayList'] != null) { lowElecNoticeWayList = []; json['lowElecNoticeWayList'].forEach((v) { lowElecNoticeWayList!.add(NoticeWay.fromJson(v)); }); } if (json['coercionOpenDoorNoticeList'] != null) { coercionOpenDoorNoticeList = []; json['coercionOpenDoorNoticeList'].forEach((v) { coercionOpenDoorNoticeList!.add(v); }); } doorbellNoticeState = json['doorbellNoticeState']; someoneAtDoorNoticeState = json['someoneAtDoorNoticeState']; } Map toJson() { final Map data = {}; data['dayNotOpenDoorState'] = dayNotOpenDoorState; data['dayNotOpenDoorValue'] = dayNotOpenDoorValue; if (dayNotOpenDoorNoticeWayList != null) { data['dayNotOpenDoorNoticeWayList'] = dayNotOpenDoorNoticeWayList!.map((v) => v.toJson()).toList(); } data['doorNotCloseState'] = doorNotCloseState; data['tamperAlarmState'] = tamperAlarmState; data['lowElecNoticeState'] = lowElecNoticeState; if (lowElecNoticeWayList != null) { data['lowElecNoticeWayList'] = lowElecNoticeWayList!.map((v) => v.toJson()).toList(); } if (coercionOpenDoorNoticeList != null) { data['coercionOpenDoorNoticeList'] = coercionOpenDoorNoticeList!.map((v) => v.toJson()).toList(); } data['doorbellNoticeState'] = doorbellNoticeState; data['someoneAtDoorNoticeState'] = someoneAtDoorNoticeState; return data; } }