// 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, RequiredError, } from '../base';
/**
 * ArticlesApi - axios parameter creator
 * @export
 */
export const ArticlesApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        articleVersionsList: (spaceId, articleId, page, size, sort, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling articleVersionsList.');
            }
            // verify required parameter 'articleId' is not null or undefined
            if (articleId === null || articleId === undefined) {
                throw new RequiredError('articleId', 'Required parameter articleId was null or undefined when calling articleVersionsList.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{article_id}/history`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'article_id'}}`, encodeURIComponent(String(articleId)));
            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 (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            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} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        articlesAttachmentList: (spaceId, articleId, page, size, sort, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling articlesAttachmentList.');
            }
            // verify required parameter 'articleId' is not null or undefined
            if (articleId === null || articleId === undefined) {
                throw new RequiredError('articleId', 'Required parameter articleId was null or undefined when calling articlesAttachmentList.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{article_id}/attachments`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'article_id'}}`, encodeURIComponent(String(articleId)));
            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 (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            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} spaceId Link space ID.
         * @param {WebitelKnowledgebaseInputArticle} input NEW Update of the Article link.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createArticle: (spaceId, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling createArticle.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling createArticle.');
            }
            const localVarPath = `/spaces/{space_id}/articles`.replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)));
            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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            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);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Remove the space\'s Article association.
         * @param {string} spaceId Space ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteArticle: (spaceId, etag, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling deleteArticle.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling deleteArticle.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{etag}`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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,
            };
        }),
        /**
         *
         * @summary List of the Space\'s Article(s).
         * @param {string} spaceId Space ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {string} [articleId] Record(s) with unique ID only.
         * @param {boolean} [state] Active Article only.
         * @param {Array<string>} [tags] Tags associated with the article.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listArticles: (spaceId, page, size, sort, fields, q, articleId, state, tags, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling listArticles.');
            }
            const localVarPath = `/spaces/{space_id}/articles`.replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)));
            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 (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (articleId !== undefined) {
                localVarQueryParameter['article_id'] = articleId;
            }
            if (state !== undefined) {
                localVarQueryParameter['state'] = state;
            }
            if (tags) {
                localVarQueryParameter['tags'] = tags;
            }
            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,
            };
        }),
        /**
         *
         * @summary List of the Space\'s Article(s).
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @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}
         */
        listArticles2: (spaceId, articleId, page, size, sort, fields, q, state, tags, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling listArticles2.');
            }
            // verify required parameter 'articleId' is not null or undefined
            if (articleId === null || articleId === undefined) {
                throw new RequiredError('articleId', 'Required parameter articleId was null or undefined when calling listArticles2.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{article_id}/childrens`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'article_id'}}`, encodeURIComponent(String(articleId)));
            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 (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (state !== undefined) {
                localVarQueryParameter['state'] = state;
            }
            if (tags) {
                localVarQueryParameter['tags'] = tags;
            }
            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,
            };
        }),
        /**
         *
         * @summary Locate the space\'s Article association.
         * @param {string} spaceId Space ID associated with.
         * @param {string} etag Unique Article link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateArticle: (spaceId, etag, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling locateArticle.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling locateArticle.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{etag}`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {string} versionId The unique ID of version record
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateArticleVersion: (spaceId, articleId, versionId, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling locateArticleVersion.');
            }
            // verify required parameter 'articleId' is not null or undefined
            if (articleId === null || articleId === undefined) {
                throw new RequiredError('articleId', 'Required parameter articleId was null or undefined when calling locateArticleVersion.');
            }
            // verify required parameter 'versionId' is not null or undefined
            if (versionId === null || versionId === undefined) {
                throw new RequiredError('versionId', 'Required parameter versionId was null or undefined when calling locateArticleVersion.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{article_id}/history/{version_id}`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'article_id'}}`, encodeURIComponent(String(articleId)))
                .replace(`{${'version_id'}}`, encodeURIComponent(String(versionId)));
            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;
            }
            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,
            };
        }),
        /**
         *
         * @summary Update the space\'s Article details.
         * @param {string} spaceId Link space ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheArticleLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateArticle: (spaceId, etag, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'spaceId' is not null or undefined
            if (spaceId === null || spaceId === undefined) {
                throw new RequiredError('spaceId', 'Required parameter spaceId was null or undefined when calling updateArticle.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling updateArticle.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling updateArticle.');
            }
            const localVarPath = `/spaces/{space_id}/articles/{etag}`
                .replace(`{${'space_id'}}`, encodeURIComponent(String(spaceId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            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);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
    };
};
/**
 * ArticlesApi - functional programming interface
 * @export
 */
