var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/saasDevice/devicePlanning/api/deviceConnections.ts
var deviceConnections_exports = {};
__export(deviceConnections_exports, {
  createDeviceConnection: () => createDeviceConnection,
  deleteDeviceConnection: () => deleteDeviceConnection,
  getDeviceConnectionDetail: () => getDeviceConnectionDetail,
  getDeviceConnections: () => getDeviceConnections,
  updateDeviceConnection: () => updateDeviceConnection
});
module.exports = __toCommonJS(deviceConnections_exports);
var import_utils = require("../../../../utils");
var import_shared = require("./shared");
var createDeviceConnection = async (payload) => {
  const response = await import_utils.request.getRequest().post(
    "/tenant/device/connection",
    payload,
    import_shared.CONFIG
  );
  return (response == null ? void 0 : response.data) || null;
};
var getDeviceConnections = async (params) => {
  const response = await import_utils.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
    },
    import_shared.CONFIG
  );
  return (response == null ? void 0 : response.data) || [];
};
var getDeviceConnectionDetail = async (id) => {
  const response = await import_utils.request.getRequest().get(
    `/tenant/device/connection/${id}`,
    {
      with: ["targetDevice.type", "sourceDevice.type", "profiles"]
    },
    import_shared.CONFIG
  );
  return (response == null ? void 0 : response.data) || null;
};
var updateDeviceConnection = async (id, payload) => {
  const response = await import_utils.request.getRequest().put(
    `/tenant/device/connection/${id}`,
    payload,
    import_shared.CONFIG
  );
  return (response == null ? void 0 : response.data) || null;
};
var deleteDeviceConnection = (id) => import_utils.request.getRequest().remove(`/tenant/device/connection/${id}`, {}, import_shared.CONFIG);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  createDeviceConnection,
  deleteDeviceConnection,
  getDeviceConnectionDetail,
  getDeviceConnections,
  updateDeviceConnection
});
