/* tslint:disable */
/* eslint-disable */
/**
 * Decision document service
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: aleksey.topunov@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 { ArchivedRecruitV3 } from '../models';
// @ts-ignore
import { GetArchiveIdByRecruitIdResponseV1 } from '../models';
// @ts-ignore
import { GetArchiveIdByRecruitIdV1Request } from '../models';
// @ts-ignore
import { GetArchiveRequest } from '../models';
// @ts-ignore
import { GetArchiveResponseV1 } from '../models';
/**
 * PersonArchiveApi - axios parameter creator
 * @export
 */
export const PersonArchiveApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Получение идентификатора записи в архиве по id рекрута
         * @summary Получение идентификатора записи в архиве
         * @param {GetArchiveIdByRecruitIdV1Request} getArchiveIdByRecruitIdV1Request 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getArchiveIdByRecruitIdV1: async (getArchiveIdByRecruitIdV1Request: GetArchiveIdByRecruitIdV1Request, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'getArchiveIdByRecruitIdV1Request' is not null or undefined
            assertParamExists('getArchiveIdByRecruitIdV1', 'getArchiveIdByRecruitIdV1Request', getArchiveIdByRecruitIdV1Request)
            const localVarPath = `/ervu-person-archive-service/v1/getId/`;
            // 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(getArchiveIdByRecruitIdV1Request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Получение списка граждан для раздела \"Архив\" (getArchive_V1)
         * @summary Получение списка граждан для раздела \"Архив\"
         * @param {GetArchiveRequest} getArchiveRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getArchiveV1: async (getArchiveRequest: GetArchiveRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'getArchiveRequest' is not null or undefined
            assertParamExists('getArchiveV1', 'getArchiveRequest', getArchiveRequest)
            const localVarPath = `/ervu-person-archive-service/archive/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(getArchiveRequest, localVarRequestOptions, configuration)

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

/**
 * PersonArchiveApi - functional programming interface
 * @export
 */
export const PersonArchiveApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = PersonArchiveApiAxiosParamCreator(configuration)
    return {
        /**
         * Получение идентификатора записи в архиве по id рекрута
         * @summary Получение идентификатора записи в архиве
         * @param {GetArchiveIdByRecruitIdV1Request} getArchiveIdByRecruitIdV1Request 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getArchiveIdByRecruitIdV1(getArchiveIdByRecruitIdV1Request: GetArchiveIdByRecruitIdV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetArchiveIdByRecruitIdResponseV1>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getArchiveIdByRecruitIdV1(getArchiveIdByRecruitIdV1Request, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение списка граждан для раздела \"Архив\" (getArchive_V1)
         * @summary Получение списка граждан для раздела \"Архив\"
         * @param {GetArchiveRequest} getArchiveRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getArchiveV1(getArchiveRequest: GetArchiveRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetArchiveResponseV1>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getArchiveV1(getArchiveRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Получение сведений по одному гражданину в разделе архив
         * @summary Получение сведений по одному гражданину в разделе архив
         * @param {string} id 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getRecruitInfoForArchiveV3(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ArchivedRecruitV3>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getRecruitInfoForArchiveV3(id, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * PersonArchiveApi - factory interface
 * @export
 */
export const PersonArchiveApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = PersonArchiveApiFp(configuration)
    return {
        /**
         * Получение идентификатора записи в архиве по id рекрута
         * @summary Получение идентификатора записи в архиве
         * @param {GetArchiveIdByRecruitIdV1Request} getArchiveIdByRecruitIdV1Request 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getArchiveIdByRecruitIdV1(getArchiveIdByRecruitIdV1Request: GetArchiveIdByRecruitIdV1Request, options?: any): AxiosPromise<GetArchiveIdByRecruitIdResponseV1> {
            return localVarFp.getArchiveIdByRecruitIdV1(getArchiveIdByRecruitIdV1Request, options).then((request) => request(axios, basePath));
        },
        /**
         * Получение списка граждан для раздела \"Архив\" (getArchive_V1)
         * @summary Получение списка граждан для раздела \"Архив\"
         * @param {GetArchiveRequest} getArchiveRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getArchiveV1(getArchiveRequest: GetArchiveRequest, options?: any): AxiosPromise<GetArchiveResponseV1> {
            return localVarFp.getArchiveV1(getArchiveRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Получение сведений по одному гражданину в разделе архив
         * @summary Получение сведений по одному гражданину в разделе архив
         * @param {string} id 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRecruitInfoForArchiveV3(id: string, options?: any): AxiosPromise<ArchivedRecruitV3> {
            return localVarFp.getRecruitInfoForArchiveV3(id, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * PersonArchiveApi - object-oriented interface
 * @export
 * @class PersonArchiveApi
 * @extends {BaseAPI}
 */
export class PersonArchiveApi extends BaseAPI {
    /**
     * Получение идентификатора записи в архиве по id рекрута
     * @summary Получение идентификатора записи в архиве
     * @param {GetArchiveIdByRecruitIdV1Request} getArchiveIdByRecruitIdV1Request 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PersonArchiveApi
     */
    public getArchiveIdByRecruitIdV1(getArchiveIdByRecruitIdV1Request: GetArchiveIdByRecruitIdV1Request, options?: AxiosRequestConfig) {
        return PersonArchiveApiFp(this.configuration).getArchiveIdByRecruitIdV1(getArchiveIdByRecruitIdV1Request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Получение списка граждан для раздела \"Архив\" (getArchive_V1)
     * @summary Получение списка граждан для раздела \"Архив\"
     * @param {GetArchiveRequest} getArchiveRequest 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PersonArchiveApi
     */
    public getArchiveV1(getArchiveRequest: GetArchiveRequest, options?: AxiosRequestConfig) {
        return PersonArchiveApiFp(this.configuration).getArchiveV1(getArchiveRequest, options).then((request) => request(this.axios, this.basePath));
    }

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