/* tslint:disable */
/* eslint-disable */
/**
 * Fabro Run API
 * HTTP API for managing Fabro workflow run executions.
 *
 * The version of the OpenAPI document: 0.2.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { BatchDeleteRunsRequest } from '../models';
// @ts-ignore
import type { BatchDeleteRunsResponse } from '../models';
// @ts-ignore
import type { BatchRunLifecycleRequest } from '../models';
// @ts-ignore
import type { BatchRunLifecycleResponse } from '../models';
// @ts-ignore
import type { BoardColumn } from '../models';
// @ts-ignore
import type { CloseRunPullRequestResponse } from '../models';
// @ts-ignore
import type { CreateRunPullRequestRequest } from '../models';
// @ts-ignore
import type { DeleteRunResponse } from '../models';
// @ts-ignore
import type { DenyRunRequest } from '../models';
// @ts-ignore
import type { ErrorResponse } from '../models';
// @ts-ignore
import type { ForkRequest } from '../models';
// @ts-ignore
import type { ForkResponse } from '../models';
// @ts-ignore
import type { LinkRunPullRequestRequest } from '../models';
// @ts-ignore
import type { MergeRunPullRequestRequest } from '../models';
// @ts-ignore
import type { MergeRunPullRequestResponse } from '../models';
// @ts-ignore
import type { PaginatedRunList } from '../models';
// @ts-ignore
import type { PreflightResponse } from '../models';
// @ts-ignore
import type { PullRequestCreation } from '../models';
// @ts-ignore
import type { PullRequestLink } from '../models';
// @ts-ignore
import type { PullRequestResponse } from '../models';
// @ts-ignore
import type { RenderWorkflowGraphRequest } from '../models';
// @ts-ignore
import type { RewindRequest } from '../models';
// @ts-ignore
import type { RewindResponse } from '../models';
// @ts-ignore
import type { Run } from '../models';
// @ts-ignore
import type { RunManifest } from '../models';
// @ts-ignore
import type { StartRunRequest } from '../models';
// @ts-ignore
import type { TimelineEntryResponse } from '../models';
// @ts-ignore
import type { UpdateRunParentRequest } from '../models';
// @ts-ignore
import type { UpdateRunRequest } from '../models';
// @ts-ignore
import type { ValidateResponse } from '../models';
/**
 * RunsApi - axios parameter creator
 */
