/* tslint:disable */
/* eslint-disable */
/**
 * Doc merge service
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: yu.mironov@rtlabs.ru
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// 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';
// @ts-ignore
import { MergeDocumentsRequest } from '../models';
// @ts-ignore
import { MergeDocumentsRequestV2 } from '../models';
// @ts-ignore
import { MergeDocumentsResponse } from '../models';
/**
 * DocumentsMergeServiceApi - axios parameter creator
 * @export
 */
export const DocumentsMergeServiceApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Склеивание документов
         * @summary Склеивание документов
         * @param {MergeDocumentsRequest} mergeDocumentsRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeDocuments: async (mergeDocumentsRequest: MergeDocumentsRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'mergeDocumentsRequest' is not null or undefined
            assertParamExists('mergeDocuments', 'mergeDocumentsRequest', mergeDocumentsRequest)
            const localVarPath = `/ervu-doc-merge-service/v1/merge/test`;
            // 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);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(mergeDocumentsRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Склеивание документов
         * @summary Склеивание документов
         * @param {MergeDocumentsRequestV2} mergeDocumentsRequestV2 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeDocumentsV2: async (mergeDocumentsRequestV2: MergeDocumentsRequestV2, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'mergeDocumentsRequestV2' is not null or undefined
            assertParamExists('mergeDocumentsV2', 'mergeDocumentsRequestV2', mergeDocumentsRequestV2)
            const localVarPath = `/ervu-doc-merge-service/v2/merge`;
            // 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);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(mergeDocumentsRequestV2, localVarRequestOptions, configuration)

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

/**
 * DocumentsMergeServiceApi - functional programming interface
 * @export
 */
export const DocumentsMergeServiceApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = DocumentsMergeServiceApiAxiosParamCreator(configuration)
    return {
        /**
         * Склеивание документов
         * @summary Склеивание документов
         * @param {MergeDocumentsRequest} mergeDocumentsRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async mergeDocuments(mergeDocumentsRequest: MergeDocumentsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MergeDocumentsResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.mergeDocuments(mergeDocumentsRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Склеивание документов
         * @summary Склеивание документов
         * @param {MergeDocumentsRequestV2} mergeDocumentsRequestV2 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async mergeDocumentsV2(mergeDocumentsRequestV2: MergeDocumentsRequestV2, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MergeDocumentsResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.mergeDocumentsV2(mergeDocumentsRequestV2, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * DocumentsMergeServiceApi - factory interface
 * @export
 */
export const DocumentsMergeServiceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = DocumentsMergeServiceApiFp(configuration)
    return {
        /**
         * Склеивание документов
         * @summary Склеивание документов
         * @param {MergeDocumentsRequest} mergeDocumentsRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeDocuments(mergeDocumentsRequest: MergeDocumentsRequest, options?: any): AxiosPromise<MergeDocumentsResponse> {
            return localVarFp.mergeDocuments(mergeDocumentsRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Склеивание документов
         * @summary Склеивание документов
         * @param {MergeDocumentsRequestV2} mergeDocumentsRequestV2 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeDocumentsV2(mergeDocumentsRequestV2: MergeDocumentsRequestV2, options?: any): AxiosPromise<MergeDocumentsResponse> {
            return localVarFp.mergeDocumentsV2(mergeDocumentsRequestV2, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * DocumentsMergeServiceApi - object-oriented interface
 * @export
 * @class DocumentsMergeServiceApi
 * @extends {BaseAPI}
 */
export class DocumentsMergeServiceApi extends BaseAPI {
    /**
     * Склеивание документов
     * @summary Склеивание документов
     * @param {MergeDocumentsRequest} mergeDocumentsRequest 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DocumentsMergeServiceApi
     */
    public mergeDocuments(mergeDocumentsRequest: MergeDocumentsRequest, options?: AxiosRequestConfig) {
        return DocumentsMergeServiceApiFp(this.configuration).mergeDocuments(mergeDocumentsRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Склеивание документов
     * @summary Склеивание документов
     * @param {MergeDocumentsRequestV2} mergeDocumentsRequestV2 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DocumentsMergeServiceApi
     */
    public mergeDocumentsV2(mergeDocumentsRequestV2: MergeDocumentsRequestV2, options?: AxiosRequestConfig) {
        return DocumentsMergeServiceApiFp(this.configuration).mergeDocumentsV2(mergeDocumentsRequestV2, options).then((request) => request(this.axios, this.basePath));
    }
}
