/* tslint:disable */
/* eslint-disable */
/**
 * Admin API
 * The Admin API is used to manage the ApeCloud platform. 
 *
 * 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 { AlertInhibit } from '../models';
// @ts-ignore
import type { AlertInhibitList } from '../models';
/**
 * AlertInhibitApi - axios parameter creator
 * @export
 */
export const AlertInhibitApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Create alert inhibit
         * @param {AlertInhibit} [alertInhibit] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAlertInhibit: async (alertInhibit?: AlertInhibit, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/admin/v1/alerts/inhibits`;
            // 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(alertInhibit, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Delete alert inhibit
         * @param {string} inhibitId inhibit id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAlertInhibit: async (inhibitId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'inhibitId' is not null or undefined
            assertParamExists('deleteAlertInhibit', 'inhibitId', inhibitId)
            const localVarPath = `/admin/v1/alerts/inhibits/{inhibitId}`
                .replace(`{${"inhibitId"}}`, encodeURIComponent(String(inhibitId)));
            // 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,
            };
        },
        /**
         * 
         * @summary Get alert inhibit
         * @param {string} inhibitId inhibit id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAlertInhibit: async (inhibitId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'inhibitId' is not null or undefined
            assertParamExists('getAlertInhibit', 'inhibitId', inhibitId)
            const localVarPath = `/admin/v1/alerts/inhibits/{inhibitId}`
                .replace(`{${"inhibitId"}}`, encodeURIComponent(String(inhibitId)));
            // 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,
            };
        },
        /**
         * 
         * @summary List alert inhibits
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAlertInhibits: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/admin/v1/alerts/inhibits`;
            // 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,
            };
        },
        /**
         * 
         * @summary Patch alert inhibit
         * @param {AlertInhibit} [alertInhibit] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAlertInhibit: async (alertInhibit?: AlertInhibit, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/admin/v1/alerts/inhibits`;
            // 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(alertInhibit, localVarRequestOptions, configuration)

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

/**
 * AlertInhibitApi - functional programming interface
 * @export
 */