export const RunsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Approves a pending run that requires pre-execution approval and makes it runnable.
         * @summary Approve Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        approveRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('approveRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/approve`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Marks a terminal run (`succeeded`, `failed`, or `dead`) as `archived`. Archived runs are hidden from default listings and are read-only until unarchived. Idempotent on already-archived runs. Returns 409 if the run is not terminal.
         * @summary Archive Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        archiveRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('archiveRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/archive`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Marks up to 250 terminal runs as archived in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run archive events as `POST /api/v1/runs/{id}/archive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Archive Runs
         * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchArchiveRuns: async (batchRunLifecycleRequest: BatchRunLifecycleRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'batchRunLifecycleRequest' is not null or undefined
            assertParamExists('batchArchiveRuns', 'batchRunLifecycleRequest', batchRunLifecycleRequest)
            const localVarPath = `/api/v1/runs/archive`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(batchRunLifecycleRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Deletes up to 250 runs in one fail-soft, non-transactional request. Each run is processed independently. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Delete Runs
         * @param {BatchDeleteRunsRequest} batchDeleteRunsRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchDeleteRuns: async (batchDeleteRunsRequest: BatchDeleteRunsRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'batchDeleteRunsRequest' is not null or undefined
            assertParamExists('batchDeleteRuns', 'batchDeleteRunsRequest', batchDeleteRunsRequest)
            const localVarPath = `/api/v1/runs/delete`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(batchDeleteRunsRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Restores up to 250 archived runs in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run unarchive events as `POST /api/v1/runs/{id}/unarchive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Unarchive Runs
         * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchUnarchiveRuns: async (batchRunLifecycleRequest: BatchRunLifecycleRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'batchRunLifecycleRequest' is not null or undefined
            assertParamExists('batchUnarchiveRuns', 'batchRunLifecycleRequest', batchRunLifecycleRequest)
            const localVarPath = `/api/v1/runs/unarchive`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(batchRunLifecycleRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Cancels a pending, runnable, or running run. Pre-execution runs are cancelled synchronously. Live runs return after the cancellation request is durably recorded and continue converging to a terminal cancelled state. Returns 409 if the run has already completed or been cancelled.
         * @summary Cancel Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        cancelRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('cancelRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/cancel`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Closes the stored pull request for a run on GitHub.
         * @summary Close Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        closeRunPullRequest: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('closeRunPullRequest', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/pull_request/close`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a new workflow run in `submitted` status from a self-contained manifest.
         * @summary Create Run
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRun: async (runManifest: RunManifest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'runManifest' is not null or undefined
            assertParamExists('createRun', 'runManifest', runManifest)
            const localVarPath = `/api/v1/runs`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(runManifest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Durably requests creation of a pull request for a completed run. The server generates the pull request content and creates the GitHub pull request after this request returns. Poll the URL in the Location response header until the creation succeeds or fails.  If a creation is already pending for the run, the response returns that creation unchanged; any different `model` or `force` values in the new request are ignored.
         * @summary Create Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {CreateRunPullRequestRequest} createRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRunPullRequest: async (id: string, createRunPullRequestRequest: CreateRunPullRequestRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('createRunPullRequest', 'id', id)
            // verify required parameter 'createRunPullRequestRequest' is not null or undefined
            assertParamExists('createRunPullRequest', 'createRunPullRequestRequest', createRunPullRequestRequest)
            const localVarPath = `/api/v1/runs/{id}/pull_request`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createRunPullRequestRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Deletes durable store state, local run scratch data, and the run-owned sandbox unless sandbox preservation is enabled. Active runs require `force=true`.
         * @summary Delete Run
         * @param {string} id Unique run identifier (ULID).
         * @param {boolean} [force] Whether to force deletion of an active run. Defaults to &#x60;false&#x60;.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRun: async (id: string, force?: boolean, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (force !== undefined) {
                localVarQueryParameter['force'] = force;
            }

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Denies a pending run that requires pre-execution approval and fails it with `approval_denied`.
         * @summary Deny Run
         * @param {string} id Unique run identifier (ULID).
         * @param {DenyRunRequest} [denyRunRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        denyRun: async (id: string, denyRunRequest?: DenyRunRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('denyRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/deny`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(denyRunRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a new run from a checkpoint of the source run. The source run is left untouched.
         * @summary Fork Run
         * @param {string} id Unique run identifier (ULID).
         * @param {ForkRequest} [forkRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        forkRun: async (id: string, forkRequest?: ForkRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('forkRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/fork`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(forkRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the stored pull request record for a run plus live GitHub details when available.
         * @summary Get Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRunPullRequest: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('getRunPullRequest', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/pull_request`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the latest explicit pull request creation requested for this run.
         * @summary Get Run Pull Request Creation
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRunPullRequestCreation: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('getRunPullRequestCreation', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/pull_request/creation`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns checkpoint timeline entries from durable run-store checkpoints. Metadata branches are write-only archives and are not read by this endpoint.
         * @summary Get Run Timeline
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRunTimeline: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('getRunTimeline', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/timeline`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Links a run under an orchestration parent. Parent links are mutable for all run states, including archived and terminal runs.
         * @summary Link Run Parent
         * @param {string} id Unique run identifier (ULID).
         * @param {UpdateRunParentRequest} updateRunParentRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        linkRunParent: async (id: string, updateRunParentRequest: UpdateRunParentRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('linkRunParent', 'id', id)
            // verify required parameter 'updateRunParentRequest' is not null or undefined
            assertParamExists('linkRunParent', 'updateRunParentRequest', updateRunParentRequest)
            const localVarPath = `/api/v1/runs/{id}/parent`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(updateRunParentRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Links or replaces the GitHub pull request association for a run without modifying the remote pull request.
         * @summary Link Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {LinkRunPullRequestRequest} linkRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        linkRunPullRequest: async (id: string, linkRunPullRequestRequest: LinkRunPullRequestRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('linkRunPullRequest', 'id', id)
            // verify required parameter 'linkRunPullRequestRequest' is not null or undefined
            assertParamExists('linkRunPullRequest', 'linkRunPullRequestRequest', linkRunPullRequestRequest)
            const localVarPath = `/api/v1/runs/{id}/pull_request`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(linkRunPullRequestRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns durable run summaries from the backing store, including runs persisted before the current server boot. Supports per-status filtering and sorting for both list and kanban renderings. Archived runs are hidden by default; pass `include_archived=true` (or `status=archived`) to include them. Runs in the `removing` bucket are hidden unless explicitly requested via `status=removing`.
         * @summary List Runs
         * @param {number} [pageLimit] Maximum number of items to return per page.
         * @param {number} [pageOffset] Number of items to skip before returning results.
         * @param {boolean} [includeArchived] Whether to include archived runs in the response. Defaults to &#x60;false&#x60;.
         * @param {string} [parentId] Return only runs currently linked to this orchestration parent.
         * @param {Array<BoardColumn>} [status] Filter runs by status bucket. Repeatable. When omitted, runs in the &#x60;removing&#x60; bucket are hidden; pass &#x60;status&#x3D;removing&#x60; to include them. Archived runs are hidden unless &#x60;include_archived&#x3D;true&#x60; or &#x60;status&#x3D;archived&#x60; is passed.
         * @param {ListRunsSortEnum} [sort] Field to sort by. Defaults to &#x60;created_at&#x60;.
         * @param {ListRunsDirectionEnum} [direction] Sort direction. Defaults to &#x60;desc&#x60;.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRuns: async (pageLimit?: number, pageOffset?: number, includeArchived?: boolean, parentId?: string, status?: Array<BoardColumn>, sort?: ListRunsSortEnum, direction?: ListRunsDirectionEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/v1/runs`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (pageLimit !== undefined) {
                localVarQueryParameter['page[limit]'] = pageLimit;
            }

            if (pageOffset !== undefined) {
                localVarQueryParameter['page[offset]'] = pageOffset;
            }

            if (includeArchived !== undefined) {
                localVarQueryParameter['include_archived'] = includeArchived;
            }

            if (parentId !== undefined) {
                localVarQueryParameter['parent_id'] = parentId;
            }

            if (status) {
                localVarQueryParameter['status'] = status;
            }

            if (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }

            if (direction !== undefined) {
                localVarQueryParameter['direction'] = direction;
            }

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Merges the stored pull request for a run on GitHub.
         * @summary Merge Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {MergeRunPullRequestRequest} mergeRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeRunPullRequest: async (id: string, mergeRunPullRequestRequest: MergeRunPullRequestRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('mergeRunPullRequest', 'id', id)
            // verify required parameter 'mergeRunPullRequestRequest' is not null or undefined
            assertParamExists('mergeRunPullRequest', 'mergeRunPullRequestRequest', mergeRunPullRequestRequest)
            const localVarPath = `/api/v1/runs/{id}/pull_request/merge`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(mergeRunPullRequestRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Pauses a running run. Returns 409 if the run is not running.
         * @summary Pause Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        pauseRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('pauseRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/pause`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Validates and renders a workflow manifest as SVG without creating a run.
         * @summary Render Workflow Graph
         * @param {RenderWorkflowGraphRequest} renderWorkflowGraphRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        renderWorkflowGraph: async (renderWorkflowGraphRequest: RenderWorkflowGraphRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'renderWorkflowGraphRequest' is not null or undefined
            assertParamExists('renderWorkflowGraph', 'renderWorkflowGraphRequest', renderWorkflowGraphRequest)
            const localVarPath = `/api/v1/graph/render`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'image/svg+xml,application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(renderWorkflowGraphRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Resolves a run selector to one durable run summary using server-owned selector semantics.
         * @summary Resolve Run Selector
         * @param {string} selector Run selector, such as a run ID prefix, workflow slug, or workflow name.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resolveRun: async (selector: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'selector' is not null or undefined
            assertParamExists('resolveRun', 'selector', selector)
            const localVarPath = `/api/v1/runs/resolve`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (selector !== undefined) {
                localVarQueryParameter['selector'] = selector;
            }

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the durable run summary for a run.
         * @summary Retrieve Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Renders the workflow graph as an SVG image using Graphviz.
         * @summary Render SVG
         * @param {string} id Unique run identifier (ULID).
         * @param {RetrieveRunGraphDirectionEnum} [direction] Optional Graphviz rank direction override for the rendered graph.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRunGraph: async (id: string, direction?: RetrieveRunGraphDirectionEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveRunGraph', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/graph`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (direction !== undefined) {
                localVarQueryParameter['direction'] = direction;
            }

            localVarHeaderParameter['Accept'] = 'image/svg+xml,application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the raw Graphviz DOT source for the workflow graph (the contents of the workflow\'s `.fabro` file).
         * @summary Retrieve Graphviz DOT source
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRunGraphSource: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveRunGraphSource', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/graph/source`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'text/vnd.graphviz,application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a fresh run from the terminal source run\'s captured durable definition, records `retried_from` on the new run, and schedules it for execution. The source run is left unchanged. Active and archived runs are not retryable.
         * @summary Retry Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retryRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retryRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/retry`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a new run from an earlier checkpoint of a terminal source run, archives the source run, and records `run.superseded_by` on the source after archive succeeds. Returns 207 when the new run was created but the source archive step failed.
         * @summary Rewind Run
         * @param {string} id Unique run identifier (ULID).
         * @param {RewindRequest} [rewindRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        rewindRun: async (id: string, rewindRequest?: RewindRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('rewindRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/rewind`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(rewindRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Validates runtime readiness for a workflow manifest without creating a run.
         * @summary Validate Workflow Manifest
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        runPreflight: async (runManifest: RunManifest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'runManifest' is not null or undefined
            assertParamExists('runPreflight', 'runManifest', runManifest)
            const localVarPath = `/api/v1/preflight`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(runManifest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Requests start for a submitted run. User-created runs become runnable; parent-generated child runs may become pending until approved. Provide `resume=true` to resume an interrupted run from checkpoint. Returns 409 if the run is not startable.
         * @summary Start Run
         * @param {string} id Unique run identifier (ULID).
         * @param {StartRunRequest} [startRunRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        startRun: async (id: string, startRunRequest?: StartRunRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('startRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/start`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(startRunRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Restores an archived run to its prior terminal status. Idempotent on runs that are terminal but not archived (returns the current status without emitting an event). Returns 409 if the run is active.
         * @summary Unarchive Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unarchiveRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('unarchiveRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/unarchive`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Removes a run\'s orchestration parent. Already-root runs are returned unchanged.
         * @summary Unlink Run Parent
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unlinkRunParent: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('unlinkRunParent', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/parent`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Removes Fabro\'s stored pull request association for a run without modifying the remote pull request.
         * @summary Unlink Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unlinkRunPullRequest: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('unlinkRunPullRequest', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/pull_request`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Resumes a paused run. Returns 409 if the run is not paused.
         * @summary Unpause Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unpauseRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('unpauseRun', 'id', id)
            const localVarPath = `/api/v1/runs/{id}/unpause`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates mutable run metadata. Title updates are allowed for all run states, including archived runs.
         * @summary Update Run
         * @param {string} id Unique run identifier (ULID).
         * @param {UpdateRunRequest} updateRunRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRun: async (id: string, updateRunRequest: UpdateRunRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateRun', 'id', id)
            // verify required parameter 'updateRunRequest' is not null or undefined
            assertParamExists('updateRun', 'updateRunRequest', updateRunRequest)
            const localVarPath = `/api/v1/runs/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(updateRunRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Validates workflow structure and diagnostics without runtime readiness checks.
         * @summary Validate Workflow Manifest
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        validateRunManifest: async (runManifest: RunManifest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'runManifest' is not null or undefined
            assertParamExists('validateRunManifest', 'runManifest', runManifest)
            const localVarPath = `/api/v1/validate`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication SessionCookie required

            // authentication BearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(runManifest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * RunsApi - functional programming interface
 */
export const RunsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = RunsApiAxiosParamCreator(configuration)
    return {
        /**
         * Approves a pending run that requires pre-execution approval and makes it runnable.
         * @summary Approve Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async approveRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.approveRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.approveRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Marks a terminal run (`succeeded`, `failed`, or `dead`) as `archived`. Archived runs are hidden from default listings and are read-only until unarchived. Idempotent on already-archived runs. Returns 409 if the run is not terminal.
         * @summary Archive Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async archiveRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.archiveRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.archiveRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Marks up to 250 terminal runs as archived in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run archive events as `POST /api/v1/runs/{id}/archive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Archive Runs
         * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async batchArchiveRuns(batchRunLifecycleRequest: BatchRunLifecycleRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BatchRunLifecycleResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.batchArchiveRuns(batchRunLifecycleRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.batchArchiveRuns']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Deletes up to 250 runs in one fail-soft, non-transactional request. Each run is processed independently. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Delete Runs
         * @param {BatchDeleteRunsRequest} batchDeleteRunsRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async batchDeleteRuns(batchDeleteRunsRequest: BatchDeleteRunsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BatchDeleteRunsResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.batchDeleteRuns(batchDeleteRunsRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.batchDeleteRuns']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Restores up to 250 archived runs in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run unarchive events as `POST /api/v1/runs/{id}/unarchive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Unarchive Runs
         * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async batchUnarchiveRuns(batchRunLifecycleRequest: BatchRunLifecycleRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BatchRunLifecycleResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.batchUnarchiveRuns(batchRunLifecycleRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.batchUnarchiveRuns']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Cancels a pending, runnable, or running run. Pre-execution runs are cancelled synchronously. Live runs return after the cancellation request is durably recorded and continue converging to a terminal cancelled state. Returns 409 if the run has already completed or been cancelled.
         * @summary Cancel Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async cancelRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.cancelRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.cancelRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Closes the stored pull request for a run on GitHub.
         * @summary Close Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async closeRunPullRequest(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CloseRunPullRequestResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.closeRunPullRequest(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.closeRunPullRequest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a new workflow run in `submitted` status from a self-contained manifest.
         * @summary Create Run
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createRun(runManifest: RunManifest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createRun(runManifest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.createRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Durably requests creation of a pull request for a completed run. The server generates the pull request content and creates the GitHub pull request after this request returns. Poll the URL in the Location response header until the creation succeeds or fails.  If a creation is already pending for the run, the response returns that creation unchanged; any different `model` or `force` values in the new request are ignored.
         * @summary Create Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {CreateRunPullRequestRequest} createRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createRunPullRequest(id: string, createRunPullRequestRequest: CreateRunPullRequestRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PullRequestCreation>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createRunPullRequest(id, createRunPullRequestRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.createRunPullRequest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Deletes durable store state, local run scratch data, and the run-owned sandbox unless sandbox preservation is enabled. Active runs require `force=true`.
         * @summary Delete Run
         * @param {string} id Unique run identifier (ULID).
         * @param {boolean} [force] Whether to force deletion of an active run. Defaults to &#x60;false&#x60;.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRun(id: string, force?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteRunResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRun(id, force, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.deleteRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Denies a pending run that requires pre-execution approval and fails it with `approval_denied`.
         * @summary Deny Run
         * @param {string} id Unique run identifier (ULID).
         * @param {DenyRunRequest} [denyRunRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async denyRun(id: string, denyRunRequest?: DenyRunRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.denyRun(id, denyRunRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.denyRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a new run from a checkpoint of the source run. The source run is left untouched.
         * @summary Fork Run
         * @param {string} id Unique run identifier (ULID).
         * @param {ForkRequest} [forkRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async forkRun(id: string, forkRequest?: ForkRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ForkResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.forkRun(id, forkRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.forkRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the stored pull request record for a run plus live GitHub details when available.
         * @summary Get Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getRunPullRequest(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PullRequestResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getRunPullRequest(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.getRunPullRequest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the latest explicit pull request creation requested for this run.
         * @summary Get Run Pull Request Creation
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getRunPullRequestCreation(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PullRequestCreation>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getRunPullRequestCreation(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.getRunPullRequestCreation']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns checkpoint timeline entries from durable run-store checkpoints. Metadata branches are write-only archives and are not read by this endpoint.
         * @summary Get Run Timeline
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getRunTimeline(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<TimelineEntryResponse>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getRunTimeline(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.getRunTimeline']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Links a run under an orchestration parent. Parent links are mutable for all run states, including archived and terminal runs.
         * @summary Link Run Parent
         * @param {string} id Unique run identifier (ULID).
         * @param {UpdateRunParentRequest} updateRunParentRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async linkRunParent(id: string, updateRunParentRequest: UpdateRunParentRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.linkRunParent(id, updateRunParentRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.linkRunParent']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Links or replaces the GitHub pull request association for a run without modifying the remote pull request.
         * @summary Link Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {LinkRunPullRequestRequest} linkRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async linkRunPullRequest(id: string, linkRunPullRequestRequest: LinkRunPullRequestRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PullRequestLink>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.linkRunPullRequest(id, linkRunPullRequestRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.linkRunPullRequest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns durable run summaries from the backing store, including runs persisted before the current server boot. Supports per-status filtering and sorting for both list and kanban renderings. Archived runs are hidden by default; pass `include_archived=true` (or `status=archived`) to include them. Runs in the `removing` bucket are hidden unless explicitly requested via `status=removing`.
         * @summary List Runs
         * @param {number} [pageLimit] Maximum number of items to return per page.
         * @param {number} [pageOffset] Number of items to skip before returning results.
         * @param {boolean} [includeArchived] Whether to include archived runs in the response. Defaults to &#x60;false&#x60;.
         * @param {string} [parentId] Return only runs currently linked to this orchestration parent.
         * @param {Array<BoardColumn>} [status] Filter runs by status bucket. Repeatable. When omitted, runs in the &#x60;removing&#x60; bucket are hidden; pass &#x60;status&#x3D;removing&#x60; to include them. Archived runs are hidden unless &#x60;include_archived&#x3D;true&#x60; or &#x60;status&#x3D;archived&#x60; is passed.
         * @param {ListRunsSortEnum} [sort] Field to sort by. Defaults to &#x60;created_at&#x60;.
         * @param {ListRunsDirectionEnum} [direction] Sort direction. Defaults to &#x60;desc&#x60;.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRuns(pageLimit?: number, pageOffset?: number, includeArchived?: boolean, parentId?: string, status?: Array<BoardColumn>, sort?: ListRunsSortEnum, direction?: ListRunsDirectionEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedRunList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRuns(pageLimit, pageOffset, includeArchived, parentId, status, sort, direction, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.listRuns']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Merges the stored pull request for a run on GitHub.
         * @summary Merge Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {MergeRunPullRequestRequest} mergeRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async mergeRunPullRequest(id: string, mergeRunPullRequestRequest: MergeRunPullRequestRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MergeRunPullRequestResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.mergeRunPullRequest(id, mergeRunPullRequestRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.mergeRunPullRequest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Pauses a running run. Returns 409 if the run is not running.
         * @summary Pause Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async pauseRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.pauseRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.pauseRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Validates and renders a workflow manifest as SVG without creating a run.
         * @summary Render Workflow Graph
         * @param {RenderWorkflowGraphRequest} renderWorkflowGraphRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async renderWorkflowGraph(renderWorkflowGraphRequest: RenderWorkflowGraphRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.renderWorkflowGraph(renderWorkflowGraphRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.renderWorkflowGraph']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Resolves a run selector to one durable run summary using server-owned selector semantics.
         * @summary Resolve Run Selector
         * @param {string} selector Run selector, such as a run ID prefix, workflow slug, or workflow name.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async resolveRun(selector: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.resolveRun(selector, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.resolveRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the durable run summary for a run.
         * @summary Retrieve Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.retrieveRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Renders the workflow graph as an SVG image using Graphviz.
         * @summary Render SVG
         * @param {string} id Unique run identifier (ULID).
         * @param {RetrieveRunGraphDirectionEnum} [direction] Optional Graphviz rank direction override for the rendered graph.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveRunGraph(id: string, direction?: RetrieveRunGraphDirectionEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRunGraph(id, direction, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.retrieveRunGraph']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the raw Graphviz DOT source for the workflow graph (the contents of the workflow\'s `.fabro` file).
         * @summary Retrieve Graphviz DOT source
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveRunGraphSource(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRunGraphSource(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.retrieveRunGraphSource']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a fresh run from the terminal source run\'s captured durable definition, records `retried_from` on the new run, and schedules it for execution. The source run is left unchanged. Active and archived runs are not retryable.
         * @summary Retry Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retryRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retryRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.retryRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a new run from an earlier checkpoint of a terminal source run, archives the source run, and records `run.superseded_by` on the source after archive succeeds. Returns 207 when the new run was created but the source archive step failed.
         * @summary Rewind Run
         * @param {string} id Unique run identifier (ULID).
         * @param {RewindRequest} [rewindRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async rewindRun(id: string, rewindRequest?: RewindRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RewindResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.rewindRun(id, rewindRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.rewindRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Validates runtime readiness for a workflow manifest without creating a run.
         * @summary Validate Workflow Manifest
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async runPreflight(runManifest: RunManifest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PreflightResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.runPreflight(runManifest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.runPreflight']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Requests start for a submitted run. User-created runs become runnable; parent-generated child runs may become pending until approved. Provide `resume=true` to resume an interrupted run from checkpoint. Returns 409 if the run is not startable.
         * @summary Start Run
         * @param {string} id Unique run identifier (ULID).
         * @param {StartRunRequest} [startRunRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async startRun(id: string, startRunRequest?: StartRunRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.startRun(id, startRunRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.startRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Restores an archived run to its prior terminal status. Idempotent on runs that are terminal but not archived (returns the current status without emitting an event). Returns 409 if the run is active.
         * @summary Unarchive Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async unarchiveRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.unarchiveRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.unarchiveRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Removes a run\'s orchestration parent. Already-root runs are returned unchanged.
         * @summary Unlink Run Parent
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async unlinkRunParent(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.unlinkRunParent(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.unlinkRunParent']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Removes Fabro\'s stored pull request association for a run without modifying the remote pull request.
         * @summary Unlink Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async unlinkRunPullRequest(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PullRequestLink>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.unlinkRunPullRequest(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.unlinkRunPullRequest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Resumes a paused run. Returns 409 if the run is not paused.
         * @summary Unpause Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async unpauseRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.unpauseRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.unpauseRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates mutable run metadata. Title updates are allowed for all run states, including archived runs.
         * @summary Update Run
         * @param {string} id Unique run identifier (ULID).
         * @param {UpdateRunRequest} updateRunRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateRun(id: string, updateRunRequest: UpdateRunRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateRun(id, updateRunRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.updateRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Validates workflow structure and diagnostics without runtime readiness checks.
         * @summary Validate Workflow Manifest
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async validateRunManifest(runManifest: RunManifest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ValidateResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.validateRunManifest(runManifest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.validateRunManifest']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * RunsApi - factory interface
 */
export const RunsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = RunsApiFp(configuration)
    return {
        /**
         * Approves a pending run that requires pre-execution approval and makes it runnable.
         * @summary Approve Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        approveRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.approveRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Marks a terminal run (`succeeded`, `failed`, or `dead`) as `archived`. Archived runs are hidden from default listings and are read-only until unarchived. Idempotent on already-archived runs. Returns 409 if the run is not terminal.
         * @summary Archive Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        archiveRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.archiveRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Marks up to 250 terminal runs as archived in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run archive events as `POST /api/v1/runs/{id}/archive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Archive Runs
         * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchArchiveRuns(batchRunLifecycleRequest: BatchRunLifecycleRequest, options?: RawAxiosRequestConfig): AxiosPromise<BatchRunLifecycleResponse> {
            return localVarFp.batchArchiveRuns(batchRunLifecycleRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Deletes up to 250 runs in one fail-soft, non-transactional request. Each run is processed independently. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Delete Runs
         * @param {BatchDeleteRunsRequest} batchDeleteRunsRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchDeleteRuns(batchDeleteRunsRequest: BatchDeleteRunsRequest, options?: RawAxiosRequestConfig): AxiosPromise<BatchDeleteRunsResponse> {
            return localVarFp.batchDeleteRuns(batchDeleteRunsRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Restores up to 250 archived runs in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run unarchive events as `POST /api/v1/runs/{id}/unarchive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
         * @summary Unarchive Runs
         * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchUnarchiveRuns(batchRunLifecycleRequest: BatchRunLifecycleRequest, options?: RawAxiosRequestConfig): AxiosPromise<BatchRunLifecycleResponse> {
            return localVarFp.batchUnarchiveRuns(batchRunLifecycleRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Cancels a pending, runnable, or running run. Pre-execution runs are cancelled synchronously. Live runs return after the cancellation request is durably recorded and continue converging to a terminal cancelled state. Returns 409 if the run has already completed or been cancelled.
         * @summary Cancel Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        cancelRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.cancelRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Closes the stored pull request for a run on GitHub.
         * @summary Close Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        closeRunPullRequest(id: string, options?: RawAxiosRequestConfig): AxiosPromise<CloseRunPullRequestResponse> {
            return localVarFp.closeRunPullRequest(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a new workflow run in `submitted` status from a self-contained manifest.
         * @summary Create Run
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRun(runManifest: RunManifest, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.createRun(runManifest, options).then((request) => request(axios, basePath));
        },
        /**
         * Durably requests creation of a pull request for a completed run. The server generates the pull request content and creates the GitHub pull request after this request returns. Poll the URL in the Location response header until the creation succeeds or fails.  If a creation is already pending for the run, the response returns that creation unchanged; any different `model` or `force` values in the new request are ignored.
         * @summary Create Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {CreateRunPullRequestRequest} createRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRunPullRequest(id: string, createRunPullRequestRequest: CreateRunPullRequestRequest, options?: RawAxiosRequestConfig): AxiosPromise<PullRequestCreation> {
            return localVarFp.createRunPullRequest(id, createRunPullRequestRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Deletes durable store state, local run scratch data, and the run-owned sandbox unless sandbox preservation is enabled. Active runs require `force=true`.
         * @summary Delete Run
         * @param {string} id Unique run identifier (ULID).
         * @param {boolean} [force] Whether to force deletion of an active run. Defaults to &#x60;false&#x60;.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRun(id: string, force?: boolean, options?: RawAxiosRequestConfig): AxiosPromise<DeleteRunResponse> {
            return localVarFp.deleteRun(id, force, options).then((request) => request(axios, basePath));
        },
        /**
         * Denies a pending run that requires pre-execution approval and fails it with `approval_denied`.
         * @summary Deny Run
         * @param {string} id Unique run identifier (ULID).
         * @param {DenyRunRequest} [denyRunRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        denyRun(id: string, denyRunRequest?: DenyRunRequest, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.denyRun(id, denyRunRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a new run from a checkpoint of the source run. The source run is left untouched.
         * @summary Fork Run
         * @param {string} id Unique run identifier (ULID).
         * @param {ForkRequest} [forkRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        forkRun(id: string, forkRequest?: ForkRequest, options?: RawAxiosRequestConfig): AxiosPromise<ForkResponse> {
            return localVarFp.forkRun(id, forkRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the stored pull request record for a run plus live GitHub details when available.
         * @summary Get Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRunPullRequest(id: string, options?: RawAxiosRequestConfig): AxiosPromise<PullRequestResponse> {
            return localVarFp.getRunPullRequest(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the latest explicit pull request creation requested for this run.
         * @summary Get Run Pull Request Creation
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRunPullRequestCreation(id: string, options?: RawAxiosRequestConfig): AxiosPromise<PullRequestCreation> {
            return localVarFp.getRunPullRequestCreation(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns checkpoint timeline entries from durable run-store checkpoints. Metadata branches are write-only archives and are not read by this endpoint.
         * @summary Get Run Timeline
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRunTimeline(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<TimelineEntryResponse>> {
            return localVarFp.getRunTimeline(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Links a run under an orchestration parent. Parent links are mutable for all run states, including archived and terminal runs.
         * @summary Link Run Parent
         * @param {string} id Unique run identifier (ULID).
         * @param {UpdateRunParentRequest} updateRunParentRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        linkRunParent(id: string, updateRunParentRequest: UpdateRunParentRequest, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.linkRunParent(id, updateRunParentRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Links or replaces the GitHub pull request association for a run without modifying the remote pull request.
         * @summary Link Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {LinkRunPullRequestRequest} linkRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        linkRunPullRequest(id: string, linkRunPullRequestRequest: LinkRunPullRequestRequest, options?: RawAxiosRequestConfig): AxiosPromise<PullRequestLink> {
            return localVarFp.linkRunPullRequest(id, linkRunPullRequestRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns durable run summaries from the backing store, including runs persisted before the current server boot. Supports per-status filtering and sorting for both list and kanban renderings. Archived runs are hidden by default; pass `include_archived=true` (or `status=archived`) to include them. Runs in the `removing` bucket are hidden unless explicitly requested via `status=removing`.
         * @summary List Runs
         * @param {number} [pageLimit] Maximum number of items to return per page.
         * @param {number} [pageOffset] Number of items to skip before returning results.
         * @param {boolean} [includeArchived] Whether to include archived runs in the response. Defaults to &#x60;false&#x60;.
         * @param {string} [parentId] Return only runs currently linked to this orchestration parent.
         * @param {Array<BoardColumn>} [status] Filter runs by status bucket. Repeatable. When omitted, runs in the &#x60;removing&#x60; bucket are hidden; pass &#x60;status&#x3D;removing&#x60; to include them. Archived runs are hidden unless &#x60;include_archived&#x3D;true&#x60; or &#x60;status&#x3D;archived&#x60; is passed.
         * @param {ListRunsSortEnum} [sort] Field to sort by. Defaults to &#x60;created_at&#x60;.
         * @param {ListRunsDirectionEnum} [direction] Sort direction. Defaults to &#x60;desc&#x60;.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRuns(pageLimit?: number, pageOffset?: number, includeArchived?: boolean, parentId?: string, status?: Array<BoardColumn>, sort?: ListRunsSortEnum, direction?: ListRunsDirectionEnum, options?: RawAxiosRequestConfig): AxiosPromise<PaginatedRunList> {
            return localVarFp.listRuns(pageLimit, pageOffset, includeArchived, parentId, status, sort, direction, options).then((request) => request(axios, basePath));
        },
        /**
         * Merges the stored pull request for a run on GitHub.
         * @summary Merge Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {MergeRunPullRequestRequest} mergeRunPullRequestRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeRunPullRequest(id: string, mergeRunPullRequestRequest: MergeRunPullRequestRequest, options?: RawAxiosRequestConfig): AxiosPromise<MergeRunPullRequestResponse> {
            return localVarFp.mergeRunPullRequest(id, mergeRunPullRequestRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Pauses a running run. Returns 409 if the run is not running.
         * @summary Pause Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        pauseRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.pauseRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Validates and renders a workflow manifest as SVG without creating a run.
         * @summary Render Workflow Graph
         * @param {RenderWorkflowGraphRequest} renderWorkflowGraphRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        renderWorkflowGraph(renderWorkflowGraphRequest: RenderWorkflowGraphRequest, options?: RawAxiosRequestConfig): AxiosPromise<File> {
            return localVarFp.renderWorkflowGraph(renderWorkflowGraphRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Resolves a run selector to one durable run summary using server-owned selector semantics.
         * @summary Resolve Run Selector
         * @param {string} selector Run selector, such as a run ID prefix, workflow slug, or workflow name.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resolveRun(selector: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.resolveRun(selector, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the durable run summary for a run.
         * @summary Retrieve Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.retrieveRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Renders the workflow graph as an SVG image using Graphviz.
         * @summary Render SVG
         * @param {string} id Unique run identifier (ULID).
         * @param {RetrieveRunGraphDirectionEnum} [direction] Optional Graphviz rank direction override for the rendered graph.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRunGraph(id: string, direction?: RetrieveRunGraphDirectionEnum, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.retrieveRunGraph(id, direction, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the raw Graphviz DOT source for the workflow graph (the contents of the workflow\'s `.fabro` file).
         * @summary Retrieve Graphviz DOT source
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRunGraphSource(id: string, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.retrieveRunGraphSource(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a fresh run from the terminal source run\'s captured durable definition, records `retried_from` on the new run, and schedules it for execution. The source run is left unchanged. Active and archived runs are not retryable.
         * @summary Retry Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retryRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.retryRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a new run from an earlier checkpoint of a terminal source run, archives the source run, and records `run.superseded_by` on the source after archive succeeds. Returns 207 when the new run was created but the source archive step failed.
         * @summary Rewind Run
         * @param {string} id Unique run identifier (ULID).
         * @param {RewindRequest} [rewindRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        rewindRun(id: string, rewindRequest?: RewindRequest, options?: RawAxiosRequestConfig): AxiosPromise<RewindResponse> {
            return localVarFp.rewindRun(id, rewindRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Validates runtime readiness for a workflow manifest without creating a run.
         * @summary Validate Workflow Manifest
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        runPreflight(runManifest: RunManifest, options?: RawAxiosRequestConfig): AxiosPromise<PreflightResponse> {
            return localVarFp.runPreflight(runManifest, options).then((request) => request(axios, basePath));
        },
        /**
         * Requests start for a submitted run. User-created runs become runnable; parent-generated child runs may become pending until approved. Provide `resume=true` to resume an interrupted run from checkpoint. Returns 409 if the run is not startable.
         * @summary Start Run
         * @param {string} id Unique run identifier (ULID).
         * @param {StartRunRequest} [startRunRequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        startRun(id: string, startRunRequest?: StartRunRequest, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.startRun(id, startRunRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Restores an archived run to its prior terminal status. Idempotent on runs that are terminal but not archived (returns the current status without emitting an event). Returns 409 if the run is active.
         * @summary Unarchive Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unarchiveRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.unarchiveRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Removes a run\'s orchestration parent. Already-root runs are returned unchanged.
         * @summary Unlink Run Parent
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unlinkRunParent(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.unlinkRunParent(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Removes Fabro\'s stored pull request association for a run without modifying the remote pull request.
         * @summary Unlink Run Pull Request
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unlinkRunPullRequest(id: string, options?: RawAxiosRequestConfig): AxiosPromise<PullRequestLink> {
            return localVarFp.unlinkRunPullRequest(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Resumes a paused run. Returns 409 if the run is not paused.
         * @summary Unpause Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        unpauseRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.unpauseRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates mutable run metadata. Title updates are allowed for all run states, including archived runs.
         * @summary Update Run
         * @param {string} id Unique run identifier (ULID).
         * @param {UpdateRunRequest} updateRunRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRun(id: string, updateRunRequest: UpdateRunRequest, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.updateRun(id, updateRunRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Validates workflow structure and diagnostics without runtime readiness checks.
         * @summary Validate Workflow Manifest
         * @param {RunManifest} runManifest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        validateRunManifest(runManifest: RunManifest, options?: RawAxiosRequestConfig): AxiosPromise<ValidateResponse> {
            return localVarFp.validateRunManifest(runManifest, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * RunsApi - object-oriented interface
 */
export class RunsApi extends BaseAPI {
    /**
     * Approves a pending run that requires pre-execution approval and makes it runnable.
     * @summary Approve Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public approveRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).approveRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Marks a terminal run (`succeeded`, `failed`, or `dead`) as `archived`. Archived runs are hidden from default listings and are read-only until unarchived. Idempotent on already-archived runs. Returns 409 if the run is not terminal.
     * @summary Archive Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public archiveRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).archiveRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Marks up to 250 terminal runs as archived in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run archive events as `POST /api/v1/runs/{id}/archive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
     * @summary Archive Runs
     * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public batchArchiveRuns(batchRunLifecycleRequest: BatchRunLifecycleRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).batchArchiveRuns(batchRunLifecycleRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Deletes up to 250 runs in one fail-soft, non-transactional request. Each run is processed independently. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
     * @summary Delete Runs
     * @param {BatchDeleteRunsRequest} batchDeleteRunsRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public batchDeleteRuns(batchDeleteRunsRequest: BatchDeleteRunsRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).batchDeleteRuns(batchDeleteRunsRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Restores up to 250 archived runs in one fail-soft, non-transactional request. Each run is processed independently and successful items emit the same per-run unarchive events as `POST /api/v1/runs/{id}/unarchive`. A valid batch returns `200` even when some items fail; inspect `results` and `summary` for per-run outcomes. Invalid request bodies are rejected before mutating any run.
     * @summary Unarchive Runs
     * @param {BatchRunLifecycleRequest} batchRunLifecycleRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public batchUnarchiveRuns(batchRunLifecycleRequest: BatchRunLifecycleRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).batchUnarchiveRuns(batchRunLifecycleRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Cancels a pending, runnable, or running run. Pre-execution runs are cancelled synchronously. Live runs return after the cancellation request is durably recorded and continue converging to a terminal cancelled state. Returns 409 if the run has already completed or been cancelled.
     * @summary Cancel Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public cancelRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).cancelRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Closes the stored pull request for a run on GitHub.
     * @summary Close Run Pull Request
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public closeRunPullRequest(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).closeRunPullRequest(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a new workflow run in `submitted` status from a self-contained manifest.
     * @summary Create Run
     * @param {RunManifest} runManifest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createRun(runManifest: RunManifest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).createRun(runManifest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Durably requests creation of a pull request for a completed run. The server generates the pull request content and creates the GitHub pull request after this request returns. Poll the URL in the Location response header until the creation succeeds or fails.  If a creation is already pending for the run, the response returns that creation unchanged; any different `model` or `force` values in the new request are ignored.
     * @summary Create Run Pull Request
     * @param {string} id Unique run identifier (ULID).
     * @param {CreateRunPullRequestRequest} createRunPullRequestRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createRunPullRequest(id: string, createRunPullRequestRequest: CreateRunPullRequestRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).createRunPullRequest(id, createRunPullRequestRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Deletes durable store state, local run scratch data, and the run-owned sandbox unless sandbox preservation is enabled. Active runs require `force=true`.
     * @summary Delete Run
     * @param {string} id Unique run identifier (ULID).
     * @param {boolean} [force] Whether to force deletion of an active run. Defaults to &#x60;false&#x60;.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteRun(id: string, force?: boolean, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).deleteRun(id, force, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Denies a pending run that requires pre-execution approval and fails it with `approval_denied`.
     * @summary Deny Run
     * @param {string} id Unique run identifier (ULID).
     * @param {DenyRunRequest} [denyRunRequest]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public denyRun(id: string, denyRunRequest?: DenyRunRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).denyRun(id, denyRunRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a new run from a checkpoint of the source run. The source run is left untouched.
     * @summary Fork Run
     * @param {string} id Unique run identifier (ULID).
     * @param {ForkRequest} [forkRequest]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public forkRun(id: string, forkRequest?: ForkRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).forkRun(id, forkRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the stored pull request record for a run plus live GitHub details when available.
     * @summary Get Run Pull Request
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getRunPullRequest(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).getRunPullRequest(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the latest explicit pull request creation requested for this run.
     * @summary Get Run Pull Request Creation
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getRunPullRequestCreation(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).getRunPullRequestCreation(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns checkpoint timeline entries from durable run-store checkpoints. Metadata branches are write-only archives and are not read by this endpoint.
     * @summary Get Run Timeline
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getRunTimeline(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).getRunTimeline(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Links a run under an orchestration parent. Parent links are mutable for all run states, including archived and terminal runs.
     * @summary Link Run Parent
     * @param {string} id Unique run identifier (ULID).
     * @param {UpdateRunParentRequest} updateRunParentRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public linkRunParent(id: string, updateRunParentRequest: UpdateRunParentRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).linkRunParent(id, updateRunParentRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Links or replaces the GitHub pull request association for a run without modifying the remote pull request.
     * @summary Link Run Pull Request
     * @param {string} id Unique run identifier (ULID).
     * @param {LinkRunPullRequestRequest} linkRunPullRequestRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public linkRunPullRequest(id: string, linkRunPullRequestRequest: LinkRunPullRequestRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).linkRunPullRequest(id, linkRunPullRequestRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns durable run summaries from the backing store, including runs persisted before the current server boot. Supports per-status filtering and sorting for both list and kanban renderings. Archived runs are hidden by default; pass `include_archived=true` (or `status=archived`) to include them. Runs in the `removing` bucket are hidden unless explicitly requested via `status=removing`.
     * @summary List Runs
     * @param {number} [pageLimit] Maximum number of items to return per page.
     * @param {number} [pageOffset] Number of items to skip before returning results.
     * @param {boolean} [includeArchived] Whether to include archived runs in the response. Defaults to &#x60;false&#x60;.
     * @param {string} [parentId] Return only runs currently linked to this orchestration parent.
     * @param {Array<BoardColumn>} [status] Filter runs by status bucket. Repeatable. When omitted, runs in the &#x60;removing&#x60; bucket are hidden; pass &#x60;status&#x3D;removing&#x60; to include them. Archived runs are hidden unless &#x60;include_archived&#x3D;true&#x60; or &#x60;status&#x3D;archived&#x60; is passed.
     * @param {ListRunsSortEnum} [sort] Field to sort by. Defaults to &#x60;created_at&#x60;.
     * @param {ListRunsDirectionEnum} [direction] Sort direction. Defaults to &#x60;desc&#x60;.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listRuns(pageLimit?: number, pageOffset?: number, includeArchived?: boolean, parentId?: string, status?: Array<BoardColumn>, sort?: ListRunsSortEnum, direction?: ListRunsDirectionEnum, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).listRuns(pageLimit, pageOffset, includeArchived, parentId, status, sort, direction, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Merges the stored pull request for a run on GitHub.
     * @summary Merge Run Pull Request
     * @param {string} id Unique run identifier (ULID).
     * @param {MergeRunPullRequestRequest} mergeRunPullRequestRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public mergeRunPullRequest(id: string, mergeRunPullRequestRequest: MergeRunPullRequestRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).mergeRunPullRequest(id, mergeRunPullRequestRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Pauses a running run. Returns 409 if the run is not running.
     * @summary Pause Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public pauseRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).pauseRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Validates and renders a workflow manifest as SVG without creating a run.
     * @summary Render Workflow Graph
     * @param {RenderWorkflowGraphRequest} renderWorkflowGraphRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public renderWorkflowGraph(renderWorkflowGraphRequest: RenderWorkflowGraphRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).renderWorkflowGraph(renderWorkflowGraphRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Resolves a run selector to one durable run summary using server-owned selector semantics.
     * @summary Resolve Run Selector
     * @param {string} selector Run selector, such as a run ID prefix, workflow slug, or workflow name.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public resolveRun(selector: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).resolveRun(selector, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the durable run summary for a run.
     * @summary Retrieve Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).retrieveRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Renders the workflow graph as an SVG image using Graphviz.
     * @summary Render SVG
     * @param {string} id Unique run identifier (ULID).
     * @param {RetrieveRunGraphDirectionEnum} [direction] Optional Graphviz rank direction override for the rendered graph.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveRunGraph(id: string, direction?: RetrieveRunGraphDirectionEnum, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).retrieveRunGraph(id, direction, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the raw Graphviz DOT source for the workflow graph (the contents of the workflow\'s `.fabro` file).
     * @summary Retrieve Graphviz DOT source
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveRunGraphSource(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).retrieveRunGraphSource(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a fresh run from the terminal source run\'s captured durable definition, records `retried_from` on the new run, and schedules it for execution. The source run is left unchanged. Active and archived runs are not retryable.
     * @summary Retry Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retryRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).retryRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a new run from an earlier checkpoint of a terminal source run, archives the source run, and records `run.superseded_by` on the source after archive succeeds. Returns 207 when the new run was created but the source archive step failed.
     * @summary Rewind Run
     * @param {string} id Unique run identifier (ULID).
     * @param {RewindRequest} [rewindRequest]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public rewindRun(id: string, rewindRequest?: RewindRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).rewindRun(id, rewindRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Validates runtime readiness for a workflow manifest without creating a run.
     * @summary Validate Workflow Manifest
     * @param {RunManifest} runManifest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public runPreflight(runManifest: RunManifest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).runPreflight(runManifest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Requests start for a submitted run. User-created runs become runnable; parent-generated child runs may become pending until approved. Provide `resume=true` to resume an interrupted run from checkpoint. Returns 409 if the run is not startable.
     * @summary Start Run
     * @param {string} id Unique run identifier (ULID).
     * @param {StartRunRequest} [startRunRequest]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public startRun(id: string, startRunRequest?: StartRunRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).startRun(id, startRunRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Restores an archived run to its prior terminal status. Idempotent on runs that are terminal but not archived (returns the current status without emitting an event). Returns 409 if the run is active.
     * @summary Unarchive Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public unarchiveRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).unarchiveRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Removes a run\'s orchestration parent. Already-root runs are returned unchanged.
     * @summary Unlink Run Parent
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public unlinkRunParent(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).unlinkRunParent(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Removes Fabro\'s stored pull request association for a run without modifying the remote pull request.
     * @summary Unlink Run Pull Request
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public unlinkRunPullRequest(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).unlinkRunPullRequest(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Resumes a paused run. Returns 409 if the run is not paused.
     * @summary Unpause Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public unpauseRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).unpauseRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates mutable run metadata. Title updates are allowed for all run states, including archived runs.
     * @summary Update Run
     * @param {string} id Unique run identifier (ULID).
     * @param {UpdateRunRequest} updateRunRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateRun(id: string, updateRunRequest: UpdateRunRequest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).updateRun(id, updateRunRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Validates workflow structure and diagnostics without runtime readiness checks.
     * @summary Validate Workflow Manifest
     * @param {RunManifest} runManifest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public validateRunManifest(runManifest: RunManifest, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).validateRunManifest(runManifest, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListRunsSortEnum = {
    CREATED_AT: 'created_at',
    UPDATED_AT: 'updated_at',
    STATUS: 'status',
    ELAPSED: 'elapsed',
    REPO: 'repo',
    TITLE: 'title',
    WORKFLOW: 'workflow',
    CHANGES: 'changes',
    SIZE: 'size'
} as const;
export type ListRunsSortEnum = typeof ListRunsSortEnum[keyof typeof ListRunsSortEnum];
export const ListRunsDirectionEnum = {
    ASC: 'asc',
    DESC: 'desc'
} as const;
export type ListRunsDirectionEnum = typeof ListRunsDirectionEnum[keyof typeof ListRunsDirectionEnum];
export const RetrieveRunGraphDirectionEnum = {
    LR: 'LR',
    TB: 'TB',
    BT: 'BT',
    RL: 'RL'
} as const;
export type RetrieveRunGraphDirectionEnum = typeof RetrieveRunGraphDirectionEnum[keyof typeof RetrieveRunGraphDirectionEnum];
