/* tslint:disable */
/* eslint-disable */
/**
 * ERVU services
 * 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 { GenerateExtractRequest } from '../models';
// @ts-ignore
import { GenerateExtractResponseV2 } from '../models';
// @ts-ignore
import { GetExtractResponseV3 } from '../models';
// @ts-ignore
import { GetExtractsV3Request } from '../models';
/**
 * ExtractServiceApi - axios parameter creator
 * @export
 */
export const ExtractServiceApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Запрос на формирование выписки по ИД ЕРН.
         * @summary Запрос на формирование выписки по ИД ЕРН.
         * @param {GenerateExtractRequest} generateExtractRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateExtractV2: async (generateExtractRequest: GenerateExtractRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'generateExtractRequest' is not null or undefined
            assertParamExists('generateExtractV2', 'generateExtractRequest', generateExtractRequest)
            const localVarPath = `/ervu-extract-from-registry-provider/extract/v2/create`;
            // 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(generateExtractRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Запрос на получения выписок по ИД ЕРН.
         * @summary Запрос на получения выписок по ИД ЕРН.
         * @param {GetExtractsV3Request} getExtractsV3Request 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getExtractsV3: async (getExtractsV3Request: GetExtractsV3Request, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'getExtractsV3Request' is not null or undefined
            assertParamExists('getExtractsV3', 'getExtractsV3Request', getExtractsV3Request)
            const localVarPath = `/ervu-extract-from-registry-provider/extract/v3/byIdErn/`;
            // 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(getExtractsV3Request, localVarRequestOptions, configuration)

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

/**
 * ExtractServiceApi - functional programming interface
 * @export
 */
export const ExtractServiceApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ExtractServiceApiAxiosParamCreator(configuration)
    return {
        /**
         * Запрос на формирование выписки по ИД ЕРН.
         * @summary Запрос на формирование выписки по ИД ЕРН.
         * @param {GenerateExtractRequest} generateExtractRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async generateExtractV2(generateExtractRequest: GenerateExtractRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenerateExtractResponseV2>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.generateExtractV2(generateExtractRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Запрос на получения выписок по ИД ЕРН.
         * @summary Запрос на получения выписок по ИД ЕРН.
         * @param {GetExtractsV3Request} getExtractsV3Request 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getExtractsV3(getExtractsV3Request: GetExtractsV3Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetExtractResponseV3>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getExtractsV3(getExtractsV3Request, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * ExtractServiceApi - factory interface
 * @export
 */
export const ExtractServiceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ExtractServiceApiFp(configuration)
    return {
        /**
         * Запрос на формирование выписки по ИД ЕРН.
         * @summary Запрос на формирование выписки по ИД ЕРН.
         * @param {GenerateExtractRequest} generateExtractRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        generateExtractV2(generateExtractRequest: GenerateExtractRequest, options?: any): AxiosPromise<GenerateExtractResponseV2> {
            return localVarFp.generateExtractV2(generateExtractRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Запрос на получения выписок по ИД ЕРН.
         * @summary Запрос на получения выписок по ИД ЕРН.
         * @param {GetExtractsV3Request} getExtractsV3Request 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getExtractsV3(getExtractsV3Request: GetExtractsV3Request, options?: any): AxiosPromise<GetExtractResponseV3> {
            return localVarFp.getExtractsV3(getExtractsV3Request, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ExtractServiceApi - object-oriented interface
 * @export
 * @class ExtractServiceApi
 * @extends {BaseAPI}
 */
export class ExtractServiceApi extends BaseAPI {
    /**
     * Запрос на формирование выписки по ИД ЕРН.
     * @summary Запрос на формирование выписки по ИД ЕРН.
     * @param {GenerateExtractRequest} generateExtractRequest 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ExtractServiceApi
     */
    public generateExtractV2(generateExtractRequest: GenerateExtractRequest, options?: AxiosRequestConfig) {
        return ExtractServiceApiFp(this.configuration).generateExtractV2(generateExtractRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Запрос на получения выписок по ИД ЕРН.
     * @summary Запрос на получения выписок по ИД ЕРН.
     * @param {GetExtractsV3Request} getExtractsV3Request 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ExtractServiceApi
     */
    public getExtractsV3(getExtractsV3Request: GetExtractsV3Request, options?: AxiosRequestConfig) {
        return ExtractServiceApiFp(this.configuration).getExtractsV3(getExtractsV3Request, options).then((request) => request(this.axios, this.basePath));
    }
}
