export type DeleteApiInflightTestModelsInflightTestModelIdActionActionIdArgs = {inflightTestModelId: string, actionId: string, activityId: string, executionId?: string | undefined}; export type DeleteApiInflightTestModelsInflightTestModelIdActionActionIdOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete an action from a test model * * DELETE /inflight-test-models/{inflightTestModelId}/action/{actionId} */ export const deleteApiInflightTestModelsInflightTestModelIdActionActionId = async (args: DeleteApiInflightTestModelsInflightTestModelIdActionActionIdArgs, options?: DeleteApiInflightTestModelsInflightTestModelIdActionActionIdOptions) => { const {baseUrl = "http://localhost:8090/inspect-api", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.activityId != null) query.append("activityId", String(args.activityId)) if (args.executionId != null) query.append("executionId", String(args.executionId)) if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/inflight-test-models/${encodeURIComponent(String(args.inflightTestModelId))}/action/${encodeURIComponent(String(args.actionId))}${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 };