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

patrolJobSelectEntityEntityFromJson(PatrolJobSelectEntityEntity 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 = PatrolJobSelectEntityData().fromJson(json['data']);
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	return data;
}

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

patrolJobSelectEntityDataFromJson(PatrolJobSelectEntityData data, Map<String, dynamic> json) {
	if (json['index'] != null) {
		data.index = json['index'] is String
				? int.tryParse(json['index'])
				: json['index'].toInt();
	}
	if (json['patrolItemModelVOS'] != null) {
		data.patrolItemModelVOS = (json['patrolItemModelVOS'] as List).map((v) => PatrolJobSelectEntityDataPatrolItemModelVOS().fromJson(v)).toList();
	}
	if (json['query'] != null) {
		data.query = PatrolJobSelectEntityDataQuery().fromJson(json['query']);
	}
	if (json['size'] != null) {
		data.size = json['size'] is String
				? int.tryParse(json['size'])
				: json['size'].toInt();
	}
	if (json['sort'] != null) {
		data.sort = json['sort'] is String
				? int.tryParse(json['sort'])
				: json['sort'].toInt();
	}
	if (json['sortBy'] != null) {
		data.sortBy = json['sortBy'].toString();
	}
	if (json['total'] != null) {
		data.total = json['total'] is String
				? int.tryParse(json['total'])
				: json['total'].toInt();
	}
	return data;
}

Map<String, dynamic> patrolJobSelectEntityDataToJson(PatrolJobSelectEntityData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['index'] = entity.index;
	data['patrolItemModelVOS'] =  entity.patrolItemModelVOS.map((v) => v.toJson()).toList();
	data['query'] = entity.query.toJson();
	data['size'] = entity.size;
	data['sort'] = entity.sort;
	data['sortBy'] = entity.sortBy;
	data['total'] = entity.total;
	return data;
}

patrolJobSelectEntityDataPatrolItemModelVOSFromJson(PatrolJobSelectEntityDataPatrolItemModelVOS data, Map<String, dynamic> json) {
	if (json['createTime'] != null) {
		data.createTime = json['createTime'].toString();
	}
	if (json['enable'] != null) {
		data.enable = json['enable'] is String
				? int.tryParse(json['enable'])
				: json['enable'].toInt();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['number'] != null) {
		data.number = json['number'].toString();
	}
	if (json['param'] != null) {
		data.param = (json['param'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	if (json['params'] != null) {
		data.params = json['params'].toString();
	}
	if (json['requirement'] != null) {
		data.requirement = json['requirement'].toString();
	}
	if (json['results'] != null) {
		data.results = (json['results'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	if (json['type'] != null) {
		data.type = json['type'] is String
				? int.tryParse(json['type'])
				: json['type'].toInt();
	}
	return data;
}

Map<String, dynamic> patrolJobSelectEntityDataPatrolItemModelVOSToJson(PatrolJobSelectEntityDataPatrolItemModelVOS entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['createTime'] = entity.createTime;
	data['enable'] = entity.enable;
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['number'] = entity.number;
	data['param'] = entity.param;
	data['params'] = entity.params;
	data['requirement'] = entity.requirement;
	data['results'] = entity.results;
	data['type'] = entity.type;
	return data;
}

patrolJobSelectEntityDataQueryFromJson(PatrolJobSelectEntityDataQuery data, Map<String, dynamic> json) {
	if (json['createTime'] != null) {
		data.createTime = json['createTime'].toString();
	}
	if (json['enable'] != null) {
		data.enable = json['enable'] is String
				? int.tryParse(json['enable'])
				: json['enable'].toInt();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['number'] != null) {
		data.number = json['number'].toString();
	}
	if (json['param'] != null) {
		data.param = (json['param'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	if (json['params'] != null) {
		data.params = json['params'].toString();
	}
	if (json['requirement'] != null) {
		data.requirement = json['requirement'].toString();
	}
	if (json['results'] != null) {
		data.results = (json['results'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	if (json['type'] != null) {
		data.type = json['type'] is String
				? int.tryParse(json['type'])
				: json['type'].toInt();
	}
	return data;
}

Map<String, dynamic> patrolJobSelectEntityDataQueryToJson(PatrolJobSelectEntityDataQuery entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['createTime'] = entity.createTime;
	data['enable'] = entity.enable;
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['number'] = entity.number;
	data['param'] = entity.param;
	data['params'] = entity.params;
	data['requirement'] = entity.requirement;
	data['results'] = entity.results;
	data['type'] = entity.type;
	return data;
}