export type DeleteApiV1SitesSiteIdDevicesDeviceIdArgs = {siteId: string, deviceId: string}; export type DeleteApiV1SitesSiteIdDevicesDeviceIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove (Unadopt) Device * * DELETE /v1/sites/{siteId}/devices/{deviceId} */ export const deleteApiV1SitesSiteIdDevicesDeviceId = async (args: DeleteApiV1SitesSiteIdDevicesDeviceIdArgs, options?: DeleteApiV1SitesSiteIdDevicesDeviceIdOptions) => { const {baseUrl = "https://api.ui.com/v1/connector/consoles/942A6FF664C0000000000964970E0000000009E710560000000068A9873F:9999999999/proxy/network/integration", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/sites/${encodeURIComponent(String(args.siteId))}/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 };