// 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';
/**
 * UserHelperServiceApi - axios parameter creator
 * @export
 */
export const UserHelperServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        activityWorkspaceWidget: async (fields, options = {}) => {
            const localVarPath = `/user/widget/activity/today`;
            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;
            }
            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,
            };
        },
        /**
         *
         * @param {string} type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        defaultDeviceConfig: async (type, options = {}) => {
            // verify required parameter 'type' is not null or undefined
            if (type === null || type === undefined) {
                throw new RequiredError('type', 'Required parameter type was null or undefined when calling defaultDeviceConfig.');
            }
            const localVarPath = `/user/device/config/{type}`.replace(`{${'type'}}`, encodeURIComponent(String(type)));
            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,
            };
        },
    };
};
/**
 * UserHelperServiceApi - functional programming interface
 * @export
 */
export const UserHelperServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async activityWorkspaceWidget(fields, options) {
            const localVarAxiosArgs = await UserHelperServiceApiAxiosParamCreator(configuration).activityWorkspaceWidget(fields, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {string} type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async defaultDeviceConfig(type, options) {
            const localVarAxiosArgs = await UserHelperServiceApiAxiosParamCreator(configuration).defaultDeviceConfig(type, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * UserHelperServiceApi - factory interface
 * @export
 */
export const UserHelperServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        activityWorkspaceWidget(fields, options) {
            return UserHelperServiceApiFp(configuration)
                .activityWorkspaceWidget(fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        defaultDeviceConfig(type, options) {
            return UserHelperServiceApiFp(configuration)
                .defaultDeviceConfig(type, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * UserHelperServiceApi - object-oriented interface
 * @export
 * @class UserHelperServiceApi
 * @extends {BaseAPI}
 */
export class UserHelperServiceApi extends BaseAPI {
    /**
     *
     * @param {Array<string>} [fields]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserHelperServiceApi
     */
    activityWorkspaceWidget(fields, options) {
        return UserHelperServiceApiFp(this.configuration)
            .activityWorkspaceWidget(fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} type
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserHelperServiceApi
     */
    defaultDeviceConfig(type, options) {
        return UserHelperServiceApiFp(this.configuration)
            .defaultDeviceConfig(type, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=user-helper-service-api.js.map