export type AgentRelationAssignments = {data: Array<{type: 'agentAssignment', id: number}>}; export type DeleteApiApiV2UiAgentsIdRelationshipsAssignmentsArgs = {id: number, body: AgentRelationAssignments}; export type DeleteApiApiV2UiAgentsIdRelationshipsAssignmentsOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Agents relationship * * DELETE /api/v2/ui/agents/{id}/relationships/assignments */ export const deleteApiApiV2UiAgentsIdRelationshipsAssignments = async (args: DeleteApiApiV2UiAgentsIdRelationshipsAssignmentsArgs, options: DeleteApiApiV2UiAgentsIdRelationshipsAssignmentsOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/ui/agents/${encodeURIComponent(String(args.id))}/relationships/assignments${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };