/* tslint:disable */
/* eslint-disable */
/**
 * constructor-bpmn-generation-service
 * Сервис генерации BPMN схем и работы с ними
 *
 * The version of the OpenAPI document: 1.0.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 { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance } 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 } from './common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';

/**
 * 
 * @export
 * @interface ImportGenerationParams
 */
export interface ImportGenerationParams {
    /**
     * 
     * @type {string}
     * @memberof ImportGenerationParams
     */
    serviceCode: string;
    /**
     * 
     * @type {string}
     * @memberof ImportGenerationParams
     */
    serviceName: string;
    /**
     * 
     * @type {Array<MappingItem>}
     * @memberof ImportGenerationParams
     */
    mapping: Array<MappingItem>;
    /**
     * 
     * @type {Array<ModelNode>}
     * @memberof ImportGenerationParams
     */
    inputNodes: Array<ModelNode>;
    /**
     * 
     * @type {Array<ModelNode>}
     * @memberof ImportGenerationParams
     */
    nodes: Array<ModelNode>;
}
/**
 * 
 * @export
 * @interface InteragenciesGenerationParams
 */
export interface InteragenciesGenerationParams {
    /**
     * 
     * @type {string}
     * @memberof InteragenciesGenerationParams
     */
    name: string;
    /**
     * 
     * @type {string}
     * @memberof InteragenciesGenerationParams
     */
    interagencyIds: Array<string>;
    /**
     * 
     * @type {Array<MappingItem>}
     * @memberof InteragenciesGenerationParams
     */
    mapping: Array<MappingItem>;
}
/**
 * 
 * @export
 * @interface MappingItem
 */
export interface MappingItem {
    /**
     * 
     * @type {string}
     * @memberof MappingItem
     */
    from: string;
    /**
     * 
     * @type {string}
     * @memberof MappingItem
     */
    to: string;
}
/**
 * 
 * @export
 * @interface ModelNode
 */
export interface ModelNode {
    /**
     * 
     * @type {string}
     * @memberof ModelNode
     */
    code: string;
    /**
     * 
     * @type {Array<ModelNode>}
     * @memberof ModelNode
     */
    children?: Array<ModelNode>;
    /**
     * 
     * @type {{ [key: string]: object; }}
     * @memberof ModelNode
     */
    modelAttr?: { [key: string]: object; };
}
/**
 * 
 * @export
 * @interface StatusResponse
 */
export interface StatusResponse {
    /**
     * 
     * @type {boolean}
     * @memberof StatusResponse
     */
    success?: boolean;
    /**
     * 
     * @type {string}
     * @memberof StatusResponse
     */
    message?: string;
}

/**
 * APIApi - axios parameter creator
 * @export
 */
export const APIApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Возвращает Swagger файл в формате YAML описывающий Rest API в формате Swagger (OpenAPI 3.0.1)
         * @summary Возвращает Swagger/OpenAPI файл
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getApi: async (options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/api`;
            // 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;


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

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

/**
 * APIApi - functional programming interface
 * @export
 */
export const APIApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = APIApiAxiosParamCreator(configuration)
    return {
        /**
         * Возвращает Swagger файл в формате YAML описывающий Rest API в формате Swagger (OpenAPI 3.0.1)
         * @summary Возвращает Swagger/OpenAPI файл
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getApi(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getApi(options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * APIApi - factory interface
 * @export
 */
export const APIApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = APIApiFp(configuration)
    return {
        /**
         * Возвращает Swagger файл в формате YAML описывающий Rest API в формате Swagger (OpenAPI 3.0.1)
         * @summary Возвращает Swagger/OpenAPI файл
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getApi(options?: any): AxiosPromise<void> {
            return localVarFp.getApi(options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * APIApi - object-oriented interface
 * @export
 * @class APIApi
 * @extends {BaseAPI}
 */
export class APIApi extends BaseAPI {
    /**
     * Возвращает Swagger файл в формате YAML описывающий Rest API в формате Swagger (OpenAPI 3.0.1)
     * @summary Возвращает Swagger/OpenAPI файл
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof APIApi
     */
    public getApi(options?: any) {
        return APIApiFp(this.configuration).getApi(options).then((request) => request(this.axios, this.basePath));
    }
}


/**
 * ConstructorBpmnImportGenerationApi - axios parameter creator
 * @export
 */
export const ConstructorBpmnImportGenerationApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Генерирует базовый процесс импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateBaseImportProcess: async (importGenerationParams?: ImportGenerationParams, options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/bpmn/import/base`;
            // 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;


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

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Генерирует кастомный процесс импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateCustomBaseImportProcess: async (importGenerationParams?: ImportGenerationParams, options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/bpmn/import/custom`;
            // 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;


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

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Генерирует процесс маппинга для импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateMappingProcess: async (importGenerationParams?: ImportGenerationParams, options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/bpmn/import/mapping`;
            // 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;


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

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

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

/**
 * ConstructorBpmnImportGenerationApi - functional programming interface
 * @export
 */
export const ConstructorBpmnImportGenerationApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ConstructorBpmnImportGenerationApiAxiosParamCreator(configuration)
    return {
        /**
         * Генерирует базовый процесс импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async generateBaseImportProcess(importGenerationParams?: ImportGenerationParams, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.generateBaseImportProcess(importGenerationParams, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Генерирует кастомный процесс импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async generateCustomBaseImportProcess(importGenerationParams?: ImportGenerationParams, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.generateCustomBaseImportProcess(importGenerationParams, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Генерирует процесс маппинга для импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async generateMappingProcess(importGenerationParams?: ImportGenerationParams, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.generateMappingProcess(importGenerationParams, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * ConstructorBpmnImportGenerationApi - factory interface
 * @export
 */
export const ConstructorBpmnImportGenerationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ConstructorBpmnImportGenerationApiFp(configuration)
    return {
        /**
         * Генерирует базовый процесс импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateBaseImportProcess(importGenerationParams?: ImportGenerationParams, options?: any): AxiosPromise<string> {
            return localVarFp.generateBaseImportProcess(importGenerationParams, options).then((request) => request(axios, basePath));
        },
        /**
         * Генерирует кастомный процесс импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateCustomBaseImportProcess(importGenerationParams?: ImportGenerationParams, options?: any): AxiosPromise<string> {
            return localVarFp.generateCustomBaseImportProcess(importGenerationParams, options).then((request) => request(axios, basePath));
        },
        /**
         * Генерирует процесс маппинга для импорта
         * @param {ImportGenerationParams} [importGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateMappingProcess(importGenerationParams?: ImportGenerationParams, options?: any): AxiosPromise<string> {
            return localVarFp.generateMappingProcess(importGenerationParams, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ConstructorBpmnImportGenerationApi - object-oriented interface
 * @export
 * @class ConstructorBpmnImportGenerationApi
 * @extends {BaseAPI}
 */
export class ConstructorBpmnImportGenerationApi extends BaseAPI {
    /**
     * Генерирует базовый процесс импорта
     * @param {ImportGenerationParams} [importGenerationParams] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConstructorBpmnImportGenerationApi
     */
    public generateBaseImportProcess(importGenerationParams?: ImportGenerationParams, options?: any) {
        return ConstructorBpmnImportGenerationApiFp(this.configuration).generateBaseImportProcess(importGenerationParams, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Генерирует кастомный процесс импорта
     * @param {ImportGenerationParams} [importGenerationParams] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConstructorBpmnImportGenerationApi
     */
    public generateCustomBaseImportProcess(importGenerationParams?: ImportGenerationParams, options?: any) {
        return ConstructorBpmnImportGenerationApiFp(this.configuration).generateCustomBaseImportProcess(importGenerationParams, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Генерирует процесс маппинга для импорта
     * @param {ImportGenerationParams} [importGenerationParams] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConstructorBpmnImportGenerationApi
     */
    public generateMappingProcess(importGenerationParams?: ImportGenerationParams, options?: any) {
        return ConstructorBpmnImportGenerationApiFp(this.configuration).generateMappingProcess(importGenerationParams, options).then((request) => request(this.axios, this.basePath));
    }
}


/**
 * ConstructorBpmnInteragenciesGenerationApi - axios parameter creator
 * @export
 */
export const ConstructorBpmnInteragenciesGenerationApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Генерирует процесс межведомственного взаимодействия с заданными межведами
         * @param {InteragenciesGenerationParams} [interagenciesGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateInteragenciesProcess: async (interagenciesGenerationParams?: InteragenciesGenerationParams, options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/bpmn/interagencies`;
            // 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;


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

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

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

/**
 * ConstructorBpmnInteragenciesGenerationApi - functional programming interface
 * @export
 */
export const ConstructorBpmnInteragenciesGenerationApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ConstructorBpmnInteragenciesGenerationApiAxiosParamCreator(configuration)
    return {
        /**
         * Генерирует процесс межведомственного взаимодействия с заданными межведами
         * @param {InteragenciesGenerationParams} [interagenciesGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async generateInteragenciesProcess(interagenciesGenerationParams?: InteragenciesGenerationParams, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.generateInteragenciesProcess(interagenciesGenerationParams, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * ConstructorBpmnInteragenciesGenerationApi - factory interface
 * @export
 */
export const ConstructorBpmnInteragenciesGenerationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ConstructorBpmnInteragenciesGenerationApiFp(configuration)
    return {
        /**
         * Генерирует процесс межведомственного взаимодействия с заданными межведами
         * @param {InteragenciesGenerationParams} [interagenciesGenerationParams] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateInteragenciesProcess(interagenciesGenerationParams?: InteragenciesGenerationParams, options?: any): AxiosPromise<string> {
            return localVarFp.generateInteragenciesProcess(interagenciesGenerationParams, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ConstructorBpmnInteragenciesGenerationApi - object-oriented interface
 * @export
 * @class ConstructorBpmnInteragenciesGenerationApi
 * @extends {BaseAPI}
 */
export class ConstructorBpmnInteragenciesGenerationApi extends BaseAPI {
    /**
     * Генерирует процесс межведомственного взаимодействия с заданными межведами
     * @param {InteragenciesGenerationParams} [interagenciesGenerationParams] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConstructorBpmnInteragenciesGenerationApi
     */
    public generateInteragenciesProcess(interagenciesGenerationParams?: InteragenciesGenerationParams, options?: any) {
        return ConstructorBpmnInteragenciesGenerationApiFp(this.configuration).generateInteragenciesProcess(interagenciesGenerationParams, options).then((request) => request(this.axios, this.basePath));
    }
}


