/* 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 GenerateRequest,
    GenerateRequestFromJSON,
    GenerateRequestToJSON,
} from '../models/GenerateRequest';
import {
    type GenerateResponse,
    GenerateResponseFromJSON,
    GenerateResponseToJSON,
} from '../models/GenerateResponse';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';

export interface GenerateReportApiV1ReportsGeneratePostRequest {
    generateRequest: GenerateRequest;
}

export interface GetReportApiV1ReportsReportIdGetRequest {
    reportId: string;
}

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

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/reports/generate`;

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

    /**
     * Generate a research report for a token or wallet.  Composes 7 sections in parallel via LiteLLM. Falls back to templated content if LLM is unreachable. Saves to Postgres on success.
     * Generate Report
     */
    async generateReportApiV1ReportsGeneratePostRaw(requestParameters: GenerateReportApiV1ReportsGeneratePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GenerateResponse>> {
        const requestOptions = await this.generateReportApiV1ReportsGeneratePostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Generate a research report for a token or wallet.  Composes 7 sections in parallel via LiteLLM. Falls back to templated content if LLM is unreachable. Saves to Postgres on success.
     * Generate Report
     */
    async generateReportApiV1ReportsGeneratePost(requestParameters: GenerateReportApiV1ReportsGeneratePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GenerateResponse> {
        const response = await this.generateReportApiV1ReportsGeneratePostRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/reports/{report_id}`;
        urlPath = urlPath.replace('{report_id}', encodeURIComponent(String(requestParameters['reportId'])));

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

    /**
     * Retrieve a previously generated report from Postgres.
     * Get Report
     */
    async getReportApiV1ReportsReportIdGetRaw(requestParameters: GetReportApiV1ReportsReportIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.getReportApiV1ReportsReportIdGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Retrieve a previously generated report from Postgres.
     * Get Report
     */
    async getReportApiV1ReportsReportIdGet(requestParameters: GetReportApiV1ReportsReportIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.getReportApiV1ReportsReportIdGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
