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

maintJobItemsListResponseEntityFromJson(MaintJobItemsListResponseEntity 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) => MaintJobItemsListResponseData().fromJson(v)).toList();
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	return data;
}

Map<String, dynamic> maintJobItemsListResponseEntityToJson(MaintJobItemsListResponseEntity 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;
}

maintJobItemsListResponseDataFromJson(MaintJobItemsListResponseData data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['num'] != null) {
		data.num = json['num'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['level'] != null) {
		data.level = json['level'] is String
				? int.tryParse(json['level'])
				: json['level'].toInt();
	}
	if (json['status'] != null) {
		data.status = json['status'] is String
				? int.tryParse(json['status'])
				: json['status'].toInt();
	}
	if (json['requirements'] != null) {
		data.requirements = json['requirements'].toString();
	}
	if (json['remarks'] != null) {
		data.remarks = json['remarks'].toString();
	}
	return data;
}

Map<String, dynamic> maintJobItemsListResponseDataToJson(MaintJobItemsListResponseData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['num'] = entity.num;
	data['name'] = entity.name;
	data['level'] = entity.level;
	data['status'] = entity.status;
	data['requirements'] = entity.requirements;
	data['remarks'] = entity.remarks;
	return data;
}