export type DeleteApiAgentphoneV1AgentsAgentIdArgs = {agentId: string}; export type DeleteApiAgentphoneV1AgentsAgentIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Permanently delete an agent. Cannot be undone. * * DELETE /agentphone/v1/agents/{agentId} */ export const deleteApiAgentphoneV1AgentsAgentId = async (args: DeleteApiAgentphoneV1AgentsAgentIdArgs, options?: DeleteApiAgentphoneV1AgentsAgentIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/agentphone/v1/agents/${encodeURIComponent(String(args.agentId))}${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 };