/* tslint:disable */
/* eslint-disable */
/**
 * HumanLayer Daemon REST API
 * REST API for HumanLayer daemon operations, providing session management, approval workflows, and real-time event streaming capabilities. 
 *
 * 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 * as runtime from '../runtime';
import type {
  DebugInfoResponse,
  HealthResponse,
} from '../models/index';
import {
    DebugInfoResponseFromJSON,
    DebugInfoResponseToJSON,
    HealthResponseFromJSON,
    HealthResponseToJSON,
} from '../models/index';

/**
 * SystemApi - interface
 * 
 * @export
 * @interface SystemApiInterface
 */
export interface SystemApiInterface {
    /**
     * Get debug information about the daemon including database stats and runtime configuration
     * @summary Get debug information
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SystemApiInterface
     */
    getDebugInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DebugInfoResponse>>;

    /**
     * Get debug information about the daemon including database stats and runtime configuration
     * Get debug information
     */
    getDebugInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DebugInfoResponse>;

    /**
     * Check if the daemon is running and healthy
     * @summary Health check
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SystemApiInterface
     */
    getHealthRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HealthResponse>>;

    /**
     * Check if the daemon is running and healthy
     * Health check
     */
    getHealth(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HealthResponse>;

}

/**
 * 
 */
export class SystemApi extends runtime.BaseAPI implements SystemApiInterface {

    /**
     * Get debug information about the daemon including database stats and runtime configuration
     * Get debug information
     */
    async getDebugInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DebugInfoResponse>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/debug-info`;

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

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

    /**
     * Get debug information about the daemon including database stats and runtime configuration
     * Get debug information
     */
    async getDebugInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DebugInfoResponse> {
        const response = await this.getDebugInfoRaw(initOverrides);
        return await response.value();
    }

    /**
     * Check if the daemon is running and healthy
     * Health check
     */
    async getHealthRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HealthResponse>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/health`;

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

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

    /**
     * Check if the daemon is running and healthy
     * Health check
     */
    async getHealth(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HealthResponse> {
        const response = await this.getHealthRaw(initOverrides);
        return await response.value();
    }

}
