/* 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 AlertSubscription,
    AlertSubscriptionFromJSON,
    AlertSubscriptionToJSON,
} from '../models/AlertSubscription';
import {
    type CreateAlertRequest,
    CreateAlertRequestFromJSON,
    CreateAlertRequestToJSON,
} from '../models/CreateAlertRequest';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';
import {
    type PaginatedResponse,
    PaginatedResponseFromJSON,
    PaginatedResponseToJSON,
} from '../models/PaginatedResponse';

export interface CancelApiV1AlertsAlertIdDeleteRequest {
    alertId: string;
}

export interface SubscribeApiV1AlertsSubscribePostRequest {
    createAlertRequest: CreateAlertRequest;
}

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

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/alerts/{alert_id}`;
        urlPath = urlPath.replace('{alert_id}', encodeURIComponent(String(requestParameters['alertId'])));

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

    /**
     * Cancel (delete) a subscription. Owner only.
     * Cancel
     */
    async cancelApiV1AlertsAlertIdDeleteRaw(requestParameters: CancelApiV1AlertsAlertIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.cancelApiV1AlertsAlertIdDeleteRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Cancel (delete) a subscription. Owner only.
     * Cancel
     */
    async cancelApiV1AlertsAlertIdDelete(requestParameters: CancelApiV1AlertsAlertIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.cancelApiV1AlertsAlertIdDeleteRaw(requestParameters, initOverrides);
    }

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

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * List alert subscriptions. Authenticated users see their own; anonymous sees all (legacy behavior).
     * List Alerts
     */
    async listAlertsApiV1AlertsGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponse>> {
        const requestOptions = await this.listAlertsApiV1AlertsGetRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseFromJSON(jsonValue));
    }

    /**
     * List alert subscriptions. Authenticated users see their own; anonymous sees all (legacy behavior).
     * List Alerts
     */
    async listAlertsApiV1AlertsGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponse> {
        const response = await this.listAlertsApiV1AlertsGetRaw(initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/alerts/subscribe`;

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

    /**
     * Create a new alert subscription for a token.
     * Subscribe
     */
    async subscribeApiV1AlertsSubscribePostRaw(requestParameters: SubscribeApiV1AlertsSubscribePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AlertSubscription>> {
        const requestOptions = await this.subscribeApiV1AlertsSubscribePostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => AlertSubscriptionFromJSON(jsonValue));
    }

    /**
     * Create a new alert subscription for a token.
     * Subscribe
     */
    async subscribeApiV1AlertsSubscribePost(requestParameters: SubscribeApiV1AlertsSubscribePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AlertSubscription> {
        const response = await this.subscribeApiV1AlertsSubscribePostRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
