// 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';
/**
 * AuthApi - axios parameter creator
 * @export
 */
export const AuthApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Signup new domain with superior access token
         * @param {string} [domain] domain name
         * @param {string} [username] username
         * @param {string} [password] user password
         * @param {Array<string>} [scope] scope request control
         * @param {string} [certificate] license/certificate
         * @param {boolean} [mobile] OPTIONAL. Mobile device /login request ?
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        signup: async (domain, username, password, scope, certificate, mobile, options = {}) => {
            const localVarPath = `/signup`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'POST',
                ...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 (domain !== undefined) {
                localVarQueryParameter['domain'] = domain;
            }
            if (username !== undefined) {
                localVarQueryParameter['username'] = username;
            }
            if (password !== undefined) {
                localVarQueryParameter['password'] = password;
            }
            if (scope) {
                localVarQueryParameter['scope'] = scope;
            }
            if (certificate !== undefined) {
                localVarQueryParameter['certificate'] = certificate;
            }
            if (mobile !== undefined) {
                localVarQueryParameter['mobile'] = mobile;
            }
            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 The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
         * @param {string} [accessToken] string id_token &#x3D; 2;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        userInfo: async (accessToken, options = {}) => {
            const localVarPath = `/userinfo`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'POST',
                ...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 (accessToken !== undefined) {
                localVarQueryParameter['access_token'] = accessToken;
            }
            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 The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
         * @param {string} [accessToken] string id_token &#x3D; 2;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        userInfo2: async (accessToken, options = {}) => {
            const localVarPath = `/userinfo`;
            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 (accessToken !== undefined) {
                localVarQueryParameter['access_token'] = accessToken;
            }
            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,
            };
        },
    };
};
/**
 * AuthApi - functional programming interface
 * @export
 */
export const AuthApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Signup new domain with superior access token
         * @param {string} [domain] domain name
         * @param {string} [username] username
         * @param {string} [password] user password
         * @param {Array<string>} [scope] scope request control
         * @param {string} [certificate] license/certificate
         * @param {boolean} [mobile] OPTIONAL. Mobile device /login request ?
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async signup(domain, username, password, scope, certificate, mobile, options) {
            const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).signup(domain, username, password, scope, certificate, mobile, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
         * @param {string} [accessToken] string id_token &#x3D; 2;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async userInfo(accessToken, options) {
            const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).userInfo(accessToken, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
         * @param {string} [accessToken] string id_token &#x3D; 2;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async userInfo2(accessToken, options) {
            const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).userInfo2(accessToken, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * AuthApi - factory interface
 * @export
 */
export const AuthApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Signup new domain with superior access token
         * @param {string} [domain] domain name
         * @param {string} [username] username
         * @param {string} [password] user password
         * @param {Array<string>} [scope] scope request control
         * @param {string} [certificate] license/certificate
         * @param {boolean} [mobile] OPTIONAL. Mobile device /login request ?
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        signup(domain, username, password, scope, certificate, mobile, options) {
            return AuthApiFp(configuration)
                .signup(domain, username, password, scope, certificate, mobile, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
         * @param {string} [accessToken] string id_token &#x3D; 2;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        userInfo(accessToken, options) {
            return AuthApiFp(configuration)
                .userInfo(accessToken, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
         * @param {string} [accessToken] string id_token &#x3D; 2;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        userInfo2(accessToken, options) {
            return AuthApiFp(configuration)
                .userInfo2(accessToken, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * AuthApi - object-oriented interface
 * @export
 * @class AuthApi
 * @extends {BaseAPI}
 */
export class AuthApi extends BaseAPI {
    /**
     *
     * @summary Signup new domain with superior access token
     * @param {string} [domain] domain name
     * @param {string} [username] username
     * @param {string} [password] user password
     * @param {Array<string>} [scope] scope request control
     * @param {string} [certificate] license/certificate
     * @param {boolean} [mobile] OPTIONAL. Mobile device /login request ?
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AuthApi
     */
    signup(domain, username, password, scope, certificate, mobile, options) {
        return AuthApiFp(this.configuration)
            .signup(domain, username, password, scope, certificate, mobile, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
     * @param {string} [accessToken] string id_token &#x3D; 2;
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AuthApi
     */
    userInfo(accessToken, options) {
        return AuthApiFp(this.configuration)
            .userInfo(accessToken, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the authenticated End-User.
     * @param {string} [accessToken] string id_token &#x3D; 2;
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AuthApi
     */
    userInfo2(accessToken, options) {
        return AuthApiFp(this.configuration)
            .userInfo2(accessToken, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=auth-api.js.map