// tslint:disable
/**
 * Webitel API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 24.04.0
 * Contact: support@webitel.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as globalImportUrl from 'url';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, BaseAPI, } from '../base';
/**
 * ThreadManagementApi - axios parameter creator
 * @export
 */
export const ThreadManagementApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Search threads with filters
         * @param {Array<string>} [fields] List of fields that should be returned in the response. If empty, a default set of fields is returned. Used for response optimization.
         * @param {Array<string>} [ids] Filter by specific thread IDs.
         * @param {Array<'UNKNOWN' | 'DIRECT' | 'GROUP' | 'CHANNEL'>} [kinds] Filter threads by their kinds. UNKNOWN (0) is not allowed.   - UNKNOWN: Unknown or unspecified thread type. Must not be used in valid requests.  - DIRECT: One-to-one private thread between two users.  - GROUP: Group thread with multiple members.  - CHANNEL: Channel-style thread (broadcast or topic based communication).
         * @param {string} [q] Full-text search query. Typically applied to subject.
         * @param {number} [size] Maximum number of threads to return per page. Must be greater than 0 and less than or equal to 100.
         * @param {string} [sort] Sorting field. Optional \&quot;+\&quot; or \&quot;-\&quot; prefix indicates ascending or descending order. Example: \&quot;-created_at\&quot;, \&quot;subject\&quot;
         * @param {number} [page] Page number (1-based).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        threadManagement: async (fields, ids, kinds, q, size, sort, page, options = {}) => {
            const localVarPath = `/v1/threads`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (ids) {
                localVarQueryParameter['ids'] = ids;
            }
            if (kinds) {
                localVarQueryParameter['kinds'] = kinds;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
/**
 * ThreadManagementApi - functional programming interface
 * @export
 */
export const ThreadManagementApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Search threads with filters
         * @param {Array<string>} [fields] List of fields that should be returned in the response. If empty, a default set of fields is returned. Used for response optimization.
         * @param {Array<string>} [ids] Filter by specific thread IDs.
         * @param {Array<'UNKNOWN' | 'DIRECT' | 'GROUP' | 'CHANNEL'>} [kinds] Filter threads by their kinds. UNKNOWN (0) is not allowed.   - UNKNOWN: Unknown or unspecified thread type. Must not be used in valid requests.  - DIRECT: One-to-one private thread between two users.  - GROUP: Group thread with multiple members.  - CHANNEL: Channel-style thread (broadcast or topic based communication).
         * @param {string} [q] Full-text search query. Typically applied to subject.
         * @param {number} [size] Maximum number of threads to return per page. Must be greater than 0 and less than or equal to 100.
         * @param {string} [sort] Sorting field. Optional \&quot;+\&quot; or \&quot;-\&quot; prefix indicates ascending or descending order. Example: \&quot;-created_at\&quot;, \&quot;subject\&quot;
         * @param {number} [page] Page number (1-based).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async threadManagement(fields, ids, kinds, q, size, sort, page, options) {
            const localVarAxiosArgs = await ThreadManagementApiAxiosParamCreator(configuration).threadManagement(fields, ids, kinds, q, size, sort, page, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * ThreadManagementApi - factory interface
 * @export
 */
export const ThreadManagementApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Search threads with filters
         * @param {Array<string>} [fields] List of fields that should be returned in the response. If empty, a default set of fields is returned. Used for response optimization.
         * @param {Array<string>} [ids] Filter by specific thread IDs.
         * @param {Array<'UNKNOWN' | 'DIRECT' | 'GROUP' | 'CHANNEL'>} [kinds] Filter threads by their kinds. UNKNOWN (0) is not allowed.   - UNKNOWN: Unknown or unspecified thread type. Must not be used in valid requests.  - DIRECT: One-to-one private thread between two users.  - GROUP: Group thread with multiple members.  - CHANNEL: Channel-style thread (broadcast or topic based communication).
         * @param {string} [q] Full-text search query. Typically applied to subject.
         * @param {number} [size] Maximum number of threads to return per page. Must be greater than 0 and less than or equal to 100.
         * @param {string} [sort] Sorting field. Optional \&quot;+\&quot; or \&quot;-\&quot; prefix indicates ascending or descending order. Example: \&quot;-created_at\&quot;, \&quot;subject\&quot;
         * @param {number} [page] Page number (1-based).
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        threadManagement(fields, ids, kinds, q, size, sort, page, options) {
            return ThreadManagementApiFp(configuration)
                .threadManagement(fields, ids, kinds, q, size, sort, page, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * ThreadManagementApi - object-oriented interface
 * @export
 * @class ThreadManagementApi
 * @extends {BaseAPI}
 */
export class ThreadManagementApi extends BaseAPI {
    /**
     *
     * @summary Search threads with filters
     * @param {Array<string>} [fields] List of fields that should be returned in the response. If empty, a default set of fields is returned. Used for response optimization.
     * @param {Array<string>} [ids] Filter by specific thread IDs.
     * @param {Array<'UNKNOWN' | 'DIRECT' | 'GROUP' | 'CHANNEL'>} [kinds] Filter threads by their kinds. UNKNOWN (0) is not allowed.   - UNKNOWN: Unknown or unspecified thread type. Must not be used in valid requests.  - DIRECT: One-to-one private thread between two users.  - GROUP: Group thread with multiple members.  - CHANNEL: Channel-style thread (broadcast or topic based communication).
     * @param {string} [q] Full-text search query. Typically applied to subject.
     * @param {number} [size] Maximum number of threads to return per page. Must be greater than 0 and less than or equal to 100.
     * @param {string} [sort] Sorting field. Optional \&quot;+\&quot; or \&quot;-\&quot; prefix indicates ascending or descending order. Example: \&quot;-created_at\&quot;, \&quot;subject\&quot;
     * @param {number} [page] Page number (1-based).
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ThreadManagementApi
     */
    threadManagement(fields, ids, kinds, q, size, sort, page, options) {
        return ThreadManagementApiFp(this.configuration)
            .threadManagement(fields, ids, kinds, q, size, sort, page, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=thread-management-api.js.map