/* tslint:disable */
/* eslint-disable */
/**
 * Fabro Run API
 * HTTP API for managing Fabro workflow run executions.
 *
 * The version of the OpenAPI document: 0.1.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 { ErrorResponse } from '../models';
// @ts-ignore
import type { PaginatedRunList } from '../models';
// @ts-ignore
import type { PreflightResponse } from '../models';
// @ts-ignore
import type { RenderWorkflowGraphRequest } from '../models';
// @ts-ignore
import type { RunManifest } from '../models';
// @ts-ignore
import type { RunStatusResponse } from '../models';
// @ts-ignore
import type { StartRunRequest } from '../models';
// @ts-ignore
import type { StoreRunSummary } from '../models';
/**
 * RunsApi - axios parameter creator
 */
export const RunsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Cancels a running or queued run. 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,
            };
        },
        /**
         * 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,
            };
        },
        /**
         * Deletes durable store state for a run. This does not remove any local run directory.
         * @summary Delete Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRun: async (id: string, 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)

            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,
            };
        },
        /**
         * Temporary board-view list of managed runs. This endpoint is UI-oriented and may change as the app evolves.
         * @summary List Board Runs
         * @param {number} [pageLimit] Maximum number of items to return per page.
         * @param {number} [pageOffset] Number of items to skip before returning results.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listBoardRuns: async (pageLimit?: number, pageOffset?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/v1/boards/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;
            }

            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 durable run summaries from the backing store, including runs persisted before the current server boot.
         * @summary List Runs
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRuns: async (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)

            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,
            };
        },
        /**
         * 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,
            };
        },
        /**
         * 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 {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRunGraph: async (id: string, 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)

            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,
            };
        },
        /**
         * Validates 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,
            };
        },
        /**
         * Starts a submitted run, queuing it for execution. 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,
            };
        },
        /**
         * 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,
            };
        },
    }
};

/**
 * RunsApi - functional programming interface
 */
export const RunsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = RunsApiAxiosParamCreator(configuration)
    return {
        /**
         * Cancels a running or queued run. 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<RunStatusResponse>> {
            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);
        },
        /**
         * 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<RunStatusResponse>> {
            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);
        },
        /**
         * Deletes durable store state for a run. This does not remove any local run directory.
         * @summary Delete Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRun(id, 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);
        },
        /**
         * Temporary board-view list of managed runs. This endpoint is UI-oriented and may change as the app evolves.
         * @summary List Board Runs
         * @param {number} [pageLimit] Maximum number of items to return per page.
         * @param {number} [pageOffset] Number of items to skip before returning results.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listBoardRuns(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedRunList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listBoardRuns(pageLimit, pageOffset, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RunsApi.listBoardRuns']?.[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.
         * @summary List Runs
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRuns(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<StoreRunSummary>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRuns(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);
        },
        /**
         * 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<RunStatusResponse>> {
            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);
        },
        /**
         * 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<StoreRunSummary>> {
            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 {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveRunGraph(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRunGraph(id, 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);
        },
        /**
         * Validates 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);
        },
        /**
         * Starts a submitted run, queuing it for execution. 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<RunStatusResponse>> {
            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);
        },
        /**
         * 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<RunStatusResponse>> {
            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);
        },
    }
};

/**
 * RunsApi - factory interface
 */
export const RunsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = RunsApiFp(configuration)
    return {
        /**
         * Cancels a running or queued run. 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<RunStatusResponse> {
            return localVarFp.cancelRun(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<RunStatusResponse> {
            return localVarFp.createRun(runManifest, options).then((request) => request(axios, basePath));
        },
        /**
         * Deletes durable store state for a run. This does not remove any local run directory.
         * @summary Delete Run
         * @param {string} id Unique run identifier (ULID).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Temporary board-view list of managed runs. This endpoint is UI-oriented and may change as the app evolves.
         * @summary List Board Runs
         * @param {number} [pageLimit] Maximum number of items to return per page.
         * @param {number} [pageOffset] Number of items to skip before returning results.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listBoardRuns(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): AxiosPromise<PaginatedRunList> {
            return localVarFp.listBoardRuns(pageLimit, pageOffset, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns durable run summaries from the backing store, including runs persisted before the current server boot.
         * @summary List Runs
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRuns(options?: RawAxiosRequestConfig): AxiosPromise<Array<StoreRunSummary>> {
            return localVarFp.listRuns(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<RunStatusResponse> {
            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));
        },
        /**
         * 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<StoreRunSummary> {
            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 {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveRunGraph(id: string, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.retrieveRunGraph(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Validates 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));
        },
        /**
         * Starts a submitted run, queuing it for execution. 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<RunStatusResponse> {
            return localVarFp.startRun(id, startRunRequest, 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<RunStatusResponse> {
            return localVarFp.unpauseRun(id, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * RunsApi - object-oriented interface
 */
export class RunsApi extends BaseAPI {
    /**
     * Cancels a running or queued run. 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));
    }

    /**
     * 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));
    }

    /**
     * Deletes durable store state for a run. This does not remove any local run directory.
     * @summary Delete Run
     * @param {string} id Unique run identifier (ULID).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteRun(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).deleteRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Temporary board-view list of managed runs. This endpoint is UI-oriented and may change as the app evolves.
     * @summary List Board Runs
     * @param {number} [pageLimit] Maximum number of items to return per page.
     * @param {number} [pageOffset] Number of items to skip before returning results.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listBoardRuns(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).listBoardRuns(pageLimit, pageOffset, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns durable run summaries from the backing store, including runs persisted before the current server boot.
     * @summary List Runs
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listRuns(options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).listRuns(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));
    }

    /**
     * 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 {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveRunGraph(id: string, options?: RawAxiosRequestConfig) {
        return RunsApiFp(this.configuration).retrieveRunGraph(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Validates 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));
    }

    /**
     * Starts a submitted run, queuing it for execution. 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));
    }

    /**
     * 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));
    }
}

