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

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

Map<String, dynamic> repairBillListResponseEntityToJson(RepairBillListResponseEntity 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;
}

repairBillListResponseDataFromJson(RepairBillListResponseData 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) => RepairBillListResponseDataList().fromJson(v)).toList();
	}
	if (json['query'] != null) {
		data.query = RepairBillListResponseDataQuery().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> repairBillListResponseDataToJson(RepairBillListResponseData 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;
}

repairBillListResponseDataListFromJson(RepairBillListResponseDataList data, Map<String, dynamic> json) {
	if (json['applicant'] != null) {
		data.applicant = json['applicant'].toString();
	}
	if (json['applicationTime'] != null) {
		data.applicationTime = json['applicationTime'].toString();
	}
	if (json['channelName'] != null) {
		data.channelName = json['channelName'].toString();
	}
	if (json['completeTime'] != null) {
		data.completeTime = json['completeTime'].toString();
	}
	if (json['customerName'] != null) {
		data.customerName = json['customerName'].toString();
	}
	if (json['device'] != null) {
		data.device = RepairBillListResponseDataListDevice().fromJson(json['device']);
	}
	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['deviceName'] != null) {
		data.deviceName = json['deviceName'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['instructions'] != null) {
		data.instructions = json['instructions'].toString();
	}
	if (json['logs'] != null) {
		data.logs = (json['logs'] as List).map((v) => RepairBillListResponseDataListLogs().fromJson(v)).toList();
	}
	if (json['maintainer'] != null) {
		data.maintainer = json['maintainer'].toString();
	}
	if (json['orderRecTime'] != null) {
		data.orderRecTime = json['orderRecTime'].toString();
	}
	if (json['receiver'] != null) {
		data.receiver = json['receiver'].toString();
	}
	if (json['repNum'] != null) {
		data.repNum = json['repNum'].toString();
	}
	if (json['repairImgUrl'] != null) {
		data.repairImgUrl = json['repairImgUrl'].toString();
	}
	if (json['repairResUrl'] != null) {
		data.repairResUrl = json['repairResUrl'].toString();
	}
	if (json['status'] != null) {
		data.status = json['status'] is String
				? int.tryParse(json['status'])
				: json['status'].toInt();
	}
	if (json['submitter'] != null) {
		data.submitter = json['submitter'].toString();
	}
	if (json['theme'] != null) {
		data.theme = json['theme'].toString();
	}
	if (json['treatment'] != null) {
		data.treatment = json['treatment'] is String
				? int.tryParse(json['treatment'])
				: json['treatment'].toInt();
	}
	if (json['urg'] != null) {
		data.urg = json['urg'] is String
				? int.tryParse(json['urg'])
				: json['urg'].toInt();
	}
	return data;
}

Map<String, dynamic> repairBillListResponseDataListToJson(RepairBillListResponseDataList entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['applicant'] = entity.applicant;
	data['applicationTime'] = entity.applicationTime;
	data['channelName'] = entity.channelName;
	data['completeTime'] = entity.completeTime;
	data['customerName'] = entity.customerName;
	data['device'] = entity.device.toJson();
	data['deviceId'] = entity.deviceId;
	data['deviceKey'] = entity.deviceKey;
	data['deviceName'] = entity.deviceName;
	data['id'] = entity.id;
	data['instructions'] = entity.instructions;
	data['logs'] =  entity.logs.map((v) => v.toJson()).toList();
	data['maintainer'] = entity.maintainer;
	data['orderRecTime'] = entity.orderRecTime;
	data['receiver'] = entity.receiver;
	data['repNum'] = entity.repNum;
	data['repairImgUrl'] = entity.repairImgUrl;
	data['repairResUrl'] = entity.repairResUrl;
	data['status'] = entity.status;
	data['submitter'] = entity.submitter;
	data['theme'] = entity.theme;
	data['treatment'] = entity.treatment;
	data['urg'] = entity.urg;
	return data;
}

repairBillListResponseDataListDeviceFromJson(RepairBillListResponseDataListDevice data, Map<String, dynamic> json) {
	if (json['completeTime'] != null) {
		data.completeTime = json['completeTime'].toString();
	}
	if (json['deviceKey'] != null) {
		data.deviceKey = json['deviceKey'].toString();
	}
	if (json['deviceName'] != null) {
		data.deviceName = json['deviceName'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['isRepaired'] != null) {
		data.isRepaired = json['isRepaired'] is String
				? int.tryParse(json['isRepaired'])
				: json['isRepaired'].toInt();
	}
	if (json['prodName'] != null) {
		data.prodName = json['prodName'].toString();
	}
	if (json['repairBillId'] != null) {
		data.repairBillId = json['repairBillId'].toString();
	}
	if (json['showName'] != null) {
		data.showName = json['showName'].toString();
	}
	return data;
}

Map<String, dynamic> repairBillListResponseDataListDeviceToJson(RepairBillListResponseDataListDevice entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['completeTime'] = entity.completeTime;
	data['deviceKey'] = entity.deviceKey;
	data['deviceName'] = entity.deviceName;
	data['id'] = entity.id;
	data['isRepaired'] = entity.isRepaired;
	data['prodName'] = entity.prodName;
	data['repairBillId'] = entity.repairBillId;
	data['showName'] = entity.showName;
	return data;
}

repairBillListResponseDataListLogsFromJson(RepairBillListResponseDataListLogs data, Map<String, dynamic> json) {
	if (json['createTime'] != null) {
		data.createTime = json['createTime'].toString();
	}
	if (json['creator'] != null) {
		data.creator = json['creator'] is String
				? int.tryParse(json['creator'])
				: json['creator'].toInt();
	}
	if (json['description'] != null) {
		data.description = json['description'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['repairBillId'] != null) {
		data.repairBillId = json['repairBillId'] is String
				? int.tryParse(json['repairBillId'])
				: json['repairBillId'].toInt();
	}
	if (json['updateTime'] != null) {
		data.updateTime = json['updateTime'].toString();
	}
	if (json['updater'] != null) {
		data.updater = json['updater'] is String
				? int.tryParse(json['updater'])
				: json['updater'].toInt();
	}
	if (json['userName'] != null) {
		data.userName = json['userName'].toString();
	}
	return data;
}

Map<String, dynamic> repairBillListResponseDataListLogsToJson(RepairBillListResponseDataListLogs entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['createTime'] = entity.createTime;
	data['creator'] = entity.creator;
	data['description'] = entity.description;
	data['id'] = entity.id;
	data['repairBillId'] = entity.repairBillId;
	data['updateTime'] = entity.updateTime;
	data['updater'] = entity.updater;
	data['userName'] = entity.userName;
	return data;
}

repairBillListResponseDataQueryFromJson(RepairBillListResponseDataQuery data, Map<String, dynamic> json) {
	if (json['applicant'] != null) {
		data.applicant = json['applicant'].toString();
	}
	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['deviceName'] != null) {
		data.deviceName = json['deviceName'].toString();
	}
	if (json['equipmentId'] != null) {
		data.equipmentId = json['equipmentId'] is String
				? int.tryParse(json['equipmentId'])
				: json['equipmentId'].toInt();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['instructions'] != null) {
		data.instructions = json['instructions'].toString();
	}
	if (json['remarks'] != null) {
		data.remarks = json['remarks'].toString();
	}
	if (json['repNum'] != null) {
		data.repNum = json['repNum'].toString();
	}
	if (json['repairImgId'] != null) {
		data.repairImgId = json['repairImgId'] is String
				? int.tryParse(json['repairImgId'])
				: json['repairImgId'].toInt();
	}
	if (json['repairResId'] != null) {
		data.repairResId = json['repairResId'] is String
				? int.tryParse(json['repairResId'])
				: json['repairResId'].toInt();
	}
	if (json['status'] != null) {
		data.status = json['status'] is String
				? int.tryParse(json['status'])
				: json['status'].toInt();
	}
	if (json['theme'] != null) {
		data.theme = json['theme'].toString();
	}
	if (json['treatment'] != null) {
		data.treatment = json['treatment'] is String
				? int.tryParse(json['treatment'])
				: json['treatment'].toInt();
	}
	if (json['urg'] != null) {
		data.urg = json['urg'] is String
				? int.tryParse(json['urg'])
				: json['urg'].toInt();
	}
	if (json['urls'] != null) {
		data.urls = (json['urls'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	return data;
}

Map<String, dynamic> repairBillListResponseDataQueryToJson(RepairBillListResponseDataQuery entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['applicant'] = entity.applicant;
	data['deviceId'] = entity.deviceId;
	data['deviceKey'] = entity.deviceKey;
	data['deviceName'] = entity.deviceName;
	data['equipmentId'] = entity.equipmentId;
	data['id'] = entity.id;
	data['instructions'] = entity.instructions;
	data['remarks'] = entity.remarks;
	data['repNum'] = entity.repNum;
	data['repairImgId'] = entity.repairImgId;
	data['repairResId'] = entity.repairResId;
	data['status'] = entity.status;
	data['theme'] = entity.theme;
	data['treatment'] = entity.treatment;
	data['urg'] = entity.urg;
	data['urls'] = entity.urls;
	return data;
}