/* tslint:disable */
/* eslint-disable */
/**
 * KubeBlocks Cloud API
 * KubeBlocks Cloud API is a RESTful API for managing KubeBlocks Cloud resources.  The API is organized around REST.  Our API has predictable resource-oriented URLs, accepts `JSON-encoded` request bodies, returns `JSON-encoded` responses, and uses standard HTTP response codes, authentication, and verbs.  We use standard HTTP authentication and provide API keys to identify who you are. Your API keys carry many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. 
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@apecloud.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 type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { APIErrorResponse } from '../models';
// @ts-ignore
import type { Apikey } from '../models';
// @ts-ignore
import type { ApikeyCreate } from '../models';
// @ts-ignore
import type { ApikeyList } from '../models';
// @ts-ignore
import type { ApikeyWithSK } from '../models';
// @ts-ignore
import type { PhoneVerificationRequest } from '../models';
// @ts-ignore
import type { UpdateAuthenticatedUserPasswordRequest } from '../models';
// @ts-ignore
import type { User } from '../models';
// @ts-ignore
import type { UserUpdate } from '../models';
/**
 * UserApi - axios parameter creator
 * @export
 */
export const UserApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Create apikey of the authenticated user
         * @summary Create apikey of the authenticated user
         * @param {ApikeyCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUserApikey: async (body: ApikeyCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'body' is not null or undefined
            assertParamExists('createUserApikey', 'body', body)
            const localVarPath = `/api/v1/user/apikeys`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * delete apikey
         * @summary Delete apikey
         * @param {string} keyName Name of the Apikey
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteApikey: async (keyName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'keyName' is not null or undefined
            assertParamExists('deleteApikey', 'keyName', keyName)
            const localVarPath = `/api/v1/user/apikey/{keyName}`
                .replace(`{${"keyName"}}`, encodeURIComponent(String(keyName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get authenticated login user info
         * @summary Get authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAuthenticatedUser: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/v1/user`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * partially update the specified apikey
         * @summary Update apikey information
         * @param {string} keyName Name of the apikey
         * @param {ApikeyCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAPIkey: async (keyName: string, body: ApikeyCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'keyName' is not null or undefined
            assertParamExists('patchAPIkey', 'keyName', keyName)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('patchAPIkey', 'body', body)
            const localVarPath = `/api/v1/user/apikey/{keyName}`
                .replace(`{${"keyName"}}`, encodeURIComponent(String(keyName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
         * @summary Update user information
         * @param {UserUpdate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAuthenticatedUser: async (body: UserUpdate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'body' is not null or undefined
            assertParamExists('patchAuthenticatedUser', 'body', body)
            const localVarPath = `/api/v1/user`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * to update user phone number, send verification code first
         * @summary Send verification code to user\'s phone
         * @param {PhoneVerificationRequest} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        phoneVerification: async (body: PhoneVerificationRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'body' is not null or undefined
            assertParamExists('phoneVerification', 'body', body)
            const localVarPath = `/api/v1/user/phone-verification-code`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get apikeys of the authenticated user
         * @summary Get apikeys of the authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readUserApikeys: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/v1/user/apikeys`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update current authenticated user password.
         * @summary Update current authenticated user password
         * @param {UpdateAuthenticatedUserPasswordRequest} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAuthenticatedUserPassword: async (body: UpdateAuthenticatedUserPasswordRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'body' is not null or undefined
            assertParamExists('updateAuthenticatedUserPassword', 'body', body)
            const localVarPath = `/api/v1/user/password`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * UserApi - functional programming interface
 * @export
 */
export const UserApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration)
    return {
        /**
         * Create apikey of the authenticated user
         * @summary Create apikey of the authenticated user
         * @param {ApikeyCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createUserApikey(body: ApikeyCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApikeyWithSK>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createUserApikey(body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.createUserApikey']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * delete apikey
         * @summary Delete apikey
         * @param {string} keyName Name of the Apikey
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteApikey(keyName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApikey(keyName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.deleteApikey']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get authenticated login user info
         * @summary Get authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getAuthenticatedUser(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getAuthenticatedUser(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.getAuthenticatedUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * partially update the specified apikey
         * @summary Update apikey information
         * @param {string} keyName Name of the apikey
         * @param {ApikeyCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchAPIkey(keyName: string, body: ApikeyCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Apikey>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchAPIkey(keyName, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.patchAPIkey']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
         * @summary Update user information
         * @param {UserUpdate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchAuthenticatedUser(body: UserUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchAuthenticatedUser(body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.patchAuthenticatedUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * to update user phone number, send verification code first
         * @summary Send verification code to user\'s phone
         * @param {PhoneVerificationRequest} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async phoneVerification(body: PhoneVerificationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.phoneVerification(body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.phoneVerification']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get apikeys of the authenticated user
         * @summary Get apikeys of the authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async readUserApikeys(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApikeyList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.readUserApikeys(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.readUserApikeys']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Update current authenticated user password.
         * @summary Update current authenticated user password
         * @param {UpdateAuthenticatedUserPasswordRequest} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateAuthenticatedUserPassword(body: UpdateAuthenticatedUserPasswordRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateAuthenticatedUserPassword(body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserApi.updateAuthenticatedUserPassword']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * UserApi - factory interface
 * @export
 */
export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = UserApiFp(configuration)
    return {
        /**
         * Create apikey of the authenticated user
         * @summary Create apikey of the authenticated user
         * @param {UserApiCreateUserApikeyRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUserApikey(requestParameters: UserApiCreateUserApikeyRequest, options?: RawAxiosRequestConfig): AxiosPromise<ApikeyWithSK> {
            return localVarFp.createUserApikey(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * delete apikey
         * @summary Delete apikey
         * @param {UserApiDeleteApikeyRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteApikey(requestParameters: UserApiDeleteApikeyRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteApikey(requestParameters.keyName, options).then((request) => request(axios, basePath));
        },
        /**
         * Get authenticated login user info
         * @summary Get authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAuthenticatedUser(options?: RawAxiosRequestConfig): AxiosPromise<User> {
            return localVarFp.getAuthenticatedUser(options).then((request) => request(axios, basePath));
        },
        /**
         * partially update the specified apikey
         * @summary Update apikey information
         * @param {UserApiPatchAPIkeyRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAPIkey(requestParameters: UserApiPatchAPIkeyRequest, options?: RawAxiosRequestConfig): AxiosPromise<Apikey> {
            return localVarFp.patchAPIkey(requestParameters.keyName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
         * @summary Update user information
         * @param {UserApiPatchAuthenticatedUserRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAuthenticatedUser(requestParameters: UserApiPatchAuthenticatedUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<User> {
            return localVarFp.patchAuthenticatedUser(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * to update user phone number, send verification code first
         * @summary Send verification code to user\'s phone
         * @param {UserApiPhoneVerificationRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        phoneVerification(requestParameters: UserApiPhoneVerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.phoneVerification(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * Get apikeys of the authenticated user
         * @summary Get apikeys of the authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readUserApikeys(options?: RawAxiosRequestConfig): AxiosPromise<ApikeyList> {
            return localVarFp.readUserApikeys(options).then((request) => request(axios, basePath));
        },
        /**
         * Update current authenticated user password.
         * @summary Update current authenticated user password
         * @param {UserApiUpdateAuthenticatedUserPasswordRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAuthenticatedUserPassword(requestParameters: UserApiUpdateAuthenticatedUserPasswordRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.updateAuthenticatedUserPassword(requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * UserApi - interface
 * @export
 * @interface UserApi
 */
export interface UserApiInterface {
    /**
     * Create apikey of the authenticated user
     * @summary Create apikey of the authenticated user
     * @param {UserApiCreateUserApikeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    createUserApikey(requestParameters: UserApiCreateUserApikeyRequest, options?: RawAxiosRequestConfig): AxiosPromise<ApikeyWithSK>;

    /**
     * delete apikey
     * @summary Delete apikey
     * @param {UserApiDeleteApikeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    deleteApikey(requestParameters: UserApiDeleteApikeyRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * Get authenticated login user info
     * @summary Get authenticated user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    getAuthenticatedUser(options?: RawAxiosRequestConfig): AxiosPromise<User>;

    /**
     * partially update the specified apikey
     * @summary Update apikey information
     * @param {UserApiPatchAPIkeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    patchAPIkey(requestParameters: UserApiPatchAPIkeyRequest, options?: RawAxiosRequestConfig): AxiosPromise<Apikey>;

    /**
     * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
     * @summary Update user information
     * @param {UserApiPatchAuthenticatedUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    patchAuthenticatedUser(requestParameters: UserApiPatchAuthenticatedUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<User>;

    /**
     * to update user phone number, send verification code first
     * @summary Send verification code to user\'s phone
     * @param {UserApiPhoneVerificationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    phoneVerification(requestParameters: UserApiPhoneVerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * Get apikeys of the authenticated user
     * @summary Get apikeys of the authenticated user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    readUserApikeys(options?: RawAxiosRequestConfig): AxiosPromise<ApikeyList>;

    /**
     * Update current authenticated user password.
     * @summary Update current authenticated user password
     * @param {UserApiUpdateAuthenticatedUserPasswordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApiInterface
     */
    updateAuthenticatedUserPassword(requestParameters: UserApiUpdateAuthenticatedUserPasswordRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

}

/**
 * Request parameters for createUserApikey operation in UserApi.
 * @export
 * @interface UserApiCreateUserApikeyRequest
 */
export interface UserApiCreateUserApikeyRequest {
    /**
     * 
     * @type {ApikeyCreate}
     * @memberof UserApiCreateUserApikey
     */
    readonly body: ApikeyCreate
}

/**
 * Request parameters for deleteApikey operation in UserApi.
 * @export
 * @interface UserApiDeleteApikeyRequest
 */
export interface UserApiDeleteApikeyRequest {
    /**
     * Name of the Apikey
     * @type {string}
     * @memberof UserApiDeleteApikey
     */
    readonly keyName: string
}

/**
 * Request parameters for patchAPIkey operation in UserApi.
 * @export
 * @interface UserApiPatchAPIkeyRequest
 */
export interface UserApiPatchAPIkeyRequest {
    /**
     * Name of the apikey
     * @type {string}
     * @memberof UserApiPatchAPIkey
     */
    readonly keyName: string

    /**
     * 
     * @type {ApikeyCreate}
     * @memberof UserApiPatchAPIkey
     */
    readonly body: ApikeyCreate
}

/**
 * Request parameters for patchAuthenticatedUser operation in UserApi.
 * @export
 * @interface UserApiPatchAuthenticatedUserRequest
 */
export interface UserApiPatchAuthenticatedUserRequest {
    /**
     * 
     * @type {UserUpdate}
     * @memberof UserApiPatchAuthenticatedUser
     */
    readonly body: UserUpdate
}

/**
 * Request parameters for phoneVerification operation in UserApi.
 * @export
 * @interface UserApiPhoneVerificationRequest
 */
export interface UserApiPhoneVerificationRequest {
    /**
     * 
     * @type {PhoneVerificationRequest}
     * @memberof UserApiPhoneVerification
     */
    readonly body: PhoneVerificationRequest
}

/**
 * Request parameters for updateAuthenticatedUserPassword operation in UserApi.
 * @export
 * @interface UserApiUpdateAuthenticatedUserPasswordRequest
 */
export interface UserApiUpdateAuthenticatedUserPasswordRequest {
    /**
     * 
     * @type {UpdateAuthenticatedUserPasswordRequest}
     * @memberof UserApiUpdateAuthenticatedUserPassword
     */
    readonly body: UpdateAuthenticatedUserPasswordRequest
}

/**
 * UserApi - object-oriented interface
 * @export
 * @class UserApi
 * @extends {BaseAPI}
 */
export class UserApi extends BaseAPI implements UserApiInterface {
    /**
     * Create apikey of the authenticated user
     * @summary Create apikey of the authenticated user
     * @param {UserApiCreateUserApikeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public createUserApikey(requestParameters: UserApiCreateUserApikeyRequest, options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).createUserApikey(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * delete apikey
     * @summary Delete apikey
     * @param {UserApiDeleteApikeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public deleteApikey(requestParameters: UserApiDeleteApikeyRequest, options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).deleteApikey(requestParameters.keyName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get authenticated login user info
     * @summary Get authenticated user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public getAuthenticatedUser(options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).getAuthenticatedUser(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * partially update the specified apikey
     * @summary Update apikey information
     * @param {UserApiPatchAPIkeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public patchAPIkey(requestParameters: UserApiPatchAPIkeyRequest, options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).patchAPIkey(requestParameters.keyName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
     * @summary Update user information
     * @param {UserApiPatchAuthenticatedUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public patchAuthenticatedUser(requestParameters: UserApiPatchAuthenticatedUserRequest, options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).patchAuthenticatedUser(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * to update user phone number, send verification code first
     * @summary Send verification code to user\'s phone
     * @param {UserApiPhoneVerificationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public phoneVerification(requestParameters: UserApiPhoneVerificationRequest, options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).phoneVerification(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get apikeys of the authenticated user
     * @summary Get apikeys of the authenticated user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public readUserApikeys(options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).readUserApikeys(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Update current authenticated user password.
     * @summary Update current authenticated user password
     * @param {UserApiUpdateAuthenticatedUserPasswordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    public updateAuthenticatedUserPassword(requestParameters: UserApiUpdateAuthenticatedUserPasswordRequest, options?: RawAxiosRequestConfig) {
        return UserApiFp(this.configuration).updateAuthenticatedUserPassword(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}

