/* tslint:disable */
/* eslint-disable */
/**
 * Appeal 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 { InfringementAppeal } from '../models';
/**
 * AppealDocumentServiceApi - axios parameter creator
 * @export
 */
export const AppealDocumentServiceApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Метод для создания обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для создания обжалования нарушения ФЗ-53 по гражданину
         * @param {InfringementAppeal} infringementAppeal 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRecruitAppeal: async (infringementAppeal: InfringementAppeal, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'infringementAppeal' is not null or undefined
            assertParamExists('createRecruitAppeal', 'infringementAppeal', infringementAppeal)
            const localVarPath = `/ervu-appeal-document-service/v1/appeal`;
            // 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(infringementAppeal, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Метод для удаления обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для удаления обжалования нарушения ФЗ-53 по гражданину
         * @param {string} documentId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRecruitAppeal: async (documentId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'documentId' is not null or undefined
            assertParamExists('deleteRecruitAppeal', 'documentId', documentId)
            const localVarPath = `/ervu-appeal-document-service/v1/appeal/${documentId}`
                .replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
            // 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: 'DELETE', ...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,
            };
        },
        /**
         * Метод для обновления обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для обновления обжалования нарушения ФЗ-53 по гражданину
         * @param {InfringementAppeal} infringementAppeal 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRecruitAppeal: async (infringementAppeal: InfringementAppeal, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'infringementAppeal' is not null or undefined
            assertParamExists('updateRecruitAppeal', 'infringementAppeal', infringementAppeal)
            const localVarPath = `/ervu-appeal-document-service/v1/appeal`;
            // 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: 'PUT', ...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(infringementAppeal, localVarRequestOptions, configuration)

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

/**
 * AppealDocumentServiceApi - functional programming interface
 * @export
 */
export const AppealDocumentServiceApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = AppealDocumentServiceApiAxiosParamCreator(configuration)
    return {
        /**
         * Метод для создания обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для создания обжалования нарушения ФЗ-53 по гражданину
         * @param {InfringementAppeal} infringementAppeal 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createRecruitAppeal(infringementAppeal: InfringementAppeal, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InfringementAppeal>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createRecruitAppeal(infringementAppeal, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Метод для удаления обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для удаления обжалования нарушения ФЗ-53 по гражданину
         * @param {string} documentId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRecruitAppeal(documentId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRecruitAppeal(documentId, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Метод для обновления обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для обновления обжалования нарушения ФЗ-53 по гражданину
         * @param {InfringementAppeal} infringementAppeal 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateRecruitAppeal(infringementAppeal: InfringementAppeal, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InfringementAppeal>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateRecruitAppeal(infringementAppeal, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * AppealDocumentServiceApi - factory interface
 * @export
 */
export const AppealDocumentServiceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = AppealDocumentServiceApiFp(configuration)
    return {
        /**
         * Метод для создания обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для создания обжалования нарушения ФЗ-53 по гражданину
         * @param {InfringementAppeal} infringementAppeal 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRecruitAppeal(infringementAppeal: InfringementAppeal, options?: any): AxiosPromise<InfringementAppeal> {
            return localVarFp.createRecruitAppeal(infringementAppeal, options).then((request) => request(axios, basePath));
        },
        /**
         * Метод для удаления обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для удаления обжалования нарушения ФЗ-53 по гражданину
         * @param {string} documentId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRecruitAppeal(documentId: string, options?: any): AxiosPromise<string> {
            return localVarFp.deleteRecruitAppeal(documentId, options).then((request) => request(axios, basePath));
        },
        /**
         * Метод для обновления обжалования нарушения ФЗ-53 по гражданину
         * @summary Метод для обновления обжалования нарушения ФЗ-53 по гражданину
         * @param {InfringementAppeal} infringementAppeal 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRecruitAppeal(infringementAppeal: InfringementAppeal, options?: any): AxiosPromise<InfringementAppeal> {
            return localVarFp.updateRecruitAppeal(infringementAppeal, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * AppealDocumentServiceApi - object-oriented interface
 * @export
 * @class AppealDocumentServiceApi
 * @extends {BaseAPI}
 */
export class AppealDocumentServiceApi extends BaseAPI {
    /**
     * Метод для создания обжалования нарушения ФЗ-53 по гражданину
     * @summary Метод для создания обжалования нарушения ФЗ-53 по гражданину
     * @param {InfringementAppeal} infringementAppeal 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AppealDocumentServiceApi
     */
    public createRecruitAppeal(infringementAppeal: InfringementAppeal, options?: AxiosRequestConfig) {
        return AppealDocumentServiceApiFp(this.configuration).createRecruitAppeal(infringementAppeal, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Метод для удаления обжалования нарушения ФЗ-53 по гражданину
     * @summary Метод для удаления обжалования нарушения ФЗ-53 по гражданину
     * @param {string} documentId 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AppealDocumentServiceApi
     */
    public deleteRecruitAppeal(documentId: string, options?: AxiosRequestConfig) {
        return AppealDocumentServiceApiFp(this.configuration).deleteRecruitAppeal(documentId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Метод для обновления обжалования нарушения ФЗ-53 по гражданину
     * @summary Метод для обновления обжалования нарушения ФЗ-53 по гражданину
     * @param {InfringementAppeal} infringementAppeal 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AppealDocumentServiceApi
     */
    public updateRecruitAppeal(infringementAppeal: InfringementAppeal, options?: AxiosRequestConfig) {
        return AppealDocumentServiceApiFp(this.configuration).updateRecruitAppeal(infringementAppeal, options).then((request) => request(this.axios, this.basePath));
    }
}
