// 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, RequiredError, } from '../base';
/**
 * TypesApi - axios parameter creator
 * @export
 */
export const TypesApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Structured data type details.
         * @param {string} path &#x60;types.path&#x60;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locate: async (path, options = {}) => {
            // verify required parameter 'path' is not null or undefined
            if (path === null || path === undefined) {
                throw new RequiredError('path', 'Required parameter path was null or undefined when calling locate.');
            }
            const localVarPath = `/types/{path}`.replace(`{${'path'}}`, encodeURIComponent(String(path)));
            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;
            }
            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,
            };
        },
        /**
         *
         * @summary Lookup data types registry.
         * @param {string} [q] Search term: &#x60;?&#x60; - matches any character &#x60;*&#x60; - matches 0 or more characters e.g.: name,emails{type},labels etc...
         * @param {string} [id] &#x60;types.id&#x60;
         * @param {string} [name] &#x60;types.name&#x60;
         * @param {string} [repo] &#x60;types.repo&#x60;
         * @param {string} [path] &#x60;types.path&#x60;
         * @param {boolean} [readonly] [NOT] [ system / custom ] types only
         * @param {boolean} [extendable] [NOT] Extend[able] types only.
         * @param {boolean} [extensions] [NOT] include extensions/_* types.
         * @param {boolean} [extended] [NOT] Extend[ed] types only.
         * @param {boolean} [administered] [NOT] Administer access control only
         * @param {number} [size] Number of result records (per page). Default: 16.
         * @param {number} [page] Page number of result set of records. Default: 1.
         * @param {Array<string>} [sort] Sort result dataset of records by fields. &#x60;&#x60;&#x60; sort ::&#x3D; *( ORDER name )  ORDER  &#x3D; ASC / DESC DESC   &#x3D; \&quot;-\&quot; / \&quot;!\&quot; ASC    &#x3D; [ \&quot;+\&quot; ]   ; Default &#x60;&#x60;&#x60;  Fields available  - &#x60;id&#x60;(seq) - &#x60;domain&#x60;{name} - &#x60;created_at&#x60; - &#x60;created_by&#x60;{name} - &#x60;updated_at&#x60; - &#x60;updated_by&#x60;{name}  Use ?fields&#x3D;&#x60;field.sort()&#x60; option to sort Edge fields.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record. &#x60;&#x60;&#x60; fields ::&#x3D; field [ *( \&quot;,\&quot; field ) ] field  ::&#x3D; name [ *( func ) ] [ inner ] inner  ::&#x3D; \&quot;{\&quot; fields \&quot;}\&quot; funcs  ::&#x3D; *( func ) func   ::&#x3D; \&quot;.\&quot; name \&quot;(\&quot; [ args ] \&quot;)\&quot; name   ::&#x3D; ALPHA / DIGIT / USCORE  ALPHA    &#x3D; %x41-5A / %x61-7A  ; \&quot;A\&quot;-\&quot;Z\&quot; / \&quot;a\&quot;-\&quot;z\&quot; DIGIT    &#x3D; %x30-39            ; \&quot;0\&quot;-\&quot;9\&quot; USCORE   &#x3D; %x5F ; underscore  ; \&quot;_\&quot; &#x60;&#x60;&#x60;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        search: async (q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options = {}) => {
            const localVarPath = `/types`;
            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 (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (id !== undefined) {
                localVarQueryParameter['id'] = id;
            }
            if (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }
            if (repo !== undefined) {
                localVarQueryParameter['repo'] = repo;
            }
            if (path !== undefined) {
                localVarQueryParameter['path'] = path;
            }
            if (readonly !== undefined) {
                localVarQueryParameter['readonly'] = readonly;
            }
            if (extendable !== undefined) {
                localVarQueryParameter['extendable'] = extendable;
            }
            if (extensions !== undefined) {
                localVarQueryParameter['extensions'] = extensions;
            }
            if (extended !== undefined) {
                localVarQueryParameter['extended'] = extended;
            }
            if (administered !== undefined) {
                localVarQueryParameter['administered'] = administered;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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,
            };
        },
    };
};
/**
 * TypesApi - functional programming interface
 * @export
 */
