// 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';
/**
 * RolesApi - axios parameter creator
 * @export
 */
export const RolesApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {ApiCreateRoleRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRole: (body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body', 'Required parameter body was null or undefined when calling createRole.');
            }
            const localVarPath = `/roles`;
            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;
            }
            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 body !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(body !== undefined ? body : {})
                : body || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @param {string} id DELETE /roles/{id}
         * @param {Array<string>} [ids] POST /roles/delete {\&quot;ids\&quot;}
         * @param {boolean} [permanent] deleteOrMark \&#39;deleted\&#39; ?
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRole: (id, ids, permanent, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id', 'Required parameter id was null or undefined when calling deleteRole.');
            }
            const localVarPath = `/roles/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            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 (ids) {
                localVarQueryParameter['ids'] = ids;
            }
            if (permanent !== undefined) {
                localVarQueryParameter['permanent'] = permanent;
            }
            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} id role.id
         * @param {Array<string>} [fields] select projection  select: output (fields,...)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readRole: (id, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id', 'Required parameter id was null or undefined when calling readRole.');
            }
            const localVarPath = `/roles/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            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} [id] Optional. Unique ID of metadata role owner
         * @param {string} [key] Optional. Partial metadata document key name
         * @param {'NULL_VALUE'} [mergeNullValue] Represents a null value.   - NULL_VALUE: Null value.
         * @param {number} [mergeNumberValue] Represents a double value.
         * @param {string} [mergeStringValue] Represents a string value.
         * @param {boolean} [mergeBoolValue] Represents a boolean value.
         * @param {object} [mergeStructValue] Represents a structured value.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        roleMetadata: (id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/roles/metadata`;
            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 (id !== undefined) {
                localVarQueryParameter['id'] = id;
            }
            if (key !== undefined) {
                localVarQueryParameter['key'] = key;
            }
            if (mergeNullValue !== undefined) {
                localVarQueryParameter['merge.null_value'] = mergeNullValue;
            }
            if (mergeNumberValue !== undefined) {
                localVarQueryParameter['merge.number_value'] = mergeNumberValue;
            }
            if (mergeStringValue !== undefined) {
                localVarQueryParameter['merge.string_value'] = mergeStringValue;
            }
            if (mergeBoolValue !== undefined) {
                localVarQueryParameter['merge.bool_value'] = mergeBoolValue;
            }
            if (mergeStructValue !== undefined) {
                localVarQueryParameter['merge.struct_value'] = mergeStructValue;
            }
            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 {'contacts' | 'cc_list' | 'cc_bucket' | 'calendars' | 'devices' | 'cc_agent' | 'cc_team' | 'cc_resource' | 'cc_resource_group' | 'cc_queue' | 'roles' | 'users' | 'cognitive_profile'} object bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of REQUIRED !
         * @param {string} recordId identifier
         * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
         * @param {string} [name] filter: group name like
         * @param {string} [userId] Object ID
         * @param {string} [userName] Display Name
         * @param {string} [q] filter: term of search (name, description)
         * @param {string} [recordName] display name
         * @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}
         */
        searchRecordAvailableRoles: (object, recordId, ids, name, userId, userName, q, recordName, fields, sort, page, size, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'object' is not null or undefined
            if (object === null || object === undefined) {
                throw new RequiredError('object', 'Required parameter object was null or undefined when calling searchRecordAvailableRoles.');
            }
            // verify required parameter 'recordId' is not null or undefined
            if (recordId === null || recordId === undefined) {
                throw new RequiredError('recordId', 'Required parameter recordId was null or undefined when calling searchRecordAvailableRoles.');
            }
            const localVarPath = `/roles/objects/{object}/records/{record.id}`
                .replace(`{${'object'}}`, encodeURIComponent(String(object)))
                .replace(`{${'record.id'}}`, encodeURIComponent(String(recordId)));
            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 (ids) {
                localVarQueryParameter['ids'] = ids;
            }
            if (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }
            if (userId !== undefined) {
                localVarQueryParameter['user.id'] = userId;
            }
            if (userName !== undefined) {
                localVarQueryParameter['user.name'] = userName;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (recordName !== undefined) {
                localVarQueryParameter['record.name'] = recordName;
            }
            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,
            };
        }),
        /**
         *
         * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
         * @param {string} [name] filter: group name like
         * @param {string} [userId] Object ID
         * @param {string} [userName] Display Name
         * @param {string} [q] filter: term of search (name, description)
         * @param {Array<string>} [fields] bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of 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}
         */
        searchRoles: (ids, name, userId, userName, q, fields, sort, page, size, options = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/roles`;
            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 (ids) {
                localVarQueryParameter['ids'] = ids;
            }
            if (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }
            if (userId !== undefined) {
                localVarQueryParameter['user.id'] = userId;
            }
            if (userName !== undefined) {
                localVarQueryParameter['user.name'] = userName;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            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,
            };
        }),
        /**
         *
         * @param {string} roleId oid
         * @param {ApiRolesUpdateRoleBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRole: (roleId, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'roleId' is not null or undefined
            if (roleId === null || roleId === undefined) {
                throw new RequiredError('roleId', 'Required parameter roleId was null or undefined when calling updateRole.');
            }
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateRole.');
            }
            const localVarPath = `/roles/{role.id}`.replace(`{${'role.id'}}`, encodeURIComponent(String(roleId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, 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;
            }
            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 body !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(body !== undefined ? body : {})
                : body || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @param {string} roleId oid
         * @param {ApiRolesUpdateRoleBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRole2: (roleId, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'roleId' is not null or undefined
            if (roleId === null || roleId === undefined) {
                throw new RequiredError('roleId', 'Required parameter roleId was null or undefined when calling updateRole2.');
            }
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateRole2.');
            }
            const localVarPath = `/roles/{role.id}`.replace(`{${'role.id'}}`, encodeURIComponent(String(roleId)));
            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;
            }
            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 body !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(body !== undefined ? body : {})
                : body || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
    };
};
/**
 * RolesApi - functional programming interface
 * @export
 */
