/* tslint:disable */
/* eslint-disable */
/**
 * RMI Backend
 * Rug Munch Intelligence — institutional-grade crypto intelligence API. 13+ chains, 96 data providers, 8 MCP tools, x402 paid tier, sovereign-first FOSS.
 *
 * The version of the OpenAPI document: 2026.06.21
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import * as runtime from '../runtime';
import {
    type AlertmanagerPayload,
    AlertmanagerPayloadFromJSON,
    AlertmanagerPayloadToJSON,
} from '../models/AlertmanagerPayload';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';

export interface AlertsCriticalWebhookApiV1AdminAlertsCriticalPostRequest {
    alertmanagerPayload: AlertmanagerPayload;
}

export interface AlertsRecentApiV1AdminAlertsRecentGetRequest {
    limit?: number;
}

export interface AlertsWebhookApiV1AdminAlertsWebhookPostRequest {
    alertmanagerPayload: AlertmanagerPayload;
}

/**
 * 
 */
export class AdminAlertsApi extends runtime.BaseAPI {

    /**
     * Creates request options for alertsCriticalWebhookApiV1AdminAlertsCriticalPost without sending the request
     */
    async alertsCriticalWebhookApiV1AdminAlertsCriticalPostRequestOpts(requestParameters: AlertsCriticalWebhookApiV1AdminAlertsCriticalPostRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['alertmanagerPayload'] == null) {
            throw new runtime.RequiredError(
                'alertmanagerPayload',
                'Required parameter "alertmanagerPayload" was null or undefined when calling alertsCriticalWebhookApiV1AdminAlertsCriticalPost().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/admin/alerts/critical`;

        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AlertmanagerPayloadToJSON(requestParameters['alertmanagerPayload']),
        };
    }

    /**
     * Critical-only webhook — escalations only (severity=critical).
     * Alerts Critical Webhook
     */
    async alertsCriticalWebhookApiV1AdminAlertsCriticalPostRaw(requestParameters: AlertsCriticalWebhookApiV1AdminAlertsCriticalPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.alertsCriticalWebhookApiV1AdminAlertsCriticalPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     * Critical-only webhook — escalations only (severity=critical).
     * Alerts Critical Webhook
     */
    async alertsCriticalWebhookApiV1AdminAlertsCriticalPost(requestParameters: AlertsCriticalWebhookApiV1AdminAlertsCriticalPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.alertsCriticalWebhookApiV1AdminAlertsCriticalPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for alertsRecentApiV1AdminAlertsRecentGet without sending the request
     */
    async alertsRecentApiV1AdminAlertsRecentGetRequestOpts(requestParameters: AlertsRecentApiV1AdminAlertsRecentGetRequest): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/admin/alerts/recent`;

        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Read recent alerts (debug endpoint — admin only in production).
     * Alerts Recent
     */
    async alertsRecentApiV1AdminAlertsRecentGetRaw(requestParameters: AlertsRecentApiV1AdminAlertsRecentGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.alertsRecentApiV1AdminAlertsRecentGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     * Read recent alerts (debug endpoint — admin only in production).
     * Alerts Recent
     */
    async alertsRecentApiV1AdminAlertsRecentGet(requestParameters: AlertsRecentApiV1AdminAlertsRecentGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.alertsRecentApiV1AdminAlertsRecentGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for alertsWebhookApiV1AdminAlertsWebhookPost without sending the request
     */
    async alertsWebhookApiV1AdminAlertsWebhookPostRequestOpts(requestParameters: AlertsWebhookApiV1AdminAlertsWebhookPostRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['alertmanagerPayload'] == null) {
            throw new runtime.RequiredError(
                'alertmanagerPayload',
                'Required parameter "alertmanagerPayload" was null or undefined when calling alertsWebhookApiV1AdminAlertsWebhookPost().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/admin/alerts/webhook`;

        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AlertmanagerPayloadToJSON(requestParameters['alertmanagerPayload']),
        };
    }

    /**
     * Default receiver webhook — all severities.
     * Alerts Webhook
     */
    async alertsWebhookApiV1AdminAlertsWebhookPostRaw(requestParameters: AlertsWebhookApiV1AdminAlertsWebhookPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.alertsWebhookApiV1AdminAlertsWebhookPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     * Default receiver webhook — all severities.
     * Alerts Webhook
     */
    async alertsWebhookApiV1AdminAlertsWebhookPost(requestParameters: AlertsWebhookApiV1AdminAlertsWebhookPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.alertsWebhookApiV1AdminAlertsWebhookPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