export const TypesApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Structured data type details.
         * @param {string} path &#x60;types.path&#x60;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async locate(path, options) {
            const localVarAxiosArgs = await TypesApiAxiosParamCreator(configuration).locate(path, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Lookup data types registry.
         * @param {string} [q] Search term: &#x60;?&#x60; - matches any character &#x60;*&#x60; - matches 0 or more characters e.g.: name,emails{type},labels etc...
         * @param {string} [id] &#x60;types.id&#x60;
         * @param {string} [name] &#x60;types.name&#x60;
         * @param {string} [repo] &#x60;types.repo&#x60;
         * @param {string} [path] &#x60;types.path&#x60;
         * @param {boolean} [readonly] [NOT] [ system / custom ] types only
         * @param {boolean} [extendable] [NOT] Extend[able] types only.
         * @param {boolean} [extensions] [NOT] include extensions/_* types.
         * @param {boolean} [extended] [NOT] Extend[ed] types only.
         * @param {boolean} [administered] [NOT] Administer access control only
         * @param {number} [size] Number of result records (per page). Default: 16.
         * @param {number} [page] Page number of result set of records. Default: 1.
         * @param {Array<string>} [sort] Sort result dataset of records by fields. &#x60;&#x60;&#x60; sort ::&#x3D; *( ORDER name )  ORDER  &#x3D; ASC / DESC DESC   &#x3D; \&quot;-\&quot; / \&quot;!\&quot; ASC    &#x3D; [ \&quot;+\&quot; ]   ; Default &#x60;&#x60;&#x60;  Fields available  - &#x60;id&#x60;(seq) - &#x60;domain&#x60;{name} - &#x60;created_at&#x60; - &#x60;created_by&#x60;{name} - &#x60;updated_at&#x60; - &#x60;updated_by&#x60;{name}  Use ?fields&#x3D;&#x60;field.sort()&#x60; option to sort Edge fields.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record. &#x60;&#x60;&#x60; fields ::&#x3D; field [ *( \&quot;,\&quot; field ) ] field  ::&#x3D; name [ *( func ) ] [ inner ] inner  ::&#x3D; \&quot;{\&quot; fields \&quot;}\&quot; funcs  ::&#x3D; *( func ) func   ::&#x3D; \&quot;.\&quot; name \&quot;(\&quot; [ args ] \&quot;)\&quot; name   ::&#x3D; ALPHA / DIGIT / USCORE  ALPHA    &#x3D; %x41-5A / %x61-7A  ; \&quot;A\&quot;-\&quot;Z\&quot; / \&quot;a\&quot;-\&quot;z\&quot; DIGIT    &#x3D; %x30-39            ; \&quot;0\&quot;-\&quot;9\&quot; USCORE   &#x3D; %x5F ; underscore  ; \&quot;_\&quot; &#x60;&#x60;&#x60;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async search(q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options) {
            const localVarAxiosArgs = await TypesApiAxiosParamCreator(configuration).search(q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * TypesApi - factory interface
 * @export
 */
export const TypesApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Structured data type details.
         * @param {string} path &#x60;types.path&#x60;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locate(path, options) {
            return TypesApiFp(configuration)
                .locate(path, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Lookup data types registry.
         * @param {string} [q] Search term: &#x60;?&#x60; - matches any character &#x60;*&#x60; - matches 0 or more characters e.g.: name,emails{type},labels etc...
         * @param {string} [id] &#x60;types.id&#x60;
         * @param {string} [name] &#x60;types.name&#x60;
         * @param {string} [repo] &#x60;types.repo&#x60;
         * @param {string} [path] &#x60;types.path&#x60;
         * @param {boolean} [readonly] [NOT] [ system / custom ] types only
         * @param {boolean} [extendable] [NOT] Extend[able] types only.
         * @param {boolean} [extensions] [NOT] include extensions/_* types.
         * @param {boolean} [extended] [NOT] Extend[ed] types only.
         * @param {boolean} [administered] [NOT] Administer access control only
         * @param {number} [size] Number of result records (per page). Default: 16.
         * @param {number} [page] Page number of result set of records. Default: 1.
         * @param {Array<string>} [sort] Sort result dataset of records by fields. &#x60;&#x60;&#x60; sort ::&#x3D; *( ORDER name )  ORDER  &#x3D; ASC / DESC DESC   &#x3D; \&quot;-\&quot; / \&quot;!\&quot; ASC    &#x3D; [ \&quot;+\&quot; ]   ; Default &#x60;&#x60;&#x60;  Fields available  - &#x60;id&#x60;(seq) - &#x60;domain&#x60;{name} - &#x60;created_at&#x60; - &#x60;created_by&#x60;{name} - &#x60;updated_at&#x60; - &#x60;updated_by&#x60;{name}  Use ?fields&#x3D;&#x60;field.sort()&#x60; option to sort Edge fields.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record. &#x60;&#x60;&#x60; fields ::&#x3D; field [ *( \&quot;,\&quot; field ) ] field  ::&#x3D; name [ *( func ) ] [ inner ] inner  ::&#x3D; \&quot;{\&quot; fields \&quot;}\&quot; funcs  ::&#x3D; *( func ) func   ::&#x3D; \&quot;.\&quot; name \&quot;(\&quot; [ args ] \&quot;)\&quot; name   ::&#x3D; ALPHA / DIGIT / USCORE  ALPHA    &#x3D; %x41-5A / %x61-7A  ; \&quot;A\&quot;-\&quot;Z\&quot; / \&quot;a\&quot;-\&quot;z\&quot; DIGIT    &#x3D; %x30-39            ; \&quot;0\&quot;-\&quot;9\&quot; USCORE   &#x3D; %x5F ; underscore  ; \&quot;_\&quot; &#x60;&#x60;&#x60;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        search(q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options) {
            return TypesApiFp(configuration)
                .search(q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * TypesApi - object-oriented interface
 * @export
 * @class TypesApi
 * @extends {BaseAPI}
 */
export class TypesApi extends BaseAPI {
    /**
     *
     * @summary Structured data type details.
     * @param {string} path &#x60;types.path&#x60;
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TypesApi
     */
    locate(path, options) {
        return TypesApiFp(this.configuration)
            .locate(path, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Lookup data types registry.
     * @param {string} [q] Search term: &#x60;?&#x60; - matches any character &#x60;*&#x60; - matches 0 or more characters e.g.: name,emails{type},labels etc...
     * @param {string} [id] &#x60;types.id&#x60;
     * @param {string} [name] &#x60;types.name&#x60;
     * @param {string} [repo] &#x60;types.repo&#x60;
     * @param {string} [path] &#x60;types.path&#x60;
     * @param {boolean} [readonly] [NOT] [ system / custom ] types only
     * @param {boolean} [extendable] [NOT] Extend[able] types only.
     * @param {boolean} [extensions] [NOT] include extensions/_* types.
     * @param {boolean} [extended] [NOT] Extend[ed] types only.
     * @param {boolean} [administered] [NOT] Administer access control only
     * @param {number} [size] Number of result records (per page). Default: 16.
     * @param {number} [page] Page number of result set of records. Default: 1.
     * @param {Array<string>} [sort] Sort result dataset of records by fields. &#x60;&#x60;&#x60; sort ::&#x3D; *( ORDER name )  ORDER  &#x3D; ASC / DESC DESC   &#x3D; \&quot;-\&quot; / \&quot;!\&quot; ASC    &#x3D; [ \&quot;+\&quot; ]   ; Default &#x60;&#x60;&#x60;  Fields available  - &#x60;id&#x60;(seq) - &#x60;domain&#x60;{name} - &#x60;created_at&#x60; - &#x60;created_by&#x60;{name} - &#x60;updated_at&#x60; - &#x60;updated_by&#x60;{name}  Use ?fields&#x3D;&#x60;field.sort()&#x60; option to sort Edge fields.
     * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record. &#x60;&#x60;&#x60; fields ::&#x3D; field [ *( \&quot;,\&quot; field ) ] field  ::&#x3D; name [ *( func ) ] [ inner ] inner  ::&#x3D; \&quot;{\&quot; fields \&quot;}\&quot; funcs  ::&#x3D; *( func ) func   ::&#x3D; \&quot;.\&quot; name \&quot;(\&quot; [ args ] \&quot;)\&quot; name   ::&#x3D; ALPHA / DIGIT / USCORE  ALPHA    &#x3D; %x41-5A / %x61-7A  ; \&quot;A\&quot;-\&quot;Z\&quot; / \&quot;a\&quot;-\&quot;z\&quot; DIGIT    &#x3D; %x30-39            ; \&quot;0\&quot;-\&quot;9\&quot; USCORE   &#x3D; %x5F ; underscore  ; \&quot;_\&quot; &#x60;&#x60;&#x60;
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TypesApi
     */
    search(q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options) {
        return TypesApiFp(this.configuration)
            .search(q, id, name, repo, path, readonly, extendable, extensions, extended, administered, size, page, sort, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=types-api.js.map