export type DeleteApiApiV1PoolsUidArgs = {uid: string}; export type DeleteApiApiV1PoolsUidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a pool group by UID * * DELETE /api/v1/pools/{uid} */ export const deleteApiApiV1PoolsUid = async (args: DeleteApiApiV1PoolsUidArgs, options?: DeleteApiApiV1PoolsUidOptions) => { const {baseUrl = "http://miner", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/pools/${encodeURIComponent(String(args.uid))}${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 };