export type DeleteApiV2AuthAgentsAgentIdConnectionsConnectionIdArgs = {agent_id: string, connection_id: string}; export type DeleteApiV2AuthAgentsAgentIdConnectionsConnectionIdOptions = {baseUrl: string, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Connection * * DELETE /v2/auth/agents/{agent_id}/connections/{connection_id} * * Also accepts auth: Tenant ID, Bearer Auth */ export const deleteApiV2AuthAgentsAgentIdConnectionsConnectionId = async (args: DeleteApiV2AuthAgentsAgentIdConnectionsConnectionIdArgs, options: DeleteApiV2AuthAgentsAgentIdConnectionsConnectionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKey !== undefined) headers.set("X-API-Key", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/v2/auth/agents/${encodeURIComponent(String(args.agent_id))}/connections/${encodeURIComponent(String(args.connection_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 };