// 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 * as globalImportUrl from 'url';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, BaseAPI, } from '../base';
/**
 * KnowledgebaseSearchApi - axios parameter creator
 * @export
 */
export const KnowledgebaseSearchApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {boolean} [state] Active Article only.
         * @param {Array<string>} [tags] Tags associated with the article.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        spacesArticlesSearch: async (size, page, sort, q, state, tags, options = {}) => {
            const localVarPath = `/spaces/search`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (state !== undefined) {
                localVarQueryParameter['state'] = state;
            }
            if (tags) {
                localVarQueryParameter['tags'] = tags;
            }
            localVarUrlObj.query = {
                ...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 = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
/**
 * KnowledgebaseSearchApi - functional programming interface
 * @export
 */
export const KnowledgebaseSearchApiFp = function (configuration) {
    return {
        /**
         *
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {boolean} [state] Active Article only.
         * @param {Array<string>} [tags] Tags associated with the article.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async spacesArticlesSearch(size, page, sort, q, state, tags, options) {
            const localVarAxiosArgs = await KnowledgebaseSearchApiAxiosParamCreator(configuration).spacesArticlesSearch(size, page, sort, q, state, tags, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * KnowledgebaseSearchApi - factory interface
 * @export
 */
export const KnowledgebaseSearchApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {boolean} [state] Active Article only.
         * @param {Array<string>} [tags] Tags associated with the article.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        spacesArticlesSearch(size, page, sort, q, state, tags, options) {
            return KnowledgebaseSearchApiFp(configuration)
                .spacesArticlesSearch(size, page, sort, q, state, tags, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * KnowledgebaseSearchApi - object-oriented interface
 * @export
 * @class KnowledgebaseSearchApi
 * @extends {BaseAPI}
 */
export class KnowledgebaseSearchApi extends BaseAPI {
    /**
     *
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
     * @param {boolean} [state] Active Article only.
     * @param {Array<string>} [tags] Tags associated with the article.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgebaseSearchApi
     */
    spacesArticlesSearch(size, page, sort, q, state, tags, options) {
        return KnowledgebaseSearchApiFp(this.configuration)
            .spacesArticlesSearch(size, page, sort, q, state, tags, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=knowledgebase-search-api.js.map