export type CreateApiV1ToolsToolIdEnableArgs = {tool_id: string}; export type CreateApiV1ToolsToolIdEnableOptions = {baseUrl: string, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable an API tool * * POST /v1/tools/{tool_id}/enable */ export const createApiV1ToolsToolIdEnable = async (args: CreateApiV1ToolsToolIdEnableArgs, options: CreateApiV1ToolsToolIdEnableOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("x-api-key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/tools/${encodeURIComponent(String(args.tool_id))}/enable${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };