/* 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 { DictionariesElement } from '../models';
// @ts-ignore
import { DictionaryItem } from '../models';
// @ts-ignore
import { GetMzRecordsRequestV1 } from '../models';
// @ts-ignore
import { GetMzRecordsResponseV1 } from '../models';
/**
 * ErvuMzMonitorServiceApi - axios parameter creator
 * @export
 */
export const ErvuMzMonitorServiceApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Получение списка ФОИВ
         * @summary Получение списка ФОИВ
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getExternalSystemV1: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/ervu-mz-monitor-service/dictionaries/mz/external-systems/v1`;
            // 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,
            };
        },
        /**
         * Получение справочника наименований ВС
         * @summary Получение справочника наименований ВС
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMvzGroupsDictionary: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/ervu-mz-monitor-service/dictionaries/mvzGroups/v1`;
            // 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,
            };
        },
        /**
         * Получение справочника межведомственных запросов
         * @summary Получение справочника межведомственных запросов
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMzDictionary: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/ervu-mz-monitor-service/getDictionary/type-mz`;
            // 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,
            };
        },
        /**
         * Получение списка межведомственных запросов
         * @summary Получение списка межведомственных запросов
         * @param {GetMzRecordsRequestV1} getMzRecordsRequestV1 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMzRecordsV1: async (getMzRecordsRequestV1: GetMzRecordsRequestV1, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'getMzRecordsRequestV1' is not null or undefined
            assertParamExists('getMzRecordsV1', 'getMzRecordsRequestV1', getMzRecordsRequestV1)
            const localVarPath = `/ervu-mz-monitor-service/records/v1/search`;
            // 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(getMzRecordsRequestV1, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Получение xml файла межведомственного запроса
         * @summary Получение xml файла межведомственного запроса
         * @param {string} mzId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMzXmlV1: async (mzId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'mzId' is not null or undefined
            assertParamExists('getMzXmlV1', 'mzId', mzId)
            const localVarPath = `/ervu-mz-monitor-service/download-xml/v1/{mzId}`
                .replace(`{${"mzId"}}`, encodeURIComponent(String(mzId)));
            // 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,
            };
        },
    }
};

/**
 * ErvuMzMonitorServiceApi - functional programming interface
 * @export
 */
export const ErvuMzMonitorServiceApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ErvuMzMonitorServiceApiAxiosParamCreator(configuration)
    return {
        /**
         * Получение списка ФОИВ
         * @summary Получение списка ФОИВ
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getExternalSystemV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<string>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getExternalSystemV1(options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение справочника наименований ВС
         * @summary Получение справочника наименований ВС
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getMvzGroupsDictionary(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DictionariesElement>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getMvzGroupsDictionary(options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение справочника межведомственных запросов
         * @summary Получение справочника межведомственных запросов
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getMzDictionary(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DictionaryItem>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getMzDictionary(options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение списка межведомственных запросов
         * @summary Получение списка межведомственных запросов
         * @param {GetMzRecordsRequestV1} getMzRecordsRequestV1 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getMzRecordsV1(getMzRecordsRequestV1: GetMzRecordsRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMzRecordsResponseV1>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getMzRecordsV1(getMzRecordsRequestV1, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение xml файла межведомственного запроса
         * @summary Получение xml файла межведомственного запроса
         * @param {string} mzId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getMzXmlV1(mzId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getMzXmlV1(mzId, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * ErvuMzMonitorServiceApi - factory interface
 * @export
 */
export const ErvuMzMonitorServiceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ErvuMzMonitorServiceApiFp(configuration)
    return {
        /**
         * Получение списка ФОИВ
         * @summary Получение списка ФОИВ
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getExternalSystemV1(options?: any): AxiosPromise<Array<string>> {
            return localVarFp.getExternalSystemV1(options).then((request) => request(axios, basePath));
        },
        /**
         * Получение справочника наименований ВС
         * @summary Получение справочника наименований ВС
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMvzGroupsDictionary(options?: any): AxiosPromise<Array<DictionariesElement>> {
            return localVarFp.getMvzGroupsDictionary(options).then((request) => request(axios, basePath));
        },
        /**
         * Получение справочника межведомственных запросов
         * @summary Получение справочника межведомственных запросов
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMzDictionary(options?: any): AxiosPromise<Array<DictionaryItem>> {
            return localVarFp.getMzDictionary(options).then((request) => request(axios, basePath));
        },
        /**
         * Получение списка межведомственных запросов
         * @summary Получение списка межведомственных запросов
         * @param {GetMzRecordsRequestV1} getMzRecordsRequestV1 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMzRecordsV1(getMzRecordsRequestV1: GetMzRecordsRequestV1, options?: any): AxiosPromise<GetMzRecordsResponseV1> {
            return localVarFp.getMzRecordsV1(getMzRecordsRequestV1, options).then((request) => request(axios, basePath));
        },
        /**
         * Получение xml файла межведомственного запроса
         * @summary Получение xml файла межведомственного запроса
         * @param {string} mzId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMzXmlV1(mzId: string, options?: any): AxiosPromise<string> {
            return localVarFp.getMzXmlV1(mzId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ErvuMzMonitorServiceApi - object-oriented interface
 * @export
 * @class ErvuMzMonitorServiceApi
 * @extends {BaseAPI}
 */
export class ErvuMzMonitorServiceApi extends BaseAPI {
    /**
     * Получение списка ФОИВ
     * @summary Получение списка ФОИВ
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ErvuMzMonitorServiceApi
     */
    public getExternalSystemV1(options?: AxiosRequestConfig) {
        return ErvuMzMonitorServiceApiFp(this.configuration).getExternalSystemV1(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Получение справочника наименований ВС
     * @summary Получение справочника наименований ВС
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ErvuMzMonitorServiceApi
     */
    public getMvzGroupsDictionary(options?: AxiosRequestConfig) {
        return ErvuMzMonitorServiceApiFp(this.configuration).getMvzGroupsDictionary(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Получение справочника межведомственных запросов
     * @summary Получение справочника межведомственных запросов
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ErvuMzMonitorServiceApi
     */
    public getMzDictionary(options?: AxiosRequestConfig) {
        return ErvuMzMonitorServiceApiFp(this.configuration).getMzDictionary(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Получение списка межведомственных запросов
     * @summary Получение списка межведомственных запросов
     * @param {GetMzRecordsRequestV1} getMzRecordsRequestV1 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ErvuMzMonitorServiceApi
     */
    public getMzRecordsV1(getMzRecordsRequestV1: GetMzRecordsRequestV1, options?: AxiosRequestConfig) {
        return ErvuMzMonitorServiceApiFp(this.configuration).getMzRecordsV1(getMzRecordsRequestV1, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Получение xml файла межведомственного запроса
     * @summary Получение xml файла межведомственного запроса
     * @param {string} mzId 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ErvuMzMonitorServiceApi
     */
    public getMzXmlV1(mzId: string, options?: AxiosRequestConfig) {
        return ErvuMzMonitorServiceApiFp(this.configuration).getMzXmlV1(mzId, options).then((request) => request(this.axios, this.basePath));
    }
}
