/*
 * @Author: WuWei
 * @Date: 2020-06-17 10:49:34
 * @LastEditors: WuWei
 * @LastEditTime: 2020-06-17 17:42:39
 * @Description:
 */

class SearchParkDetailModel {
  String? id;
  String? type;
  String? code;
  String? parkingLotName;
  String? houseFullName;
  num? area;
  String? status;
  List<CarsOfSearchParkDetailModel>? cars;
  num? maxCarAmount;
  String? remark;
  String? residentMobile;
  String? residentName;
  String? residentIdentit;

  SearchParkDetailModel({
    this.id,
    this.type,
    this.code,
    this.parkingLotName,
    this.houseFullName,
    this.area,
    this.status,
    this.cars,
    this.maxCarAmount,
    this.remark,
    this.residentMobile,
    this.residentName,
    this.residentIdentit,
  });

  SearchParkDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    type = map['type'];
    code = map['code'];
    parkingLotName = map['parkingLotName'];
    houseFullName = map['houseFullName'];
    area = map['area'];
    status = map['status'];
    cars = List<CarsOfSearchParkDetailModel>.from((map["cars"] ?? [])
        .map((x) => CarsOfSearchParkDetailModel.fromJson(x)));
    maxCarAmount = map['maxCarAmount'];
    remark = map['remark'];
    residentMobile = map['residentMobile'];
    residentName = map['residentName'];
    residentIdentit = map['residentIdentit'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['type'] = this.type;
    json['code'] = this.code;
    json['parkingLotName'] = this.parkingLotName;
    json['houseFullName'] = this.houseFullName;
    json['area'] = this.area;
    json['status'] = this.status;
    json['cars'] = List<dynamic>.from((cars ?? []).map((x) => x.toJson()));
    json['maxCarAmount'] = this.maxCarAmount;
    json['remark'] = this.remark;
    json['residentMobile'] = this.residentMobile;
    json['residentName'] = this.residentName;
    json['residentIdentit'] = this.residentIdentit;

    return json;
  }
}

class CarsOfSearchParkDetailModel {
  String? carNo;
  String? type;
  bool? monthSubscribe;

  CarsOfSearchParkDetailModel({
    this.carNo,
    this.type,
    this.monthSubscribe,
  });

  CarsOfSearchParkDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    carNo = map['carNo'];
    type = map['type'];
    monthSubscribe = map['monthSubscribe'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['carNo'] = this.carNo;
    json['type'] = this.type;
    json['monthSubscribe'] = this.monthSubscribe;

    return json;
  }
}
