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

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

Map<String, dynamic> maintJobListResponseEntityToJson(MaintJobListResponseEntity 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;
}

maintJobListResponseDataFromJson(MaintJobListResponseData data, Map<String, dynamic> json) {
	if (json['index'] != null) {
		data.index = json['index'] is String
				? int.tryParse(json['index'])
				: json['index'].toInt();
	}
	if (json['list'] != null) {
		data.xList = (json['list'] as List).map((v) => MaintJobListResponseDataList().fromJson(v)).toList();
	}
	if (json['query'] != null) {
		data.query = MaintJobListResponseDataQuery().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> maintJobListResponseDataToJson(MaintJobListResponseData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['index'] = entity.index;
	data['list'] =  entity.xList.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;
}

maintJobListResponseDataListFromJson(MaintJobListResponseDataList data, Map<String, dynamic> json) {
	if (json['deviceId'] != null) {
		data.deviceId = json['deviceId'] is String
				? int.tryParse(json['deviceId'])
				: json['deviceId'].toInt();
	}
	if (json['deviceKey'] != null) {
		data.deviceKey = json['deviceKey'].toString();
	}
	if (json['finishTime'] != null) {
		data.finishTime = json['finishTime'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['isMainted'] != null) {
		data.isMainted = json['isMainted'] is String
				? int.tryParse(json['isMainted'])
				: json['isMainted'].toInt();
	}
	if (json['maintJobId'] != null) {
		data.maintJobId = json['maintJobId'] is String
				? int.tryParse(json['maintJobId'])
				: json['maintJobId'].toInt();
	}
	if (json['maintPerson'] != null) {
		data.maintPerson = json['maintPerson'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['productKey'] != null) {
		data.productKey = json['productKey'].toString();
	}
	if (json['productName'] != null) {
		data.productName = json['productName'].toString();
	}
	if (json['showName'] != null) {
		data.showName = json['showName'].toString();
	}
	return data;
}

Map<String, dynamic> maintJobListResponseDataListToJson(MaintJobListResponseDataList entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['deviceId'] = entity.deviceId;
	data['deviceKey'] = entity.deviceKey;
	data['finishTime'] = entity.finishTime;
	data['id'] = entity.id;
	data['isMainted'] = entity.isMainted;
	data['maintJobId'] = entity.maintJobId;
	data['maintPerson'] = entity.maintPerson;
	data['name'] = entity.name;
	data['productKey'] = entity.productKey;
	data['productName'] = entity.productName;
	data['showName'] = entity.showName;
	return data;
}

maintJobListResponseDataQueryFromJson(MaintJobListResponseDataQuery data, Map<String, dynamic> json) {
	if (json['deviceId'] != null) {
		data.deviceId = json['deviceId'] is String
				? int.tryParse(json['deviceId'])
				: json['deviceId'].toInt();
	}
	if (json['deviceKey'] != null) {
		data.deviceKey = json['deviceKey'].toString();
	}
	if (json['finishTime'] != null) {
		data.finishTime = json['finishTime'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['isMainted'] != null) {
		data.isMainted = json['isMainted'] is String
				? int.tryParse(json['isMainted'])
				: json['isMainted'].toInt();
	}
	if (json['maintJobId'] != null) {
		data.maintJobId = json['maintJobId'] is String
				? int.tryParse(json['maintJobId'])
				: json['maintJobId'].toInt();
	}
	if (json['maintPerson'] != null) {
		data.maintPerson = json['maintPerson'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['productKey'] != null) {
		data.productKey = json['productKey'].toString();
	}
	if (json['productName'] != null) {
		data.productName = json['productName'].toString();
	}
	if (json['showName'] != null) {
		data.showName = json['showName'].toString();
	}
	return data;
}

Map<String, dynamic> maintJobListResponseDataQueryToJson(MaintJobListResponseDataQuery entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['deviceId'] = entity.deviceId;
	data['deviceKey'] = entity.deviceKey;
	data['finishTime'] = entity.finishTime;
	data['id'] = entity.id;
	data['isMainted'] = entity.isMainted;
	data['maintJobId'] = entity.maintJobId;
	data['maintPerson'] = entity.maintPerson;
	data['name'] = entity.name;
	data['productKey'] = entity.productKey;
	data['productName'] = entity.productName;
	data['showName'] = entity.showName;
	return data;
}