/* 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 { Automation } from '../models';
// @ts-ignore
import type { AutomationListResponse } from '../models';
// @ts-ignore
import type { CreateAutomationRequest } from '../models';
// @ts-ignore
import type { ErrorResponse } from '../models';
// @ts-ignore
import type { PaginatedRunList } from '../models';
// @ts-ignore
import type { ReplaceAutomationRequest } from '../models';
// @ts-ignore
import type { Run } from '../models';
/**
 * AutomationsApi - axios parameter creator
 */
export const AutomationsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Creates a new automation definition.
         * @summary Create automation
         * @param {CreateAutomationRequest} createAutomationRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAutomation: async (createAutomationRequest: CreateAutomationRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'createAutomationRequest' is not null or undefined
            assertParamExists('createAutomation', 'createAutomationRequest', createAutomationRequest)
            const localVarPath = `/api/v1/automations`;
            // 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(createAutomationRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a new run by firing the automation\'s enabled API trigger.
         * @summary Create automation run
         * @param {string} id Unique automation identifier.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAutomationRun: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('createAutomationRun', 'id', id)
            const localVarPath = `/api/v1/automations/{id}/runs`
                .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,
            };
        },
        /**
         * Deletes an automation definition when `If-Match` matches the current automation revision.
         * @summary Delete automation
         * @param {string} id Unique automation identifier.
         * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAutomation: async (id: string, ifMatch: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteAutomation', 'id', id)
            // verify required parameter 'ifMatch' is not null or undefined
            assertParamExists('deleteAutomation', 'ifMatch', ifMatch)
            const localVarPath = `/api/v1/automations/{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';

            if (ifMatch != null) {
                localVarHeaderParameter['If-Match'] = String(ifMatch);
            }
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns durable runs created by one automation.
         * @summary List automation runs
         * @param {string} id Unique automation identifier.
         * @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}
         */
        listAutomationRuns: async (id: string, pageLimit?: number, pageOffset?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listAutomationRuns', 'id', id)
            const localVarPath = `/api/v1/automations/{id}/runs`
                .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 (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 all configured automation definitions.
         * @summary List automations
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAutomations: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/v1/automations`;
            // 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,
            };
        },
        /**
         * Replaces an automation definition when `If-Match` matches the current automation revision.
         * @summary Replace automation
         * @param {string} id Unique automation identifier.
         * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
         * @param {ReplaceAutomationRequest} replaceAutomationRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        replaceAutomation: async (id: string, ifMatch: string, replaceAutomationRequest: ReplaceAutomationRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('replaceAutomation', 'id', id)
            // verify required parameter 'ifMatch' is not null or undefined
            assertParamExists('replaceAutomation', 'ifMatch', ifMatch)
            // verify required parameter 'replaceAutomationRequest' is not null or undefined
            assertParamExists('replaceAutomation', 'replaceAutomationRequest', replaceAutomationRequest)
            const localVarPath = `/api/v1/automations/{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: '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';

            if (ifMatch != null) {
                localVarHeaderParameter['If-Match'] = String(ifMatch);
            }
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(replaceAutomationRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns one automation definition by id.
         * @summary Retrieve automation
         * @param {string} id Unique automation identifier.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveAutomation: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveAutomation', 'id', id)
            const localVarPath = `/api/v1/automations/{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,
            };
        },
    }
};

/**
 * AutomationsApi - functional programming interface
 */
export const AutomationsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = AutomationsApiAxiosParamCreator(configuration)
    return {
        /**
         * Creates a new automation definition.
         * @summary Create automation
         * @param {CreateAutomationRequest} createAutomationRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createAutomation(createAutomationRequest: CreateAutomationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Automation>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createAutomation(createAutomationRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.createAutomation']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a new run by firing the automation\'s enabled API trigger.
         * @summary Create automation run
         * @param {string} id Unique automation identifier.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createAutomationRun(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Run>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createAutomationRun(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.createAutomationRun']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Deletes an automation definition when `If-Match` matches the current automation revision.
         * @summary Delete automation
         * @param {string} id Unique automation identifier.
         * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteAutomation(id: string, ifMatch: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAutomation(id, ifMatch, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.deleteAutomation']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns durable runs created by one automation.
         * @summary List automation runs
         * @param {string} id Unique automation identifier.
         * @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 listAutomationRuns(id: string, pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedRunList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listAutomationRuns(id, pageLimit, pageOffset, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.listAutomationRuns']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns all configured automation definitions.
         * @summary List automations
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listAutomations(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AutomationListResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listAutomations(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.listAutomations']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Replaces an automation definition when `If-Match` matches the current automation revision.
         * @summary Replace automation
         * @param {string} id Unique automation identifier.
         * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
         * @param {ReplaceAutomationRequest} replaceAutomationRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async replaceAutomation(id: string, ifMatch: string, replaceAutomationRequest: ReplaceAutomationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Automation>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.replaceAutomation(id, ifMatch, replaceAutomationRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.replaceAutomation']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns one automation definition by id.
         * @summary Retrieve automation
         * @param {string} id Unique automation identifier.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveAutomation(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Automation>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAutomation(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AutomationsApi.retrieveAutomation']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * AutomationsApi - factory interface
 */
export const AutomationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = AutomationsApiFp(configuration)
    return {
        /**
         * Creates a new automation definition.
         * @summary Create automation
         * @param {CreateAutomationRequest} createAutomationRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAutomation(createAutomationRequest: CreateAutomationRequest, options?: RawAxiosRequestConfig): AxiosPromise<Automation> {
            return localVarFp.createAutomation(createAutomationRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a new run by firing the automation\'s enabled API trigger.
         * @summary Create automation run
         * @param {string} id Unique automation identifier.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAutomationRun(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Run> {
            return localVarFp.createAutomationRun(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Deletes an automation definition when `If-Match` matches the current automation revision.
         * @summary Delete automation
         * @param {string} id Unique automation identifier.
         * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAutomation(id: string, ifMatch: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteAutomation(id, ifMatch, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns durable runs created by one automation.
         * @summary List automation runs
         * @param {string} id Unique automation identifier.
         * @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}
         */
        listAutomationRuns(id: string, pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): AxiosPromise<PaginatedRunList> {
            return localVarFp.listAutomationRuns(id, pageLimit, pageOffset, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns all configured automation definitions.
         * @summary List automations
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAutomations(options?: RawAxiosRequestConfig): AxiosPromise<AutomationListResponse> {
            return localVarFp.listAutomations(options).then((request) => request(axios, basePath));
        },
        /**
         * Replaces an automation definition when `If-Match` matches the current automation revision.
         * @summary Replace automation
         * @param {string} id Unique automation identifier.
         * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
         * @param {ReplaceAutomationRequest} replaceAutomationRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        replaceAutomation(id: string, ifMatch: string, replaceAutomationRequest: ReplaceAutomationRequest, options?: RawAxiosRequestConfig): AxiosPromise<Automation> {
            return localVarFp.replaceAutomation(id, ifMatch, replaceAutomationRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns one automation definition by id.
         * @summary Retrieve automation
         * @param {string} id Unique automation identifier.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveAutomation(id: string, options?: RawAxiosRequestConfig): AxiosPromise<Automation> {
            return localVarFp.retrieveAutomation(id, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * AutomationsApi - object-oriented interface
 */
export class AutomationsApi extends BaseAPI {
    /**
     * Creates a new automation definition.
     * @summary Create automation
     * @param {CreateAutomationRequest} createAutomationRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createAutomation(createAutomationRequest: CreateAutomationRequest, options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).createAutomation(createAutomationRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a new run by firing the automation\'s enabled API trigger.
     * @summary Create automation run
     * @param {string} id Unique automation identifier.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createAutomationRun(id: string, options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).createAutomationRun(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Deletes an automation definition when `If-Match` matches the current automation revision.
     * @summary Delete automation
     * @param {string} id Unique automation identifier.
     * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteAutomation(id: string, ifMatch: string, options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).deleteAutomation(id, ifMatch, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns durable runs created by one automation.
     * @summary List automation runs
     * @param {string} id Unique automation identifier.
     * @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 listAutomationRuns(id: string, pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).listAutomationRuns(id, pageLimit, pageOffset, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns all configured automation definitions.
     * @summary List automations
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listAutomations(options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).listAutomations(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Replaces an automation definition when `If-Match` matches the current automation revision.
     * @summary Replace automation
     * @param {string} id Unique automation identifier.
     * @param {string} ifMatch Current resource revision used for optimistic concurrency, as returned in the &#x60;ETag&#x60; response header.
     * @param {ReplaceAutomationRequest} replaceAutomationRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public replaceAutomation(id: string, ifMatch: string, replaceAutomationRequest: ReplaceAutomationRequest, options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).replaceAutomation(id, ifMatch, replaceAutomationRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns one automation definition by id.
     * @summary Retrieve automation
     * @param {string} id Unique automation identifier.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveAutomation(id: string, options?: RawAxiosRequestConfig) {
        return AutomationsApiFp(this.configuration).retrieveAutomation(id, options).then((request) => request(this.axios, this.basePath));
    }
}
