export type DeleteApiV4ClustersClusterIdNodePoolsNodePoolNameArgs = {cluster_id: string, node_pool_name: string}; export type DeleteApiV4ClustersClusterIdNodePoolsNodePoolNameOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Node Pool * * DELETE /v4/clusters/{cluster_id}/node-pools/{node_pool_name} * * Also accepts auth: APIKeyCookie */ export const deleteApiV4ClustersClusterIdNodePoolsNodePoolName = async (args: DeleteApiV4ClustersClusterIdNodePoolsNodePoolNameArgs, options?: DeleteApiV4ClustersClusterIdNodePoolsNodePoolNameOptions) => { const {baseUrl = "https://www.mystic.ai", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/clusters/${encodeURIComponent(String(args.cluster_id))}/node-pools/${encodeURIComponent(String(args.node_pool_name))}${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 };