Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

8.3 KB
Raw Blame
/* tslint:disable */
/* eslint-disable */
/**
 * BoxLite
 * BoxLite AI platform API Docs
 *
 * The version of the OpenAPI document: 1.0
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, type RequestArgs, BaseAPI, operationServerMap } from '../base';
/**
 * PreviewApi - axios parameter creator
 */
export const PreviewApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Read the inbound mode of a box
         * @param {string} boxId ID of the box
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBoxInboundMode: async (boxId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'boxId' is not null or undefined
            assertParamExists('getBoxInboundMode', 'boxId', boxId)
            const localVarPath = `/preview/{boxId}/inbound`
                .replace('{boxId}', encodeURIComponent(String(boxId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Check if user has access to the box
         * @param {string} boxId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        hasBoxAccess: async (boxId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'boxId' is not null or undefined
            assertParamExists('hasBoxAccess', 'boxId', boxId)
            const localVarPath = `/preview/{boxId}/access`
                .replace('{boxId}', encodeURIComponent(String(boxId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication bearer required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication oauth2 required

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * PreviewApi - functional programming interface
 */
export const PreviewApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = PreviewApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Read the inbound mode of a box
         * @param {string} boxId ID of the box
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getBoxInboundMode(boxId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getBoxInboundMode(boxId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['PreviewApi.getBoxInboundMode']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Check if user has access to the box
         * @param {string} boxId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async hasBoxAccess(boxId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<boolean>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.hasBoxAccess(boxId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['PreviewApi.hasBoxAccess']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * PreviewApi - factory interface
 */
export const PreviewApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = PreviewApiFp(configuration)
    return {
        /**
         * 
         * @summary Read the inbound mode of a box
         * @param {string} boxId ID of the box
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBoxInboundMode(boxId: string, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.getBoxInboundMode(boxId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Check if user has access to the box
         * @param {string} boxId 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        hasBoxAccess(boxId: string, options?: RawAxiosRequestConfig): AxiosPromise<boolean> {
            return localVarFp.hasBoxAccess(boxId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * PreviewApi - object-oriented interface
 */
export class PreviewApi extends BaseAPI {
    /**
     * 
     * @summary Read the inbound mode of a box
     * @param {string} boxId ID of the box
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getBoxInboundMode(boxId: string, options?: RawAxiosRequestConfig) {
        return PreviewApiFp(this.configuration).getBoxInboundMode(boxId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Check if user has access to the box
     * @param {string} boxId 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public hasBoxAccess(boxId: string, options?: RawAxiosRequestConfig) {
        return PreviewApiFp(this.configuration).hasBoxAccess(boxId, options).then((request) => request(this.axios, this.basePath));
    }
}