export const AlertInhibitApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = AlertInhibitApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Create alert inhibit
         * @param {AlertInhibit} [alertInhibit] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createAlertInhibit(alertInhibit?: AlertInhibit, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AlertInhibit>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createAlertInhibit(alertInhibit, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AlertInhibitApi.createAlertInhibit']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Delete alert inhibit
         * @param {string} inhibitId inhibit id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteAlertInhibit(inhibitId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAlertInhibit(inhibitId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AlertInhibitApi.deleteAlertInhibit']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Get alert inhibit
         * @param {string} inhibitId inhibit id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getAlertInhibit(inhibitId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AlertInhibit>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getAlertInhibit(inhibitId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AlertInhibitApi.getAlertInhibit']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary List alert inhibits
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listAlertInhibits(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AlertInhibitList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listAlertInhibits(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AlertInhibitApi.listAlertInhibits']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Patch alert inhibit
         * @param {AlertInhibit} [alertInhibit] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchAlertInhibit(alertInhibit?: AlertInhibit, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AlertInhibit>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchAlertInhibit(alertInhibit, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AlertInhibitApi.patchAlertInhibit']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * AlertInhibitApi - factory interface
 * @export
 */
export const AlertInhibitApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = AlertInhibitApiFp(configuration)
    return {
        /**
         * 
         * @summary Create alert inhibit
         * @param {AlertInhibitApiCreateAlertInhibitRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAlertInhibit(requestParameters: AlertInhibitApiCreateAlertInhibitRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibit> {
            return localVarFp.createAlertInhibit(requestParameters.alertInhibit, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Delete alert inhibit
         * @param {AlertInhibitApiDeleteAlertInhibitRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAlertInhibit(requestParameters: AlertInhibitApiDeleteAlertInhibitRequest, options?: RawAxiosRequestConfig): AxiosPromise<object> {
            return localVarFp.deleteAlertInhibit(requestParameters.inhibitId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Get alert inhibit
         * @param {AlertInhibitApiGetAlertInhibitRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAlertInhibit(requestParameters: AlertInhibitApiGetAlertInhibitRequest, options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibit> {
            return localVarFp.getAlertInhibit(requestParameters.inhibitId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary List alert inhibits
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAlertInhibits(options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibitList> {
            return localVarFp.listAlertInhibits(options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Patch alert inhibit
         * @param {AlertInhibitApiPatchAlertInhibitRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAlertInhibit(requestParameters: AlertInhibitApiPatchAlertInhibitRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibit> {
            return localVarFp.patchAlertInhibit(requestParameters.alertInhibit, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * AlertInhibitApi - interface
 * @export
 * @interface AlertInhibitApi
 */
export interface AlertInhibitApiInterface {
    /**
     * 
     * @summary Create alert inhibit
     * @param {AlertInhibitApiCreateAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApiInterface
     */
    createAlertInhibit(requestParameters?: AlertInhibitApiCreateAlertInhibitRequest, options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibit>;

    /**
     * 
     * @summary Delete alert inhibit
     * @param {AlertInhibitApiDeleteAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApiInterface
     */
    deleteAlertInhibit(requestParameters: AlertInhibitApiDeleteAlertInhibitRequest, options?: RawAxiosRequestConfig): AxiosPromise<object>;

    /**
     * 
     * @summary Get alert inhibit
     * @param {AlertInhibitApiGetAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApiInterface
     */
    getAlertInhibit(requestParameters: AlertInhibitApiGetAlertInhibitRequest, options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibit>;

    /**
     * 
     * @summary List alert inhibits
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApiInterface
     */
    listAlertInhibits(options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibitList>;

    /**
     * 
     * @summary Patch alert inhibit
     * @param {AlertInhibitApiPatchAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApiInterface
     */
    patchAlertInhibit(requestParameters?: AlertInhibitApiPatchAlertInhibitRequest, options?: RawAxiosRequestConfig): AxiosPromise<AlertInhibit>;

}

/**
 * Request parameters for createAlertInhibit operation in AlertInhibitApi.
 * @export
 * @interface AlertInhibitApiCreateAlertInhibitRequest
 */
export interface AlertInhibitApiCreateAlertInhibitRequest {
    /**
     * 
     * @type {AlertInhibit}
     * @memberof AlertInhibitApiCreateAlertInhibit
     */
    readonly alertInhibit?: AlertInhibit
}

/**
 * Request parameters for deleteAlertInhibit operation in AlertInhibitApi.
 * @export
 * @interface AlertInhibitApiDeleteAlertInhibitRequest
 */
export interface AlertInhibitApiDeleteAlertInhibitRequest {
    /**
     * inhibit id
     * @type {string}
     * @memberof AlertInhibitApiDeleteAlertInhibit
     */
    readonly inhibitId: string
}

/**
 * Request parameters for getAlertInhibit operation in AlertInhibitApi.
 * @export
 * @interface AlertInhibitApiGetAlertInhibitRequest
 */
export interface AlertInhibitApiGetAlertInhibitRequest {
    /**
     * inhibit id
     * @type {string}
     * @memberof AlertInhibitApiGetAlertInhibit
     */
    readonly inhibitId: string
}

/**
 * Request parameters for patchAlertInhibit operation in AlertInhibitApi.
 * @export
 * @interface AlertInhibitApiPatchAlertInhibitRequest
 */
export interface AlertInhibitApiPatchAlertInhibitRequest {
    /**
     * 
     * @type {AlertInhibit}
     * @memberof AlertInhibitApiPatchAlertInhibit
     */
    readonly alertInhibit?: AlertInhibit
}

/**
 * AlertInhibitApi - object-oriented interface
 * @export
 * @class AlertInhibitApi
 * @extends {BaseAPI}
 */
export class AlertInhibitApi extends BaseAPI implements AlertInhibitApiInterface {
    /**
     * 
     * @summary Create alert inhibit
     * @param {AlertInhibitApiCreateAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApi
     */
    public createAlertInhibit(requestParameters: AlertInhibitApiCreateAlertInhibitRequest = {}, options?: RawAxiosRequestConfig) {
        return AlertInhibitApiFp(this.configuration).createAlertInhibit(requestParameters.alertInhibit, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Delete alert inhibit
     * @param {AlertInhibitApiDeleteAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApi
     */
    public deleteAlertInhibit(requestParameters: AlertInhibitApiDeleteAlertInhibitRequest, options?: RawAxiosRequestConfig) {
        return AlertInhibitApiFp(this.configuration).deleteAlertInhibit(requestParameters.inhibitId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Get alert inhibit
     * @param {AlertInhibitApiGetAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApi
     */
    public getAlertInhibit(requestParameters: AlertInhibitApiGetAlertInhibitRequest, options?: RawAxiosRequestConfig) {
        return AlertInhibitApiFp(this.configuration).getAlertInhibit(requestParameters.inhibitId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary List alert inhibits
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApi
     */
    public listAlertInhibits(options?: RawAxiosRequestConfig) {
        return AlertInhibitApiFp(this.configuration).listAlertInhibits(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Patch alert inhibit
     * @param {AlertInhibitApiPatchAlertInhibitRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertInhibitApi
     */
    public patchAlertInhibit(requestParameters: AlertInhibitApiPatchAlertInhibitRequest = {}, options?: RawAxiosRequestConfig) {
        return AlertInhibitApiFp(this.configuration).patchAlertInhibit(requestParameters.alertInhibit, options).then((request) => request(this.axios, this.basePath));
    }
}