export const ArticlesApiFp = function (configuration) {
    return {
        /**
         *
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        articleVersionsList(spaceId, articleId, page, size, sort, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).articleVersionsList(spaceId, articleId, page, size, sort, 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} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        articlesAttachmentList(spaceId, articleId, page, size, sort, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).articlesAttachmentList(spaceId, articleId, page, size, sort, 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} spaceId Link space ID.
         * @param {WebitelKnowledgebaseInputArticle} input NEW Update of the Article link.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createArticle(spaceId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).createArticle(spaceId, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Remove the space\'s Article association.
         * @param {string} spaceId Space ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteArticle(spaceId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).deleteArticle(spaceId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary List of the Space\'s Article(s).
         * @param {string} spaceId Space ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {string} [articleId] Record(s) with unique ID only.
         * @param {boolean} [state] Active Article only.
         * @param {Array<string>} [tags] Tags associated with the article.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listArticles(spaceId, page, size, sort, fields, q, articleId, state, tags, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).listArticles(spaceId, page, size, sort, fields, q, articleId, state, tags, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary List of the Space\'s Article(s).
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @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}
         */
        listArticles2(spaceId, articleId, page, size, sort, fields, q, state, tags, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).listArticles2(spaceId, articleId, page, size, sort, fields, q, state, tags, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Locate the space\'s Article association.
         * @param {string} spaceId Space ID associated with.
         * @param {string} etag Unique Article link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateArticle(spaceId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).locateArticle(spaceId, etag, fields, 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} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {string} versionId The unique ID of version record
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateArticleVersion(spaceId, articleId, versionId, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).locateArticleVersion(spaceId, articleId, versionId, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Update the space\'s Article details.
         * @param {string} spaceId Link space ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheArticleLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateArticle(spaceId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ArticlesApiAxiosParamCreator(configuration).updateArticle(spaceId, etag, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * ArticlesApi - factory interface
 * @export
 */
export const ArticlesApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        articleVersionsList(spaceId, articleId, page, size, sort, options) {
            return ArticlesApiFp(configuration)
                .articleVersionsList(spaceId, articleId, page, size, sort, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        articlesAttachmentList(spaceId, articleId, page, size, sort, options) {
            return ArticlesApiFp(configuration)
                .articlesAttachmentList(spaceId, articleId, page, size, sort, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} spaceId Link space ID.
         * @param {WebitelKnowledgebaseInputArticle} input NEW Update of the Article link.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createArticle(spaceId, input, fields, options) {
            return ArticlesApiFp(configuration)
                .createArticle(spaceId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Remove the space\'s Article association.
         * @param {string} spaceId Space ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteArticle(spaceId, etag, fields, options) {
            return ArticlesApiFp(configuration)
                .deleteArticle(spaceId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List of the Space\'s Article(s).
         * @param {string} spaceId Space ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {string} [articleId] Record(s) with unique ID only.
         * @param {boolean} [state] Active Article only.
         * @param {Array<string>} [tags] Tags associated with the article.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listArticles(spaceId, page, size, sort, fields, q, articleId, state, tags, options) {
            return ArticlesApiFp(configuration)
                .listArticles(spaceId, page, size, sort, fields, q, articleId, state, tags, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List of the Space\'s Article(s).
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @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}
         */
        listArticles2(spaceId, articleId, page, size, sort, fields, q, state, tags, options) {
            return ArticlesApiFp(configuration)
                .listArticles2(spaceId, articleId, page, size, sort, fields, q, state, tags, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Locate the space\'s Article association.
         * @param {string} spaceId Space ID associated with.
         * @param {string} etag Unique Article link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateArticle(spaceId, etag, fields, options) {
            return ArticlesApiFp(configuration)
                .locateArticle(spaceId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} spaceId Space ID associated with.
         * @param {string} articleId Record(s) with unique ID only.
         * @param {string} versionId The unique ID of version record
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateArticleVersion(spaceId, articleId, versionId, options) {
            return ArticlesApiFp(configuration)
                .locateArticleVersion(spaceId, articleId, versionId, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the space\'s Article details.
         * @param {string} spaceId Link space ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheArticleLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateArticle(spaceId, etag, input, fields, options) {
            return ArticlesApiFp(configuration)
                .updateArticle(spaceId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * ArticlesApi - object-oriented interface
 * @export
 * @class ArticlesApi
 * @extends {BaseAPI}
 */
export class ArticlesApi extends BaseAPI {
    /**
     *
     * @param {string} spaceId Space ID associated with.
     * @param {string} articleId Record(s) with unique ID only.
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    articleVersionsList(spaceId, articleId, page, size, sort, options) {
        return ArticlesApiFp(this.configuration)
            .articleVersionsList(spaceId, articleId, page, size, sort, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} spaceId Space ID associated with.
     * @param {string} articleId Record(s) with unique ID only.
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    articlesAttachmentList(spaceId, articleId, page, size, sort, options) {
        return ArticlesApiFp(this.configuration)
            .articlesAttachmentList(spaceId, articleId, page, size, sort, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} spaceId Link space ID.
     * @param {WebitelKnowledgebaseInputArticle} input NEW Update of the Article link.
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    createArticle(spaceId, input, fields, options) {
        return ArticlesApiFp(this.configuration)
            .createArticle(spaceId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Remove the space\'s Article association.
     * @param {string} spaceId Space ID associated with.
     * @param {string} etag Unique ID to remove.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    deleteArticle(spaceId, etag, fields, options) {
        return ArticlesApiFp(this.configuration)
            .deleteArticle(spaceId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List of the Space\'s Article(s).
     * @param {string} spaceId Space ID associated with.
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {string} [q] Search term: location name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
     * @param {string} [articleId] Record(s) with unique ID only.
     * @param {boolean} [state] Active Article only.
     * @param {Array<string>} [tags] Tags associated with the article.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    listArticles(spaceId, page, size, sort, fields, q, articleId, state, tags, options) {
        return ArticlesApiFp(this.configuration)
            .listArticles(spaceId, page, size, sort, fields, q, articleId, state, tags, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List of the Space\'s Article(s).
     * @param {string} spaceId Space ID associated with.
     * @param {string} articleId Record(s) with unique ID only.
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @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 ArticlesApi
     */
    listArticles2(spaceId, articleId, page, size, sort, fields, q, state, tags, options) {
        return ArticlesApiFp(this.configuration)
            .listArticles2(spaceId, articleId, page, size, sort, fields, q, state, tags, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Locate the space\'s Article association.
     * @param {string} spaceId Space ID associated with.
     * @param {string} etag Unique Article link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
     * @param {Array<string>} [fields] Fields to be retrieved into result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    locateArticle(spaceId, etag, fields, options) {
        return ArticlesApiFp(this.configuration)
            .locateArticle(spaceId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} spaceId Space ID associated with.
     * @param {string} articleId Record(s) with unique ID only.
     * @param {string} versionId The unique ID of version record
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    locateArticleVersion(spaceId, articleId, versionId, options) {
        return ArticlesApiFp(this.configuration)
            .locateArticleVersion(spaceId, articleId, versionId, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the space\'s Article details.
     * @param {string} spaceId Link space ID.
     * @param {string} etag Unique ID of the latest version of an existing resource.
     * @param {NEWUpdateOfTheArticleLink} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ArticlesApi
     */
    updateArticle(spaceId, etag, input, fields, options) {
        return ArticlesApiFp(this.configuration)
            .updateArticle(spaceId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=articles-api.js.map