/* 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 {
  DatabaseInfoResponse,
  HealthResponse,
} from '../models/index';
import {
    DatabaseInfoResponseFromJSON,
    DatabaseInfoResponseToJSON,
    HealthResponseFromJSON,
    HealthResponseToJSON,
} from '../models/index';

/**
 * SystemApi - interface
 *
 * @export
 * @interface SystemApiInterface
 */
export interface SystemApiInterface {
    /**
     * Get information about the daemon\'s SQLite database including path, size, and statistics
     * @summary Get database information
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SystemApiInterface
     */
    getDatabaseInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DatabaseInfoResponse>>;

    /**
     * Get information about the daemon\'s SQLite database including path, size, and statistics
     * Get database information
     */
    getDatabaseInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DatabaseInfoResponse>;

    /**
     * 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 information about the daemon\'s SQLite database including path, size, and statistics
     * Get database information
     */
    async getDatabaseInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DatabaseInfoResponse>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/database-info`;

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

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

    /**
     * Get information about the daemon\'s SQLite database including path, size, and statistics
     * Get database information
     */
    async getDatabaseInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DatabaseInfoResponse> {
        const response = await this.getDatabaseInfoRaw(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();
    }

}