export const RolesApiFp = function (configuration) {
    return {
        /**
         *
         * @param {ApiCreateRoleRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRole(body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).createRole(body, 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} id DELETE /roles/{id}
         * @param {Array<string>} [ids] POST /roles/delete {\&quot;ids\&quot;}
         * @param {boolean} [permanent] deleteOrMark \&#39;deleted\&#39; ?
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRole(id, ids, permanent, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).deleteRole(id, ids, permanent, 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} id role.id
         * @param {Array<string>} [fields] select projection  select: output (fields,...)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readRole(id, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).readRole(id, 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} [id] Optional. Unique ID of metadata role owner
         * @param {string} [key] Optional. Partial metadata document key name
         * @param {'NULL_VALUE'} [mergeNullValue] Represents a null value.   - NULL_VALUE: Null value.
         * @param {number} [mergeNumberValue] Represents a double value.
         * @param {string} [mergeStringValue] Represents a string value.
         * @param {boolean} [mergeBoolValue] Represents a boolean value.
         * @param {object} [mergeStructValue] Represents a structured value.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        roleMetadata(id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).roleMetadata(id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @param {'contacts' | 'cc_list' | 'cc_bucket' | 'calendars' | 'devices' | 'cc_agent' | 'cc_team' | 'cc_resource' | 'cc_resource_group' | 'cc_queue' | 'roles' | 'users' | 'cognitive_profile'} object bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of REQUIRED !
         * @param {string} recordId identifier
         * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
         * @param {string} [name] filter: group name like
         * @param {string} [userId] Object ID
         * @param {string} [userName] Display Name
         * @param {string} [q] filter: term of search (name, description)
         * @param {string} [recordName] display name
         * @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}
         */
        searchRecordAvailableRoles(object, recordId, ids, name, userId, userName, q, recordName, fields, sort, page, size, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).searchRecordAvailableRoles(object, recordId, ids, name, userId, userName, q, recordName, 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);
                };
            });
        },
        /**
         *
         * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
         * @param {string} [name] filter: group name like
         * @param {string} [userId] Object ID
         * @param {string} [userName] Display Name
         * @param {string} [q] filter: term of search (name, description)
         * @param {Array<string>} [fields] bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of 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}
         */
        searchRoles(ids, name, userId, userName, q, fields, sort, page, size, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).searchRoles(ids, name, userId, userName, q, 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);
                };
            });
        },
        /**
         *
         * @param {string} roleId oid
         * @param {ApiRolesUpdateRoleBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRole(roleId, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).updateRole(roleId, body, 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} roleId oid
         * @param {ApiRolesUpdateRoleBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRole2(roleId, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield RolesApiAxiosParamCreator(configuration).updateRole2(roleId, body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * RolesApi - factory interface
 * @export
 */
