/*
 * @Author: WuXiangNan
 * @Date: 2021-05-27 10:53:03
 * @LastEditors: WuXiangNan
 * @LastEditTime: 2021-06-02 17:10:20
 * @Description: 智能门禁
 */

import 'package:business_package/src/models/hardware_data/intelligent_meter.dart';
import 'package:business_package/src/models/hardware_data/intelligent_park.dart';

import 'door_control.dart';

class HardwareData {
  DoorControl? intelligentDoorControl;
  IntelligentPark? intelligentPark;
  IntelligentMeter? intelligentElectricMeter;
  int? intelligentDoorControlCount;
  int? intelligentParkCount;
  int? intelligentElectricMeterCount;

  HardwareData({
    this.intelligentDoorControl,
    this.intelligentElectricMeter,
    this.intelligentPark,
    this.intelligentDoorControlCount,
    this.intelligentElectricMeterCount,
    this.intelligentParkCount,
  });

  HardwareData.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    intelligentDoorControl =
        DoorControl.fromJson(map['intelligentDoorControl'] ?? {});
    intelligentElectricMeter =
        IntelligentMeter.fromJson(map['intelligentElectricMeter'] ?? {});
    intelligentPark = IntelligentPark.fromJson(map['intelligentPark'] ?? {});
    intelligentDoorControlCount = map['intelligentDoorControlCount'];
    intelligentElectricMeterCount = map['intelligentElectricMeterCount'];
    intelligentParkCount = map['intelligentParkCount'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['intelligentDoorControl'] = this.intelligentDoorControl!.toJson();
    json['intelligentElectricMeter'] = this.intelligentElectricMeter!.toJson();
    json['intelligentPark'] = this.intelligentPark!.toJson();
    json['intelligentDoorControlCount'] = this.intelligentDoorControlCount;
    json['intelligentElectricMeterCount'] = this.intelligentElectricMeterCount;
    json['intelligentParkCount'] = this.intelligentParkCount;

    return json;
  }
}
