// 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';
/**
 * CloseReasonsApi - axios parameter creator
 * @export
 */
export const CloseReasonsApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Create a new close reason
         * @param {string} closeReasonGroupId
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCloseReason: (closeReasonGroupId, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'closeReasonGroupId' is not null or undefined
            if (closeReasonGroupId === null || closeReasonGroupId === undefined) {
                throw new RequiredError('closeReasonGroupId', 'Required parameter closeReasonGroupId was null or undefined when calling createCloseReason.');
            }
            // 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 createCloseReason.');
            }
            const localVarPath = `/close_reason_groups/{close_reason_group_id}/close_reasons`.replace(`{${'close_reason_group_id'}}`, encodeURIComponent(String(closeReasonGroupId)));
            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 Delete a close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteCloseReason: (closeReasonGroupId, id, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'closeReasonGroupId' is not null or undefined
            if (closeReasonGroupId === null || closeReasonGroupId === undefined) {
                throw new RequiredError('closeReasonGroupId', 'Required parameter closeReasonGroupId was null or undefined when calling deleteCloseReason.');
            }
            // 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 deleteCloseReason.');
            }
            const localVarPath = `/close_reason_groups/{close_reason_group_id}/close_reasons/{id}`
                .replace(`{${'close_reason_group_id'}}`, encodeURIComponent(String(closeReasonGroupId)))
                .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;
            }
            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 Retrieve a list of close reasons or search close reasons
         * @param {string} closeReasonGroupId Close reason group ID filter
         * @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>} [fields] Fields to be retrieved as a result.
         * @param {string} [sort] Sort the result according to fields.
         * @param {Array<string>} [id]
         * @param {string} [q] Search query string for filtering by name. Supports: - Wildcards (*) for substring matching - Placeholder (?) for single character substitution - Exact match for full names
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listCloseReasons: (closeReasonGroupId, page, size, fields, sort, id, q, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'closeReasonGroupId' is not null or undefined
            if (closeReasonGroupId === null || closeReasonGroupId === undefined) {
                throw new RequiredError('closeReasonGroupId', 'Required parameter closeReasonGroupId was null or undefined when calling listCloseReasons.');
            }
            const localVarPath = `/close_reason_groups/{close_reason_group_id}/close_reasons`.replace(`{${'close_reason_group_id'}}`, encodeURIComponent(String(closeReasonGroupId)));
            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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            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 a close reason by ID
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateCloseReason: (closeReasonGroupId, id, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'closeReasonGroupId' is not null or undefined
            if (closeReasonGroupId === null || closeReasonGroupId === undefined) {
                throw new RequiredError('closeReasonGroupId', 'Required parameter closeReasonGroupId was null or undefined when calling locateCloseReason.');
            }
            // 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 locateCloseReason.');
            }
            const localVarPath = `/close_reason_groups/{close_reason_group_id}/close_reasons/{id}`
                .replace(`{${'close_reason_group_id'}}`, encodeURIComponent(String(closeReasonGroupId)))
                .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,
            };
        }),
        /**
         *
         * @summary Update an existing close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateCloseReason: (closeReasonGroupId, id, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'closeReasonGroupId' is not null or undefined
            if (closeReasonGroupId === null || closeReasonGroupId === undefined) {
                throw new RequiredError('closeReasonGroupId', 'Required parameter closeReasonGroupId was null or undefined when calling updateCloseReason.');
            }
            // 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 updateCloseReason.');
            }
            // 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 updateCloseReason.');
            }
            const localVarPath = `/close_reason_groups/{close_reason_group_id}/close_reasons/{id}`
                .replace(`{${'close_reason_group_id'}}`, encodeURIComponent(String(closeReasonGroupId)))
                .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: '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;
            }
            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 Update an existing close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateCloseReason2: (closeReasonGroupId, id, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'closeReasonGroupId' is not null or undefined
            if (closeReasonGroupId === null || closeReasonGroupId === undefined) {
                throw new RequiredError('closeReasonGroupId', 'Required parameter closeReasonGroupId was null or undefined when calling updateCloseReason2.');
            }
            // 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 updateCloseReason2.');
            }
            // 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 updateCloseReason2.');
            }
            const localVarPath = `/close_reason_groups/{close_reason_group_id}/close_reasons/{id}`
                .replace(`{${'close_reason_group_id'}}`, encodeURIComponent(String(closeReasonGroupId)))
                .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: '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,
            };
        }),
    };
};
/**
 * CloseReasonsApi - functional programming interface
 * @export
 */
