Skip to content

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

20.8 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, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, type RequestArgs, BaseAPI, operationServerMap } from '../base';
// @ts-ignore
import type { CreateRegistryCredential } from '../models';
// @ts-ignore
import type { RegistryCredential } from '../models';
// @ts-ignore
import type { UpdateRegistryCredential } from '../models';
/**
 * RegistriesApi - axios parameter creator
 */
export const RegistriesApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * A login for a private registry. The password is stored where this API cannot read it back, and is never returned.
         * @summary Add a registry credential
         * @param {CreateRegistryCredential} createRegistryCredential 
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRegistryCredential: async (createRegistryCredential: CreateRegistryCredential, xBoxLiteOrganizationID?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'createRegistryCredential' is not null or undefined
            assertParamExists('createRegistryCredential', 'createRegistryCredential', createRegistryCredential)
            const localVarPath = `/images/registries`;
            // 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: 'POST', ...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['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            if (xBoxLiteOrganizationID != null) {
                localVarHeaderParameter['X-BoxLite-Organization-ID'] = String(xBoxLiteOrganizationID);
            }
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createRegistryCredential, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Remove a registry credential
         * @param {string} id 
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRegistryCredential: async (id: string, xBoxLiteOrganizationID?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteRegistryCredential', 'id', id)
            const localVarPath = `/images/registries/{id}`
                .replace('{id}', encodeURIComponent(String(id)));
            // 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: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

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

            // authentication oauth2 required


            if (xBoxLiteOrganizationID != null) {
                localVarHeaderParameter['X-BoxLite-Organization-ID'] = String(xBoxLiteOrganizationID);
            }
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary List registry credentials
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRegistryCredentials: async (xBoxLiteOrganizationID?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/images/registries`;
            // 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';

            if (xBoxLiteOrganizationID != null) {
                localVarHeaderParameter['X-BoxLite-Organization-ID'] = String(xBoxLiteOrganizationID);
            }
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Replace the username and password without changing its scope or destroying dependent Boxes.
         * @summary Update a registry credential
         * @param {string} id Credential ID
         * @param {UpdateRegistryCredential} updateRegistryCredential Replacement username and password
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRegistryCredential: async (id: string, updateRegistryCredential: UpdateRegistryCredential, xBoxLiteOrganizationID?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateRegistryCredential', 'id', id)
            // verify required parameter 'updateRegistryCredential' is not null or undefined
            assertParamExists('updateRegistryCredential', 'updateRegistryCredential', updateRegistryCredential)
            const localVarPath = `/images/registries/{id}`
                .replace('{id}', encodeURIComponent(String(id)));
            // 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: 'PUT', ...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['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            if (xBoxLiteOrganizationID != null) {
                localVarHeaderParameter['X-BoxLite-Organization-ID'] = String(xBoxLiteOrganizationID);
            }
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(updateRegistryCredential, localVarRequestOptions, configuration)

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

/**
 * RegistriesApi - functional programming interface
 */
export const RegistriesApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = RegistriesApiAxiosParamCreator(configuration)
    return {
        /**
         * A login for a private registry. The password is stored where this API cannot read it back, and is never returned.
         * @summary Add a registry credential
         * @param {CreateRegistryCredential} createRegistryCredential 
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createRegistryCredential(createRegistryCredential: CreateRegistryCredential, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RegistryCredential>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createRegistryCredential(createRegistryCredential, xBoxLiteOrganizationID, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RegistriesApi.createRegistryCredential']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Remove a registry credential
         * @param {string} id 
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRegistryCredential(id: string, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRegistryCredential(id, xBoxLiteOrganizationID, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RegistriesApi.deleteRegistryCredential']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary List registry credentials
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRegistryCredentials(xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<RegistryCredential>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRegistryCredentials(xBoxLiteOrganizationID, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RegistriesApi.listRegistryCredentials']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Replace the username and password without changing its scope or destroying dependent Boxes.
         * @summary Update a registry credential
         * @param {string} id Credential ID
         * @param {UpdateRegistryCredential} updateRegistryCredential Replacement username and password
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateRegistryCredential(id: string, updateRegistryCredential: UpdateRegistryCredential, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RegistryCredential>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateRegistryCredential(id, updateRegistryCredential, xBoxLiteOrganizationID, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RegistriesApi.updateRegistryCredential']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * RegistriesApi - factory interface
 */
export const RegistriesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = RegistriesApiFp(configuration)
    return {
        /**
         * A login for a private registry. The password is stored where this API cannot read it back, and is never returned.
         * @summary Add a registry credential
         * @param {CreateRegistryCredential} createRegistryCredential 
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRegistryCredential(createRegistryCredential: CreateRegistryCredential, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): AxiosPromise<RegistryCredential> {
            return localVarFp.createRegistryCredential(createRegistryCredential, xBoxLiteOrganizationID, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Remove a registry credential
         * @param {string} id 
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRegistryCredential(id: string, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteRegistryCredential(id, xBoxLiteOrganizationID, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary List registry credentials
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRegistryCredentials(xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<RegistryCredential>> {
            return localVarFp.listRegistryCredentials(xBoxLiteOrganizationID, options).then((request) => request(axios, basePath));
        },
        /**
         * Replace the username and password without changing its scope or destroying dependent Boxes.
         * @summary Update a registry credential
         * @param {string} id Credential ID
         * @param {UpdateRegistryCredential} updateRegistryCredential Replacement username and password
         * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRegistryCredential(id: string, updateRegistryCredential: UpdateRegistryCredential, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig): AxiosPromise<RegistryCredential> {
            return localVarFp.updateRegistryCredential(id, updateRegistryCredential, xBoxLiteOrganizationID, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * RegistriesApi - object-oriented interface
 */
export class RegistriesApi extends BaseAPI {
    /**
     * A login for a private registry. The password is stored where this API cannot read it back, and is never returned.
     * @summary Add a registry credential
     * @param {CreateRegistryCredential} createRegistryCredential 
     * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createRegistryCredential(createRegistryCredential: CreateRegistryCredential, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig) {
        return RegistriesApiFp(this.configuration).createRegistryCredential(createRegistryCredential, xBoxLiteOrganizationID, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Remove a registry credential
     * @param {string} id 
     * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteRegistryCredential(id: string, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig) {
        return RegistriesApiFp(this.configuration).deleteRegistryCredential(id, xBoxLiteOrganizationID, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary List registry credentials
     * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listRegistryCredentials(xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig) {
        return RegistriesApiFp(this.configuration).listRegistryCredentials(xBoxLiteOrganizationID, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Replace the username and password without changing its scope or destroying dependent Boxes.
     * @summary Update a registry credential
     * @param {string} id Credential ID
     * @param {UpdateRegistryCredential} updateRegistryCredential Replacement username and password
     * @param {string} [xBoxLiteOrganizationID] Use with JWT to specify the organization ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateRegistryCredential(id: string, updateRegistryCredential: UpdateRegistryCredential, xBoxLiteOrganizationID?: string, options?: RawAxiosRequestConfig) {
        return RegistriesApiFp(this.configuration).updateRegistryCredential(id, updateRegistryCredential, xBoxLiteOrganizationID, options).then((request) => request(this.axios, this.basePath));
    }
}