export type DeleteApiV1AgentsAgentIdAliasesArgs = {agent_id: string, alias: string}; export type DeleteApiV1AgentsAgentIdAliasesOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an agent version alias. * * DELETE /v1/agents/{agent_id}/aliases */ export const deleteApiV1AgentsAgentIdAliases = async (args: DeleteApiV1AgentsAgentIdAliasesArgs, options?: DeleteApiV1AgentsAgentIdAliasesOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.alias != null) query.append("alias", String(args.alias)) if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/agents/${encodeURIComponent(String(args.agent_id))}/aliases${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 };