export const CloseReasonsApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Create a new close reason
         * @param {string} closeReasonGroupId
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCloseReason(closeReasonGroupId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield CloseReasonsApiAxiosParamCreator(configuration).createCloseReason(closeReasonGroupId, 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 Delete a close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteCloseReason(closeReasonGroupId, id, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield CloseReasonsApiAxiosParamCreator(configuration).deleteCloseReason(closeReasonGroupId, id, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Retrieve a list of close reasons or search close reasons
         * @param {string} closeReasonGroupId Close reason group ID filter
         * @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>} [fields] Fields to be retrieved as a result.
         * @param {string} [sort] Sort the result according to fields.
         * @param {Array<string>} [id]
         * @param {string} [q] Search query string for filtering by name. Supports: - Wildcards (*) for substring matching - Placeholder (?) for single character substitution - Exact match for full names
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listCloseReasons(closeReasonGroupId, page, size, fields, sort, id, q, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield CloseReasonsApiAxiosParamCreator(configuration).listCloseReasons(closeReasonGroupId, page, size, fields, sort, id, q, 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 a close reason by ID
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateCloseReason(closeReasonGroupId, id, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield CloseReasonsApiAxiosParamCreator(configuration).locateCloseReason(closeReasonGroupId, 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);
                };
            });
        },
        /**
         *
         * @summary Update an existing close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateCloseReason(closeReasonGroupId, id, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield CloseReasonsApiAxiosParamCreator(configuration).updateCloseReason(closeReasonGroupId, id, 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 Update an existing close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateCloseReason2(closeReasonGroupId, id, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield CloseReasonsApiAxiosParamCreator(configuration).updateCloseReason2(closeReasonGroupId, id, 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);
                };
            });
        },
    };
};
/**
 * CloseReasonsApi - factory interface
 * @export
 */
export const CloseReasonsApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Create a new close reason
         * @param {string} closeReasonGroupId
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCloseReason(closeReasonGroupId, input, fields, options) {
            return CloseReasonsApiFp(configuration)
                .createCloseReason(closeReasonGroupId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Delete a close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteCloseReason(closeReasonGroupId, id, options) {
            return CloseReasonsApiFp(configuration)
                .deleteCloseReason(closeReasonGroupId, id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Retrieve a list of close reasons or search close reasons
         * @param {string} closeReasonGroupId Close reason group ID filter
         * @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>} [fields] Fields to be retrieved as a result.
         * @param {string} [sort] Sort the result according to fields.
         * @param {Array<string>} [id]
         * @param {string} [q] Search query string for filtering by name. Supports: - Wildcards (*) for substring matching - Placeholder (?) for single character substitution - Exact match for full names
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listCloseReasons(closeReasonGroupId, page, size, fields, sort, id, q, options) {
            return CloseReasonsApiFp(configuration)
                .listCloseReasons(closeReasonGroupId, page, size, fields, sort, id, q, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Locate a close reason by ID
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateCloseReason(closeReasonGroupId, id, fields, options) {
            return CloseReasonsApiFp(configuration)
                .locateCloseReason(closeReasonGroupId, id, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update an existing close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateCloseReason(closeReasonGroupId, id, input, fields, options) {
            return CloseReasonsApiFp(configuration)
                .updateCloseReason(closeReasonGroupId, id, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update an existing close reason
         * @param {string} closeReasonGroupId
         * @param {string} id
         * @param {WebitelCasesInputCloseReason} input
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateCloseReason2(closeReasonGroupId, id, input, fields, options) {
            return CloseReasonsApiFp(configuration)
                .updateCloseReason2(closeReasonGroupId, id, input, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * CloseReasonsApi - object-oriented interface
 * @export
 * @class CloseReasonsApi
 * @extends {BaseAPI}
 */
export class CloseReasonsApi extends BaseAPI {
    /**
     *
     * @summary Create a new close reason
     * @param {string} closeReasonGroupId
     * @param {WebitelCasesInputCloseReason} input
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof CloseReasonsApi
     */
    createCloseReason(closeReasonGroupId, input, fields, options) {
        return CloseReasonsApiFp(this.configuration)
            .createCloseReason(closeReasonGroupId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Delete a close reason
     * @param {string} closeReasonGroupId
     * @param {string} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof CloseReasonsApi
     */
    deleteCloseReason(closeReasonGroupId, id, options) {
        return CloseReasonsApiFp(this.configuration)
            .deleteCloseReason(closeReasonGroupId, id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Retrieve a list of close reasons or search close reasons
     * @param {string} closeReasonGroupId Close reason group ID filter
     * @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>} [fields] Fields to be retrieved as a result.
     * @param {string} [sort] Sort the result according to fields.
     * @param {Array<string>} [id]
     * @param {string} [q] Search query string for filtering by name. Supports: - Wildcards (*) for substring matching - Placeholder (?) for single character substitution - Exact match for full names
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof CloseReasonsApi
     */
    listCloseReasons(closeReasonGroupId, page, size, fields, sort, id, q, options) {
        return CloseReasonsApiFp(this.configuration)
            .listCloseReasons(closeReasonGroupId, page, size, fields, sort, id, q, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Locate a close reason by ID
     * @param {string} closeReasonGroupId
     * @param {string} id
     * @param {Array<string>} [fields]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof CloseReasonsApi
     */
    locateCloseReason(closeReasonGroupId, id, fields, options) {
        return CloseReasonsApiFp(this.configuration)
            .locateCloseReason(closeReasonGroupId, id, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update an existing close reason
     * @param {string} closeReasonGroupId
     * @param {string} id
     * @param {WebitelCasesInputCloseReason} input
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof CloseReasonsApi
     */
    updateCloseReason(closeReasonGroupId, id, input, fields, options) {
        return CloseReasonsApiFp(this.configuration)
            .updateCloseReason(closeReasonGroupId, id, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update an existing close reason
     * @param {string} closeReasonGroupId
     * @param {string} id
     * @param {WebitelCasesInputCloseReason} input
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof CloseReasonsApi
     */
    updateCloseReason2(closeReasonGroupId, id, input, fields, options) {
        return CloseReasonsApiFp(this.configuration)
            .updateCloseReason2(closeReasonGroupId, id, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=close-reasons-api.js.map