export type DeleteApiApiEdgeDevicesDeviceIdArgs = {deviceId: string}; export type DeleteApiApiEdgeDevicesDeviceIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Deletes the device. * * DELETE /api/edge/devices/{deviceId} */ export const deleteApiApiEdgeDevicesDeviceId = async (args: DeleteApiApiEdgeDevicesDeviceIdArgs, options: DeleteApiApiEdgeDevicesDeviceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/edge/devices/${encodeURIComponent(String(args.deviceId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };