/* tslint:disable */ /* eslint-disable */ /** * Arc Run API * HTTP API for managing Arc 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 { PaginatedWorkflowList } from '../models'; // @ts-ignore import type { WorkflowDetail } from '../models'; /** * WorkflowsApi - axios parameter creator */ export const WorkflowsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns a paginated list of runs filtered to a specific workflow. * @summary List Workflow Runs * @param {string} name URL-safe slug identifying a workflow definition. * @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} */ listWorkflowRuns: async (name: string, pageLimit?: number, pageOffset?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'name' is not null or undefined assertParamExists('listWorkflowRuns', 'name', name) const localVarPath = `/workflows/{name}/runs` .replace(`{${"name"}}`, encodeURIComponent(String(name))); // 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 mTLS required await setApiKeyToObject(localVarHeaderParameter, "X-mTLS-Client-CN", configuration) // 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 a paginated list of workflow definitions available for execution. * @summary List Workflows * @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} */ listWorkflows: async (pageLimit?: number, pageOffset?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/workflows`; // 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 mTLS required await setApiKeyToObject(localVarHeaderParameter, "X-mTLS-Client-CN", configuration) // 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 the full detail of a workflow including its DOT graph, TOML config, and description. * @summary Retrieve Workflow * @param {string} name URL-safe slug identifying a workflow definition. * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveWorkflow: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'name' is not null or undefined assertParamExists('retrieveWorkflow', 'name', name) const localVarPath = `/workflows/{name}` .replace(`{${"name"}}`, encodeURIComponent(String(name))); // 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 mTLS required await setApiKeyToObject(localVarHeaderParameter, "X-mTLS-Client-CN", configuration) // 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, }; }, } }; /** * WorkflowsApi - functional programming interface */ export const WorkflowsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = WorkflowsApiAxiosParamCreator(configuration) return { /** * Returns a paginated list of runs filtered to a specific workflow. * @summary List Workflow Runs * @param {string} name URL-safe slug identifying a workflow definition. * @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 listWorkflowRuns(name: string, pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listWorkflowRuns(name, pageLimit, pageOffset, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.listWorkflowRuns']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns a paginated list of workflow definitions available for execution. * @summary List Workflows * @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 listWorkflows(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listWorkflows(pageLimit, pageOffset, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.listWorkflows']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns the full detail of a workflow including its DOT graph, TOML config, and description. * @summary Retrieve Workflow * @param {string} name URL-safe slug identifying a workflow definition. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveWorkflow(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveWorkflow(name, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.retrieveWorkflow']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * WorkflowsApi - factory interface */ export const WorkflowsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = WorkflowsApiFp(configuration) return { /** * Returns a paginated list of runs filtered to a specific workflow. * @summary List Workflow Runs * @param {string} name URL-safe slug identifying a workflow definition. * @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} */ listWorkflowRuns(name: string, pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listWorkflowRuns(name, pageLimit, pageOffset, options).then((request) => request(axios, basePath)); }, /** * Returns a paginated list of workflow definitions available for execution. * @summary List Workflows * @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} */ listWorkflows(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listWorkflows(pageLimit, pageOffset, options).then((request) => request(axios, basePath)); }, /** * Returns the full detail of a workflow including its DOT graph, TOML config, and description. * @summary Retrieve Workflow * @param {string} name URL-safe slug identifying a workflow definition. * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveWorkflow(name: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.retrieveWorkflow(name, options).then((request) => request(axios, basePath)); }, }; }; /** * WorkflowsApi - object-oriented interface */ export class WorkflowsApi extends BaseAPI { /** * Returns a paginated list of runs filtered to a specific workflow. * @summary List Workflow Runs * @param {string} name URL-safe slug identifying a workflow definition. * @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 listWorkflowRuns(name: string, pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig) { return WorkflowsApiFp(this.configuration).listWorkflowRuns(name, pageLimit, pageOffset, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a paginated list of workflow definitions available for execution. * @summary List Workflows * @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 listWorkflows(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig) { return WorkflowsApiFp(this.configuration).listWorkflows(pageLimit, pageOffset, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the full detail of a workflow including its DOT graph, TOML config, and description. * @summary Retrieve Workflow * @param {string} name URL-safe slug identifying a workflow definition. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public retrieveWorkflow(name: string, options?: RawAxiosRequestConfig) { return WorkflowsApiFp(this.configuration).retrieveWorkflow(name, options).then((request) => request(this.axios, this.basePath)); } }