export type CreateApiApiV1PipelinesPipelineIdForceDeleteArgs = {pipeline_id: string, project_id?: (string | null) | undefined, session?: (string | null) | undefined}; export type CreateApiApiV1PipelinesPipelineIdForceDeleteOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Force Delete Pipeline * * POST /api/v1/pipelines/{pipeline_id}/force-delete */ export const createApiApiV1PipelinesPipelineIdForceDelete = async (args: CreateApiApiV1PipelinesPipelineIdForceDeleteArgs, options: CreateApiApiV1PipelinesPipelineIdForceDeleteOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const cookies: string[] = [] if (args.project_id != null) query.append("project_id", String(args.project_id)) if (args.session != null) cookies.push("session=" + encodeURIComponent(String(args.session))) if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) if (cookies.length > 0) headers.set('cookie', cookies.join('; ')) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/pipelines/${encodeURIComponent(String(args.pipeline_id))}/force-delete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };