/* tslint:disable */
/* eslint-disable */
/**
 * Halo
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.17.0-SNAPSHOT
 * 
 *
 * 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, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { PasswordResetEmailRequest } from '../models';
// @ts-ignore
import { RegisterVerifyEmailRequest } from '../models';
// @ts-ignore
import { ResetPasswordRequest } from '../models';
// @ts-ignore
import { SignUpRequest } from '../models';
// @ts-ignore
import { User } from '../models';
/**
 * UserV1alpha1PublicApi - axios parameter creator
 * @export
 */
export const UserV1alpha1PublicApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Reset password by token
         * @param {string} name The name of the user
         * @param {ResetPasswordRequest} resetPasswordRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetPasswordByToken: async (name: string, resetPasswordRequest: ResetPasswordRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'name' is not null or undefined
            assertParamExists('resetPasswordByToken', 'name', name)
            // verify required parameter 'resetPasswordRequest' is not null or undefined
            assertParamExists('resetPasswordByToken', 'resetPasswordRequest', resetPasswordRequest)
            const localVarPath = `/apis/api.halo.run/v1alpha1/users/{name}/reset-password`
                .replace(`{${"name"}}`, encodeURIComponent(String(name)));
            // 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: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication basicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, 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(resetPasswordRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Send password reset email when forgot password
         * @param {PasswordResetEmailRequest} passwordResetEmailRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendPasswordResetEmail: async (passwordResetEmailRequest: PasswordResetEmailRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'passwordResetEmailRequest' is not null or undefined
            assertParamExists('sendPasswordResetEmail', 'passwordResetEmailRequest', passwordResetEmailRequest)
            const localVarPath = `/apis/api.halo.run/v1alpha1/users/-/send-password-reset-email`;
            // 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 basicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, 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(passwordResetEmailRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true
         * @param {RegisterVerifyEmailRequest} registerVerifyEmailRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendRegisterVerifyEmail: async (registerVerifyEmailRequest: RegisterVerifyEmailRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'registerVerifyEmailRequest' is not null or undefined
            assertParamExists('sendRegisterVerifyEmail', 'registerVerifyEmailRequest', registerVerifyEmailRequest)
            const localVarPath = `/apis/api.halo.run/v1alpha1/users/-/send-register-verify-email`;
            // 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 basicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, 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(registerVerifyEmailRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sign up a new user
         * @param {SignUpRequest} signUpRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        signUp: async (signUpRequest: SignUpRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'signUpRequest' is not null or undefined
            assertParamExists('signUp', 'signUpRequest', signUpRequest)
            const localVarPath = `/apis/api.halo.run/v1alpha1/users/-/signup`;
            // 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 basicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, 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(signUpRequest, localVarRequestOptions, configuration)

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

/**
 * UserV1alpha1PublicApi - functional programming interface
 * @export
 */
export const UserV1alpha1PublicApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = UserV1alpha1PublicApiAxiosParamCreator(configuration)
    return {
        /**
         * Reset password by token
         * @param {string} name The name of the user
         * @param {ResetPasswordRequest} resetPasswordRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async resetPasswordByToken(name: string, resetPasswordRequest: ResetPasswordRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.resetPasswordByToken(name, resetPasswordRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.resetPasswordByToken']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Send password reset email when forgot password
         * @param {PasswordResetEmailRequest} passwordResetEmailRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendPasswordResetEmail(passwordResetEmailRequest: PasswordResetEmailRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendPasswordResetEmail(passwordResetEmailRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.sendPasswordResetEmail']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true
         * @param {RegisterVerifyEmailRequest} registerVerifyEmailRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendRegisterVerifyEmail(registerVerifyEmailRequest: RegisterVerifyEmailRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendRegisterVerifyEmail(registerVerifyEmailRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.sendRegisterVerifyEmail']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sign up a new user
         * @param {SignUpRequest} signUpRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async signUp(signUpRequest: SignUpRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.signUp(signUpRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.signUp']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * UserV1alpha1PublicApi - factory interface
 * @export
 */
export const UserV1alpha1PublicApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = UserV1alpha1PublicApiFp(configuration)
    return {
        /**
         * Reset password by token
         * @param {UserV1alpha1PublicApiResetPasswordByTokenRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetPasswordByToken(requestParameters: UserV1alpha1PublicApiResetPasswordByTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.resetPasswordByToken(requestParameters.name, requestParameters.resetPasswordRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Send password reset email when forgot password
         * @param {UserV1alpha1PublicApiSendPasswordResetEmailRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendPasswordResetEmail(requestParameters: UserV1alpha1PublicApiSendPasswordResetEmailRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.sendPasswordResetEmail(requestParameters.passwordResetEmailRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true
         * @param {UserV1alpha1PublicApiSendRegisterVerifyEmailRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendRegisterVerifyEmail(requestParameters: UserV1alpha1PublicApiSendRegisterVerifyEmailRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.sendRegisterVerifyEmail(requestParameters.registerVerifyEmailRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Sign up a new user
         * @param {UserV1alpha1PublicApiSignUpRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        signUp(requestParameters: UserV1alpha1PublicApiSignUpRequest, options?: RawAxiosRequestConfig): AxiosPromise<User> {
            return localVarFp.signUp(requestParameters.signUpRequest, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * Request parameters for resetPasswordByToken operation in UserV1alpha1PublicApi.
 * @export
 * @interface UserV1alpha1PublicApiResetPasswordByTokenRequest
 */
export interface UserV1alpha1PublicApiResetPasswordByTokenRequest {
    /**
     * The name of the user
     * @type {string}
     * @memberof UserV1alpha1PublicApiResetPasswordByToken
     */
    readonly name: string

    /**
     * 
     * @type {ResetPasswordRequest}
     * @memberof UserV1alpha1PublicApiResetPasswordByToken
     */
    readonly resetPasswordRequest: ResetPasswordRequest
}

/**
 * Request parameters for sendPasswordResetEmail operation in UserV1alpha1PublicApi.
 * @export
 * @interface UserV1alpha1PublicApiSendPasswordResetEmailRequest
 */
export interface UserV1alpha1PublicApiSendPasswordResetEmailRequest {
    /**
     * 
     * @type {PasswordResetEmailRequest}
     * @memberof UserV1alpha1PublicApiSendPasswordResetEmail
     */
    readonly passwordResetEmailRequest: PasswordResetEmailRequest
}

/**
 * Request parameters for sendRegisterVerifyEmail operation in UserV1alpha1PublicApi.
 * @export
 * @interface UserV1alpha1PublicApiSendRegisterVerifyEmailRequest
 */
export interface UserV1alpha1PublicApiSendRegisterVerifyEmailRequest {
    /**
     * 
     * @type {RegisterVerifyEmailRequest}
     * @memberof UserV1alpha1PublicApiSendRegisterVerifyEmail
     */
    readonly registerVerifyEmailRequest: RegisterVerifyEmailRequest
}

/**
 * Request parameters for signUp operation in UserV1alpha1PublicApi.
 * @export
 * @interface UserV1alpha1PublicApiSignUpRequest
 */
export interface UserV1alpha1PublicApiSignUpRequest {
    /**
     * 
     * @type {SignUpRequest}
     * @memberof UserV1alpha1PublicApiSignUp
     */
    readonly signUpRequest: SignUpRequest
}

/**
 * UserV1alpha1PublicApi - object-oriented interface
 * @export
 * @class UserV1alpha1PublicApi
 * @extends {BaseAPI}
 */
export class UserV1alpha1PublicApi extends BaseAPI {
    /**
     * Reset password by token
     * @param {UserV1alpha1PublicApiResetPasswordByTokenRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserV1alpha1PublicApi
     */
    public resetPasswordByToken(requestParameters: UserV1alpha1PublicApiResetPasswordByTokenRequest, options?: RawAxiosRequestConfig) {
        return UserV1alpha1PublicApiFp(this.configuration).resetPasswordByToken(requestParameters.name, requestParameters.resetPasswordRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Send password reset email when forgot password
     * @param {UserV1alpha1PublicApiSendPasswordResetEmailRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserV1alpha1PublicApi
     */
    public sendPasswordResetEmail(requestParameters: UserV1alpha1PublicApiSendPasswordResetEmailRequest, options?: RawAxiosRequestConfig) {
        return UserV1alpha1PublicApiFp(this.configuration).sendPasswordResetEmail(requestParameters.passwordResetEmailRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true
     * @param {UserV1alpha1PublicApiSendRegisterVerifyEmailRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserV1alpha1PublicApi
     */
    public sendRegisterVerifyEmail(requestParameters: UserV1alpha1PublicApiSendRegisterVerifyEmailRequest, options?: RawAxiosRequestConfig) {
        return UserV1alpha1PublicApiFp(this.configuration).sendRegisterVerifyEmail(requestParameters.registerVerifyEmailRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sign up a new user
     * @param {UserV1alpha1PublicApiSignUpRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserV1alpha1PublicApi
     */
    public signUp(requestParameters: UserV1alpha1PublicApiSignUpRequest, options?: RawAxiosRequestConfig) {
        return UserV1alpha1PublicApiFp(this.configuration).signUp(requestParameters.signUpRequest, options).then((request) => request(this.axios, this.basePath));
    }
}

