export type DeleteApiWorkspacesWorkspaceIdConnectedSourcesConnectedSourceIdArgs = {connected_source_id: string, workspace_id: string}; export type DeleteApiWorkspacesWorkspaceIdConnectedSourcesConnectedSourceIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Connected Source * * DELETE /workspaces/{workspace_id}/connected-sources/{connected_source_id} */ export const deleteApiWorkspacesWorkspaceIdConnectedSourcesConnectedSourceId = async (args: DeleteApiWorkspacesWorkspaceIdConnectedSourcesConnectedSourceIdArgs, options: DeleteApiWorkspacesWorkspaceIdConnectedSourcesConnectedSourceIdOptions) => { const {baseUrl, 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(/\/+$/, '')}/workspaces/${encodeURIComponent(String(args.workspace_id))}/connected-sources/${encodeURIComponent(String(args.connected_source_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 };