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

patrolJobEditEmtityEntityFromJson(PatrolJobEditEmtityEntity data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['data'] != null) {
		data.data = (json['data'] as List).map((v) => PatrolJobEditEmtityData().fromJson(v)).toList();
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	return data;
}

Map<String, dynamic> patrolJobEditEmtityEntityToJson(PatrolJobEditEmtityEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	data['msg'] = entity.msg;
	return data;
}

patrolJobEditEmtityDataFromJson(PatrolJobEditEmtityData data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'].toString();
	}
	if (json['number'] != null) {
		data.number = json['number'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['requirement'] != null) {
		data.requirement = json['requirement'].toString();
	}
	if (json['result'] != null) {
		data.result = json['result'].toString();
	}
	if (json['patrolJobId'] != null) {
		data.patrolJobId = json['patrolJobId'] is String
				? int.tryParse(json['patrolJobId'])
				: json['patrolJobId'].toInt();
	}
	if (json['results'] != null) {
		data.results = json['results'];
	}
	return data;
}

Map<String, dynamic> patrolJobEditEmtityDataToJson(PatrolJobEditEmtityData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['number'] = entity.number;
	data['name'] = entity.name;
	data['requirement'] = entity.requirement;
	data['result'] = entity.result;
	data['patrolJobId'] = entity.patrolJobId;
	data['results'] = entity.results;
	return data;
}