import 'package:deus_app/model/personal_data_count_entity.dart';

personalDataCountEntityFromJson(PersonalDataCountEntity data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	if (json['data'] != null) {
		data.data = PersonalDataCountData().fromJson(json['data']);
	}
	return data;
}

Map<String, dynamic> personalDataCountEntityToJson(PersonalDataCountEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

personalDataCountDataFromJson(PersonalDataCountData data, Map<String, dynamic> json) {
	if (json['maintJobCount'] != null) {
		data.maintJobCount = json['maintJobCount'] is String
				? int.tryParse(json['maintJobCount'])
				: json['maintJobCount'].toInt();
	}
	if (json['patrolJobCount'] != null) {
		data.patrolJobCount = json['patrolJobCount'] is String
				? int.tryParse(json['patrolJobCount'])
				: json['patrolJobCount'].toInt();
	}
	if (json['alarmCount'] != null) {
		data.alarmCount = json['alarmCount'] is String
				? int.tryParse(json['alarmCount'])
				: json['alarmCount'].toInt();
	}
	return data;
}

Map<String, dynamic> personalDataCountDataToJson(PersonalDataCountData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['maintJobCount'] = entity.maintJobCount;
	data['patrolJobCount'] = entity.patrolJobCount;
	data['alarmCount'] = entity.alarmCount;
	return data;
}