export type DeleteApiApiOrgIdFleetCollectorsIdArgs = {org_id: string, id: string}; export type DeleteApiApiOrgIdFleetCollectorsIdOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a collector's row; a live host with a valid token reappears on its next heartbeat * * DELETE /api/{org_id}/fleet/collectors/{id} */ export const deleteApiApiOrgIdFleetCollectorsId = async (args: DeleteApiApiOrgIdFleetCollectorsIdArgs, options: DeleteApiApiOrgIdFleetCollectorsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/fleet/collectors/${encodeURIComponent(String(args.id))}${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 };