"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Montelo
 * Documentation for the Montelo API.
 *
 * The version of the OpenAPI document: 1.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProjectApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class ProjectApi extends runtime.BaseAPI {
    /**
     */
    async projectControllerDeleteProjectRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearer", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/project`,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DeleteSuccessDtoFromJSON)(jsonValue));
    }
    /**
     */
    async projectControllerDeleteProject(initOverrides) {
        const response = await this.projectControllerDeleteProjectRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async projectControllerGetAllProjectsRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearer", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/project/all`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.FullProjectDtoFromJSON));
    }
    /**
     */
    async projectControllerGetAllProjects(initOverrides) {
        const response = await this.projectControllerGetAllProjectsRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async projectControllerGetProjectRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearer", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/project`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FullProjectDtoFromJSON)(jsonValue));
    }
    /**
     */
    async projectControllerGetProject(initOverrides) {
        const response = await this.projectControllerGetProjectRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async projectControllerSetCohereAPIKeyRaw(requestParameters, initOverrides) {
        if (requestParameters.setCohereApiKeyInput === null || requestParameters.setCohereApiKeyInput === undefined) {
            throw new runtime.RequiredError('setCohereApiKeyInput', 'Required parameter requestParameters.setCohereApiKeyInput was null or undefined when calling projectControllerSetCohereAPIKey.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearer", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/project/cohere-api-key`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.SetCohereApiKeyInputToJSON)(requestParameters.setCohereApiKeyInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProjectDtoFromJSON)(jsonValue));
    }
    /**
     */
    async projectControllerSetCohereAPIKey(requestParameters, initOverrides) {
        const response = await this.projectControllerSetCohereAPIKeyRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async projectControllerSetOpenAIAPIKeyRaw(requestParameters, initOverrides) {
        if (requestParameters.setOpenaiApiKeyInput === null || requestParameters.setOpenaiApiKeyInput === undefined) {
            throw new runtime.RequiredError('setOpenaiApiKeyInput', 'Required parameter requestParameters.setOpenaiApiKeyInput was null or undefined when calling projectControllerSetOpenAIAPIKey.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearer", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/project/openai-api-key`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.SetOpenaiApiKeyInputToJSON)(requestParameters.setOpenaiApiKeyInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProjectDtoFromJSON)(jsonValue));
    }
    /**
     */
    async projectControllerSetOpenAIAPIKey(requestParameters, initOverrides) {
        const response = await this.projectControllerSetOpenAIAPIKeyRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.ProjectApi = ProjectApi;
