/* tslint:disable */
/* eslint-disable */
/**
 * nsi 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 { DictionariesElement } from '../models';
/**
 * NsiServiceApi - axios parameter creator
 * @export
 */
export const NsiServiceApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Получение справочника по его коду.
         * @summary Получение справочника по его коду.
         * @param {string} classifierCode 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDictionaryV1: async (classifierCode: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'classifierCode' is not null or undefined
            assertParamExists('getDictionaryV1', 'classifierCode', classifierCode)
            const localVarPath = `/ervu-nsi-service/classifiers/{classifierCode}/records/v1`
                .replace(`{${"classifierCode"}}`, encodeURIComponent(String(classifierCode)));
            // 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);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Получение frontLabels по типу
         * @summary Получение frontLabels по типу
         * @param {string} type 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getFrontLabelsV1: async (type: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'type' is not null or undefined
            assertParamExists('getFrontLabelsV1', 'type', type)
            const localVarPath = `/ervu-nsi-service/frontLabels/type/v1/{type}`
                .replace(`{${"type"}}`, encodeURIComponent(String(type)));
            // 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);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

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

/**
 * NsiServiceApi - functional programming interface
 * @export
 */
export const NsiServiceApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = NsiServiceApiAxiosParamCreator(configuration)
    return {
        /**
         * Получение справочника по его коду.
         * @summary Получение справочника по его коду.
         * @param {string} classifierCode 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getDictionaryV1(classifierCode: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DictionariesElement>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getDictionaryV1(classifierCode, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение frontLabels по типу
         * @summary Получение frontLabels по типу
         * @param {string} type 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getFrontLabelsV1(type: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DictionariesElement>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getFrontLabelsV1(type, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * NsiServiceApi - factory interface
 * @export
 */
export const NsiServiceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = NsiServiceApiFp(configuration)
    return {
        /**
         * Получение справочника по его коду.
         * @summary Получение справочника по его коду.
         * @param {string} classifierCode 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDictionaryV1(classifierCode: string, options?: any): AxiosPromise<Array<DictionariesElement>> {
            return localVarFp.getDictionaryV1(classifierCode, options).then((request) => request(axios, basePath));
        },
        /**
         * Получение frontLabels по типу
         * @summary Получение frontLabels по типу
         * @param {string} type 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getFrontLabelsV1(type: string, options?: any): AxiosPromise<Array<DictionariesElement>> {
            return localVarFp.getFrontLabelsV1(type, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * NsiServiceApi - object-oriented interface
 * @export
 * @class NsiServiceApi
 * @extends {BaseAPI}
 */
export class NsiServiceApi extends BaseAPI {
    /**
     * Получение справочника по его коду.
     * @summary Получение справочника по его коду.
     * @param {string} classifierCode 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NsiServiceApi
     */
    public getDictionaryV1(classifierCode: string, options?: AxiosRequestConfig) {
        return NsiServiceApiFp(this.configuration).getDictionaryV1(classifierCode, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Получение frontLabels по типу
     * @summary Получение frontLabels по типу
     * @param {string} type 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NsiServiceApi
     */
    public getFrontLabelsV1(type: string, options?: AxiosRequestConfig) {
        return NsiServiceApiFp(this.configuration).getFrontLabelsV1(type, options).then((request) => request(this.axios, this.basePath));
    }
}
