/* tslint:disable */
/* eslint-disable */
/**
 * KubeBlocks Cloud Internal API
 * The Internal API is using for interaction of ApeCloud platform microservices. 
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * 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 { DBDoctorResponse } from '../models';
/**
 * DbdoctorApi - axios parameter creator
 * @export
 */
export const DbdoctorApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Sync clusters from 3rd party system
         * @param {string} [startTime] last query time
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dbDoctorSyncClusterInfo: async (startTime?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/internal/v1/3rdsync/clusterList`;
            // 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 BasicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = startTime;
            }


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Sync users from 3rd party system
         * @param {string} [startTime] last query time
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dbDoctorSyncUser: async (startTime?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/internal/v1/3rdsync/userList`;
            // 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 BasicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = startTime;
            }


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

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

/**
 * DbdoctorApi - functional programming interface
 * @export
 */
export const DbdoctorApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = DbdoctorApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Sync clusters from 3rd party system
         * @param {string} [startTime] last query time
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dbDoctorSyncClusterInfo(startTime?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DBDoctorResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dbDoctorSyncClusterInfo(startTime, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DbdoctorApi.dbDoctorSyncClusterInfo']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Sync users from 3rd party system
         * @param {string} [startTime] last query time
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dbDoctorSyncUser(startTime?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DBDoctorResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dbDoctorSyncUser(startTime, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DbdoctorApi.dbDoctorSyncUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * DbdoctorApi - factory interface
 * @export
 */
export const DbdoctorApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = DbdoctorApiFp(configuration)
    return {
        /**
         * 
         * @summary Sync clusters from 3rd party system
         * @param {DbdoctorApiDbDoctorSyncClusterInfoRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dbDoctorSyncClusterInfo(requestParameters: DbdoctorApiDbDoctorSyncClusterInfoRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<DBDoctorResponse> {
            return localVarFp.dbDoctorSyncClusterInfo(requestParameters.startTime, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Sync users from 3rd party system
         * @param {DbdoctorApiDbDoctorSyncUserRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dbDoctorSyncUser(requestParameters: DbdoctorApiDbDoctorSyncUserRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<DBDoctorResponse> {
            return localVarFp.dbDoctorSyncUser(requestParameters.startTime, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * DbdoctorApi - interface
 * @export
 * @interface DbdoctorApi
 */
export interface DbdoctorApiInterface {
    /**
     * 
     * @summary Sync clusters from 3rd party system
     * @param {DbdoctorApiDbDoctorSyncClusterInfoRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DbdoctorApiInterface
     */
    dbDoctorSyncClusterInfo(requestParameters?: DbdoctorApiDbDoctorSyncClusterInfoRequest, options?: RawAxiosRequestConfig): AxiosPromise<DBDoctorResponse>;

    /**
     * 
     * @summary Sync users from 3rd party system
     * @param {DbdoctorApiDbDoctorSyncUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DbdoctorApiInterface
     */
    dbDoctorSyncUser(requestParameters?: DbdoctorApiDbDoctorSyncUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<DBDoctorResponse>;

}

/**
 * Request parameters for dbDoctorSyncClusterInfo operation in DbdoctorApi.
 * @export
 * @interface DbdoctorApiDbDoctorSyncClusterInfoRequest
 */
export interface DbdoctorApiDbDoctorSyncClusterInfoRequest {
    /**
     * last query time
     * @type {string}
     * @memberof DbdoctorApiDbDoctorSyncClusterInfo
     */
    readonly startTime?: string
}

/**
 * Request parameters for dbDoctorSyncUser operation in DbdoctorApi.
 * @export
 * @interface DbdoctorApiDbDoctorSyncUserRequest
 */
export interface DbdoctorApiDbDoctorSyncUserRequest {
    /**
     * last query time
     * @type {string}
     * @memberof DbdoctorApiDbDoctorSyncUser
     */
    readonly startTime?: string
}

/**
 * DbdoctorApi - object-oriented interface
 * @export
 * @class DbdoctorApi
 * @extends {BaseAPI}
 */
export class DbdoctorApi extends BaseAPI implements DbdoctorApiInterface {
    /**
     * 
     * @summary Sync clusters from 3rd party system
     * @param {DbdoctorApiDbDoctorSyncClusterInfoRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DbdoctorApi
     */
    public dbDoctorSyncClusterInfo(requestParameters: DbdoctorApiDbDoctorSyncClusterInfoRequest = {}, options?: RawAxiosRequestConfig) {
        return DbdoctorApiFp(this.configuration).dbDoctorSyncClusterInfo(requestParameters.startTime, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Sync users from 3rd party system
     * @param {DbdoctorApiDbDoctorSyncUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DbdoctorApi
     */
    public dbDoctorSyncUser(requestParameters: DbdoctorApiDbDoctorSyncUserRequest = {}, options?: RawAxiosRequestConfig) {
        return DbdoctorApiFp(this.configuration).dbDoctorSyncUser(requestParameters.startTime, options).then((request) => request(this.axios, this.basePath));
    }
}