export const RolesApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {ApiCreateRoleRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRole(body, options) {
            return RolesApiFp(configuration)
                .createRole(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id DELETE /roles/{id}
         * @param {Array<string>} [ids] POST /roles/delete {\&quot;ids\&quot;}
         * @param {boolean} [permanent] deleteOrMark \&#39;deleted\&#39; ?
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRole(id, ids, permanent, options) {
            return RolesApiFp(configuration)
                .deleteRole(id, ids, permanent, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id role.id
         * @param {Array<string>} [fields] select projection  select: output (fields,...)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readRole(id, fields, options) {
            return RolesApiFp(configuration)
                .readRole(id, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} [id] Optional. Unique ID of metadata role owner
         * @param {string} [key] Optional. Partial metadata document key name
         * @param {'NULL_VALUE'} [mergeNullValue] Represents a null value.   - NULL_VALUE: Null value.
         * @param {number} [mergeNumberValue] Represents a double value.
         * @param {string} [mergeStringValue] Represents a string value.
         * @param {boolean} [mergeBoolValue] Represents a boolean value.
         * @param {object} [mergeStructValue] Represents a structured value.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        roleMetadata(id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options) {
            return RolesApiFp(configuration)
                .roleMetadata(id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {'contacts' | 'cc_list' | 'cc_bucket' | 'calendars' | 'devices' | 'cc_agent' | 'cc_team' | 'cc_resource' | 'cc_resource_group' | 'cc_queue' | 'roles' | 'users' | 'cognitive_profile'} object bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of REQUIRED !
         * @param {string} recordId identifier
         * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
         * @param {string} [name] filter: group name like
         * @param {string} [userId] Object ID
         * @param {string} [userName] Display Name
         * @param {string} [q] filter: term of search (name, description)
         * @param {string} [recordName] display name
         * @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}
         */
        searchRecordAvailableRoles(object, recordId, ids, name, userId, userName, q, recordName, fields, sort, page, size, options) {
            return RolesApiFp(configuration)
                .searchRecordAvailableRoles(object, recordId, ids, name, userId, userName, q, recordName, fields, sort, page, size, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
         * @param {string} [name] filter: group name like
         * @param {string} [userId] Object ID
         * @param {string} [userName] Display Name
         * @param {string} [q] filter: term of search (name, description)
         * @param {Array<string>} [fields] bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of 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}
         */
        searchRoles(ids, name, userId, userName, q, fields, sort, page, size, options) {
            return RolesApiFp(configuration)
                .searchRoles(ids, name, userId, userName, q, fields, sort, page, size, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} roleId oid
         * @param {ApiRolesUpdateRoleBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRole(roleId, body, options) {
            return RolesApiFp(configuration)
                .updateRole(roleId, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} roleId oid
         * @param {ApiRolesUpdateRoleBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRole2(roleId, body, options) {
            return RolesApiFp(configuration)
                .updateRole2(roleId, body, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * RolesApi - object-oriented interface
 * @export
 * @class RolesApi
 * @extends {BaseAPI}
 */
export class RolesApi extends BaseAPI {
    /**
     *
     * @param {ApiCreateRoleRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RolesApi
     */
    createRole(body, options) {
        return RolesApiFp(this.configuration)
            .createRole(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id DELETE /roles/{id}
     * @param {Array<string>} [ids] POST /roles/delete {\&quot;ids\&quot;}
     * @param {boolean} [permanent] deleteOrMark \&#39;deleted\&#39; ?
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RolesApi
     */
    deleteRole(id, ids, permanent, options) {
        return RolesApiFp(this.configuration)
            .deleteRole(id, ids, permanent, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id role.id
     * @param {Array<string>} [fields] select projection  select: output (fields,...)
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RolesApi
     */
    readRole(id, fields, options) {
        return RolesApiFp(this.configuration)
            .readRole(id, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} [id] Optional. Unique ID of metadata role owner
     * @param {string} [key] Optional. Partial metadata document key name
     * @param {'NULL_VALUE'} [mergeNullValue] Represents a null value.   - NULL_VALUE: Null value.
     * @param {number} [mergeNumberValue] Represents a double value.
     * @param {string} [mergeStringValue] Represents a string value.
     * @param {boolean} [mergeBoolValue] Represents a boolean value.
     * @param {object} [mergeStructValue] Represents a structured value.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RolesApi
     */
    roleMetadata(id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options) {
        return RolesApiFp(this.configuration)
            .roleMetadata(id, key, mergeNullValue, mergeNumberValue, mergeStringValue, mergeBoolValue, mergeStructValue, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {'contacts' | 'cc_list' | 'cc_bucket' | 'calendars' | 'devices' | 'cc_agent' | 'cc_team' | 'cc_resource' | 'cc_resource_group' | 'cc_queue' | 'roles' | 'users' | 'cognitive_profile'} object bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of REQUIRED !
     * @param {string} recordId identifier
     * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
     * @param {string} [name] filter: group name like
     * @param {string} [userId] Object ID
     * @param {string} [userName] Display Name
     * @param {string} [q] filter: term of search (name, description)
     * @param {string} [recordName] display name
     * @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 RolesApi
     */
    searchRecordAvailableRoles(object, recordId, ids, name, userId, userName, q, recordName, fields, sort, page, size, options) {
        return RolesApiFp(this.configuration)
            .searchRecordAvailableRoles(object, recordId, ids, name, userId, userName, q, recordName, fields, sort, page, size, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {Array<string>} [ids] ----- Role-specific Filters ----------------- //  filter: .id &#x3D; any(:ids...)
     * @param {string} [name] filter: group name like
     * @param {string} [userId] Object ID
     * @param {string} [userName] Display Name
     * @param {string} [q] filter: term of search (name, description)
     * @param {Array<string>} [fields] bool admin &#x3D; 4;  // filter: where CURRENT user is \&#39;ADMIN\&#39; of 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 RolesApi
     */
    searchRoles(ids, name, userId, userName, q, fields, sort, page, size, options) {
        return RolesApiFp(this.configuration)
            .searchRoles(ids, name, userId, userName, q, fields, sort, page, size, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} roleId oid
     * @param {ApiRolesUpdateRoleBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RolesApi
     */
    updateRole(roleId, body, options) {
        return RolesApiFp(this.configuration)
            .updateRole(roleId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} roleId oid
     * @param {ApiRolesUpdateRoleBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RolesApi
     */
    updateRole2(roleId, body, options) {
        return RolesApiFp(this.configuration)
            .updateRole2(roleId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=roles-api.js.map