import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
import { request } from "../../../../utils/index.js";
import { CONFIG } from "./shared.js";
//#region src/plus/saasDevice/devicePlanning/api/deviceConnections.ts
const createDeviceConnection = function() {
	var _ref = _asyncToGenerator(function* (payload) {
		const response = yield request.getRequest().post("/tenant/device/connection", payload, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function createDeviceConnection(_x) {
		return _ref.apply(this, arguments);
	};
}();
const getDeviceConnections = function() {
	var _ref2 = _asyncToGenerator(function* (params) {
		const response = yield request.getRequest().get("/tenant/device/connection", {
			with: params.with || [
				"targetDevice.type",
				"sourceDevice.type",
				"profiles"
			],
			type: params.type,
			source_device_id: params.source_device_id,
			target_device_id: params.target_device_id
		}, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || [];
	});
	return function getDeviceConnections(_x2) {
		return _ref2.apply(this, arguments);
	};
}();
const getDeviceConnectionDetail = function() {
	var _ref3 = _asyncToGenerator(function* (id) {
		const response = yield request.getRequest().get(`/tenant/device/connection/${id}`, { with: [
			"targetDevice.type",
			"sourceDevice.type",
			"profiles"
		] }, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function getDeviceConnectionDetail(_x3) {
		return _ref3.apply(this, arguments);
	};
}();
const updateDeviceConnection = function() {
	var _ref4 = _asyncToGenerator(function* (id, payload) {
		const response = yield request.getRequest().put(`/tenant/device/connection/${id}`, payload, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function updateDeviceConnection(_x4, _x5) {
		return _ref4.apply(this, arguments);
	};
}();
const deleteDeviceConnection = (id) => request.getRequest().remove(`/tenant/device/connection/${id}`, {}, CONFIG);
//#endregion
export { createDeviceConnection, deleteDeviceConnection, getDeviceConnectionDetail, getDeviceConnections, updateDeviceConnection };
