// 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';
/**
 * PermissionsApi - axios parameter creator
 * @export
 */
export const PermissionsApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary GetPermissions list available from application
         * @param {string} [q] TermOfSearch
         * @param {Array<string>} [id] &#x3D; ANY(id)
         * @param {Array<string>} [not] &lt;&gt; ANY(not)
         * @param {Array<string>} [fields] controls  output
         * @param {Array<string>} [sort] sort: \&quot;field\&quot; asc; \&quot;!field\&quot; desc
         * @param {number} [page] page number
         * @param {number} [size] page size
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getPermissions: (q, id, not, fields, sort, page, size, options = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/permissions`;
            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 (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (not) {
                localVarQueryParameter['not'] = not;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            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,
            };
        }),
    };
};
/**
 * PermissionsApi - functional programming interface
 * @export
 */
export const PermissionsApiFp = function (configuration) {
    return {
        /**
         *
         * @summary GetPermissions list available from application
         * @param {string} [q] TermOfSearch
         * @param {Array<string>} [id] &#x3D; ANY(id)
         * @param {Array<string>} [not] &lt;&gt; ANY(not)
         * @param {Array<string>} [fields] controls  output
         * @param {Array<string>} [sort] sort: \&quot;field\&quot; asc; \&quot;!field\&quot; desc
         * @param {number} [page] page number
         * @param {number} [size] page size
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getPermissions(q, id, not, fields, sort, page, size, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PermissionsApiAxiosParamCreator(configuration).getPermissions(q, id, not, fields, sort, page, size, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * PermissionsApi - factory interface
 * @export
 */
export const PermissionsApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary GetPermissions list available from application
         * @param {string} [q] TermOfSearch
         * @param {Array<string>} [id] &#x3D; ANY(id)
         * @param {Array<string>} [not] &lt;&gt; ANY(not)
         * @param {Array<string>} [fields] controls  output
         * @param {Array<string>} [sort] sort: \&quot;field\&quot; asc; \&quot;!field\&quot; desc
         * @param {number} [page] page number
         * @param {number} [size] page size
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getPermissions(q, id, not, fields, sort, page, size, options) {
            return PermissionsApiFp(configuration)
                .getPermissions(q, id, not, fields, sort, page, size, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * PermissionsApi - object-oriented interface
 * @export
 * @class PermissionsApi
 * @extends {BaseAPI}
 */
export class PermissionsApi extends BaseAPI {
    /**
     *
     * @summary GetPermissions list available from application
     * @param {string} [q] TermOfSearch
     * @param {Array<string>} [id] &#x3D; ANY(id)
     * @param {Array<string>} [not] &lt;&gt; ANY(not)
     * @param {Array<string>} [fields] controls  output
     * @param {Array<string>} [sort] sort: \&quot;field\&quot; asc; \&quot;!field\&quot; desc
     * @param {number} [page] page number
     * @param {number} [size] page size
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PermissionsApi
     */
    getPermissions(q, id, not, fields, sort, page, size, options) {
        return PermissionsApiFp(this.configuration)
            .getPermissions(q, id, not, fields, sort, page, size, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=permissions-api.js.map