const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
const require_index = require("../../../../utils/index.js");
const require_shared = require("./shared.js");
//#region src/plus/saasDevice/devicePlanning/api/devices.ts
const getDevices = function() {
	var _ref = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const response = yield require_index.request.getRequest().get("/tenant/device", {
			with: params.with || [
				"type",
				"model",
				"workarea"
			],
			workarea_id: params.workarea_id,
			type_kind: params.type_kind,
			profile_id: params.profile_id
		}, require_shared.CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || [];
	});
	return function getDevices(_x) {
		return _ref.apply(this, arguments);
	};
}();
const getDeviceDetail = function() {
	var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (id) {
		const response = yield require_index.request.getRequest().get(`/tenant/device/${id}`, { with: [
			"type",
			"model",
			"model.activeProfiles",
			"profile"
		] }, require_shared.CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function getDeviceDetail(_x2) {
		return _ref2.apply(this, arguments);
	};
}();
const createDevice = function() {
	var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (payload) {
		const response = yield require_index.request.getRequest().post("/tenant/device", payload, require_shared.CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function createDevice(_x3) {
		return _ref3.apply(this, arguments);
	};
}();
const sortDevices = (ids) => require_index.request.getRequest().post("/tenant/device/sort", { ids }, require_shared.CONFIG);
const updateDevice = function() {
	var _ref4 = require_asyncToGenerator._asyncToGenerator(function* (id, payload) {
		const response = yield require_index.request.getRequest().put(`/tenant/device/${id}`, payload, require_shared.CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function updateDevice(_x4, _x5) {
		return _ref4.apply(this, arguments);
	};
}();
const deleteDevice = (id) => require_index.request.getRequest().remove(`/tenant/device/${id}`, {}, require_shared.CONFIG);
//#endregion
exports.createDevice = createDevice;
exports.deleteDevice = deleteDevice;
exports.getDeviceDetail = getDeviceDetail;
exports.getDevices = getDevices;
exports.sortDevices = sortDevices;
exports.updateDevice = updateDevice;
