// tslint:disable
/**
 * Webitel API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 24.04.0
 * Contact: support@webitel.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import { __awaiter } from "tslib";
import * as globalImportUrl from 'url';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, BaseAPI, } from '../base';
/**
 * FeedbackServiceApi - axios parameter creator
 * @export
 */
export const FeedbackServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {string} [key]
         * @param {string} [payloadString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {number} [rating]
         * @param {string} [description]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createFeedback: (key, payloadString, rating, description, options = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/feedback`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (key !== undefined) {
                localVarQueryParameter['key'] = key;
            }
            if (payloadString !== undefined) {
                localVarQueryParameter['payload[string]'] = payloadString;
            }
            if (rating !== undefined) {
                localVarQueryParameter['rating'] = rating;
            }
            if (description !== undefined) {
                localVarQueryParameter['description'] = description;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, localVarUrlObj.query), localVarQueryParameter), options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @param {string} [key]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getFeedback: (key, options = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/feedback`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (key !== undefined) {
                localVarQueryParameter['key'] = key;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, localVarUrlObj.query), localVarQueryParameter), options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
    };
};
/**
 * FeedbackServiceApi - functional programming interface
 * @export
 */
export const FeedbackServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {string} [key]
         * @param {string} [payloadString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {number} [rating]
         * @param {string} [description]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createFeedback(key, payloadString, rating, description, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield FeedbackServiceApiAxiosParamCreator(configuration).createFeedback(key, payloadString, rating, description, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @param {string} [key]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getFeedback(key, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield FeedbackServiceApiAxiosParamCreator(configuration).getFeedback(key, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * FeedbackServiceApi - factory interface
 * @export
 */
export const FeedbackServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {string} [key]
         * @param {string} [payloadString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {number} [rating]
         * @param {string} [description]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createFeedback(key, payloadString, rating, description, options) {
            return FeedbackServiceApiFp(configuration)
                .createFeedback(key, payloadString, rating, description, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} [key]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getFeedback(key, options) {
            return FeedbackServiceApiFp(configuration)
                .getFeedback(key, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * FeedbackServiceApi - object-oriented interface
 * @export
 * @class FeedbackServiceApi
 * @extends {BaseAPI}
 */
export class FeedbackServiceApi extends BaseAPI {
    /**
     *
     * @param {string} [key]
     * @param {string} [payloadString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
     * @param {number} [rating]
     * @param {string} [description]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof FeedbackServiceApi
     */
    createFeedback(key, payloadString, rating, description, options) {
        return FeedbackServiceApiFp(this.configuration)
            .createFeedback(key, payloadString, rating, description, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} [key]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof FeedbackServiceApi
     */
    getFeedback(key, options) {
        return FeedbackServiceApiFp(this.configuration)
            .getFeedback(key, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=feedback-service-api.js.map