/* tslint:disable */
/* eslint-disable */
/**
 * Deepfence ThreatMapper
 * Deepfence Runtime API provides programmatic control over Deepfence microservice securing your container, kubernetes and cloud deployments. The API abstracts away underlying infrastructure details like cloud provider,  container distros, container orchestrator and type of deployment. This is one uniform API to manage and control security alerts, policies and response to alerts for microservices running anywhere i.e. managed pure greenfield container deployments or a mix of containers, VMs and serverless paradigms like AWS Fargate.
 *
 * The version of the OpenAPI document: v2.5.0
 * Contact: community@deepfence.io
 *
 * 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 {
  ApiDocsBadRequestResponse,
  ApiDocsFailureResponse,
  ModelAPIAuthRequest,
} from '../models';
import {
    ApiDocsBadRequestResponseFromJSON,
    ApiDocsBadRequestResponseToJSON,
    ApiDocsFailureResponseFromJSON,
    ApiDocsFailureResponseToJSON,
    ModelAPIAuthRequestFromJSON,
    ModelAPIAuthRequestToJSON,
} from '../models';

/**
 * InternalApi - interface
 * 
 * @export
 * @interface InternalApiInterface
 */
export interface InternalApiInterface {
    /**
     * Get api-token for console agent
     * @summary Get api-token for console agent
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof InternalApiInterface
     */
    getConsoleApiTokenRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelAPIAuthRequest>>;

    /**
     * Get api-token for console agent
     * Get api-token for console agent
     */
    getConsoleApiToken(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelAPIAuthRequest>;

}

/**
 * 
 */
export class InternalApi extends runtime.BaseAPI implements InternalApiInterface {

    /**
     * Get api-token for console agent
     * Get api-token for console agent
     */
    async getConsoleApiTokenRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelAPIAuthRequest>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        const response = await this.request({
            path: `/deepfence/internal/console-api-token`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

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

    /**
     * Get api-token for console agent
     * Get api-token for console agent
     */
    async getConsoleApiToken(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelAPIAuthRequest> {
        const response = await this.getConsoleApiTokenRaw(initOverrides);
        return await response.value();
    }

}
