export type DeleteApiV4ClustersClusterIdArgs = {cluster_id: string}; export type DeleteApiV4ClustersClusterIdOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Cluster * * DELETE /v4/clusters/{cluster_id} * * Also accepts auth: APIKeyCookie */ export const deleteApiV4ClustersClusterId = async (args: DeleteApiV4ClustersClusterIdArgs, options?: DeleteApiV4ClustersClusterIdOptions) => { 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))}${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 };