/* tslint:disable */
/* eslint-disable */
/**
 * Daytona Runner API
 * Daytona Runner API
 *
 * The version of the OpenAPI document: v0.0.0-dev
 * 
 *
 * 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, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { CreateBackupDTO } from '../models';
// @ts-ignore
import type { CreateSandboxDTO } from '../models';
// @ts-ignore
import type { CreateSnapshotFromSandboxRequest } from '../models';
// @ts-ignore
import type { ErrorResponse } from '../models';
// @ts-ignore
import type { IsRecoverableDTO } from '../models';
// @ts-ignore
import type { IsRecoverableResponse } from '../models';
// @ts-ignore
import type { RecoverSandboxDTO } from '../models';
// @ts-ignore
import type { ResizeSandboxDTO } from '../models';
// @ts-ignore
import type { SandboxInfoResponse } from '../models';
// @ts-ignore
import type { SnapshotInfoResponse } from '../models';
// @ts-ignore
import type { StartSandboxResponse } from '../models';
// @ts-ignore
import type { StopSandboxDTO } from '../models';
// @ts-ignore
import type { UpdateNetworkSettingsDTO } from '../models';
/**
 * SandboxApi - axios parameter creator
 */
export const SandboxApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Create a sandbox
         * @summary Create a sandbox
         * @param {CreateSandboxDTO} sandbox Create sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        create: async (sandbox: CreateSandboxDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandbox' is not null or undefined
            assertParamExists('create', 'sandbox', sandbox)
            const localVarPath = `/sandboxes`;
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Create sandbox backup
         * @summary Create sandbox backup
         * @param {string} sandboxId Sandbox ID
         * @param {CreateBackupDTO} sandbox Create backup
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBackup: async (sandboxId: string, sandbox: CreateBackupDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('createBackup', 'sandboxId', sandboxId)
            // verify required parameter 'sandbox' is not null or undefined
            assertParamExists('createBackup', 'sandbox', sandbox)
            const localVarPath = `/sandboxes/{sandboxId}/backup`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Destroy sandbox
         * @summary Destroy sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        destroy: async (sandboxId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('destroy', 'sandboxId', sandboxId)
            const localVarPath = `/sandboxes/{sandboxId}/destroy`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            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,
            };
        },
        /**
         * Get sandbox network settings
         * @summary Get sandbox network settings
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkSettings: async (sandboxId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('getNetworkSettings', 'sandboxId', sandboxId)
            const localVarPath = `/sandboxes/{sandboxId}/network-settings`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            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,
            };
        },
        /**
         * Get sandbox info
         * @summary Get sandbox info
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        info: async (sandboxId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('info', 'sandboxId', sandboxId)
            const localVarPath = `/sandboxes/{sandboxId}`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            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,
            };
        },
        /**
         * Check if the sandbox\'s error reason indicates a recoverable error
         * @summary Check if sandbox error is recoverable
         * @param {string} sandboxId Sandbox ID
         * @param {IsRecoverableDTO} request Error reason to check
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        isRecoverable: async (sandboxId: string, request: IsRecoverableDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('isRecoverable', 'sandboxId', sandboxId)
            // verify required parameter 'request' is not null or undefined
            assertParamExists('isRecoverable', 'request', request)
            const localVarPath = `/sandboxes/{sandboxId}/is-recoverable`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Recover sandbox from error state using specified recovery type
         * @summary Recover sandbox from error state
         * @param {string} sandboxId Sandbox ID
         * @param {RecoverSandboxDTO} recovery Recovery parameters
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        recover: async (sandboxId: string, recovery: RecoverSandboxDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('recover', 'sandboxId', sandboxId)
            // verify required parameter 'recovery' is not null or undefined
            assertParamExists('recover', 'recovery', recovery)
            const localVarPath = `/sandboxes/{sandboxId}/recover`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Resize sandbox
         * @summary Resize sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {ResizeSandboxDTO} sandbox Resize sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resize: async (sandboxId: string, sandbox: ResizeSandboxDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('resize', 'sandboxId', sandboxId)
            // verify required parameter 'sandbox' is not null or undefined
            assertParamExists('resize', 'sandbox', sandbox)
            const localVarPath = `/sandboxes/{sandboxId}/resize`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Commit the sandbox container filesystem and push the image to the supplied registry under the canonical daytona-{hash}:daytona tag.
         * @summary Snapshot a running sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {CreateSnapshotFromSandboxRequest} body Snapshot from sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        snapshotFromSandbox: async (sandboxId: string, body: CreateSnapshotFromSandboxRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('snapshotFromSandbox', 'sandboxId', sandboxId)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('snapshotFromSandbox', 'body', body)
            const localVarPath = `/sandboxes/{sandboxId}/snapshot-from-sandbox`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Start sandbox
         * @summary Start sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {string} [token] Auth token
         * @param {object} [metadata] Metadata
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        start: async (sandboxId: string, token?: string, metadata?: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('start', 'sandboxId', sandboxId)
            const localVarPath = `/sandboxes/{sandboxId}/start`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            if (token !== undefined) {
                localVarQueryParameter['token'] = token;
            }

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Stop sandbox
         * @summary Stop sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {StopSandboxDTO} [sandbox] Stop sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        stop: async (sandboxId: string, sandbox?: StopSandboxDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('stop', 'sandboxId', sandboxId)
            const localVarPath = `/sandboxes/{sandboxId}/stop`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update sandbox network settings
         * @summary Update sandbox network settings
         * @param {string} sandboxId Sandbox ID
         * @param {UpdateNetworkSettingsDTO} sandbox Update network settings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNetworkSettings: async (sandboxId: string, sandbox: UpdateNetworkSettingsDTO, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'sandboxId' is not null or undefined
            assertParamExists('updateNetworkSettings', 'sandboxId', sandboxId)
            // verify required parameter 'sandbox' is not null or undefined
            assertParamExists('updateNetworkSettings', 'sandbox', sandbox)
            const localVarPath = `/sandboxes/{sandboxId}/network-settings`
                .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId)));
            // 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
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

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

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

/**
 * SandboxApi - functional programming interface
 */
export const SandboxApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = SandboxApiAxiosParamCreator(configuration)
    return {
        /**
         * Create a sandbox
         * @summary Create a sandbox
         * @param {CreateSandboxDTO} sandbox Create sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async create(sandbox: CreateSandboxDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StartSandboxResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.create(sandbox, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.create']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Create sandbox backup
         * @summary Create sandbox backup
         * @param {string} sandboxId Sandbox ID
         * @param {CreateBackupDTO} sandbox Create backup
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createBackup(sandboxId: string, sandbox: CreateBackupDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createBackup(sandboxId, sandbox, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.createBackup']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Destroy sandbox
         * @summary Destroy sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async destroy(sandboxId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.destroy(sandboxId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.destroy']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get sandbox network settings
         * @summary Get sandbox network settings
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getNetworkSettings(sandboxId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateNetworkSettingsDTO>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getNetworkSettings(sandboxId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.getNetworkSettings']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get sandbox info
         * @summary Get sandbox info
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async info(sandboxId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SandboxInfoResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.info(sandboxId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.info']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Check if the sandbox\'s error reason indicates a recoverable error
         * @summary Check if sandbox error is recoverable
         * @param {string} sandboxId Sandbox ID
         * @param {IsRecoverableDTO} request Error reason to check
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async isRecoverable(sandboxId: string, request: IsRecoverableDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<IsRecoverableResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.isRecoverable(sandboxId, request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.isRecoverable']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Recover sandbox from error state using specified recovery type
         * @summary Recover sandbox from error state
         * @param {string} sandboxId Sandbox ID
         * @param {RecoverSandboxDTO} recovery Recovery parameters
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async recover(sandboxId: string, recovery: RecoverSandboxDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.recover(sandboxId, recovery, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.recover']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Resize sandbox
         * @summary Resize sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {ResizeSandboxDTO} sandbox Resize sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async resize(sandboxId: string, sandbox: ResizeSandboxDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.resize(sandboxId, sandbox, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.resize']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Commit the sandbox container filesystem and push the image to the supplied registry under the canonical daytona-{hash}:daytona tag.
         * @summary Snapshot a running sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {CreateSnapshotFromSandboxRequest} body Snapshot from sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async snapshotFromSandbox(sandboxId: string, body: CreateSnapshotFromSandboxRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SnapshotInfoResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.snapshotFromSandbox(sandboxId, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.snapshotFromSandbox']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Start sandbox
         * @summary Start sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {string} [token] Auth token
         * @param {object} [metadata] Metadata
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async start(sandboxId: string, token?: string, metadata?: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StartSandboxResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.start(sandboxId, token, metadata, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.start']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Stop sandbox
         * @summary Stop sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {StopSandboxDTO} [sandbox] Stop sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async stop(sandboxId: string, sandbox?: StopSandboxDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.stop(sandboxId, sandbox, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.stop']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Update sandbox network settings
         * @summary Update sandbox network settings
         * @param {string} sandboxId Sandbox ID
         * @param {UpdateNetworkSettingsDTO} sandbox Update network settings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateNetworkSettings(sandboxId: string, sandbox: UpdateNetworkSettingsDTO, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateNetworkSettings(sandboxId, sandbox, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SandboxApi.updateNetworkSettings']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * SandboxApi - factory interface
 */
export const SandboxApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = SandboxApiFp(configuration)
    return {
        /**
         * Create a sandbox
         * @summary Create a sandbox
         * @param {CreateSandboxDTO} sandbox Create sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        create(sandbox: CreateSandboxDTO, options?: RawAxiosRequestConfig): AxiosPromise<StartSandboxResponse> {
            return localVarFp.create(sandbox, options).then((request) => request(axios, basePath));
        },
        /**
         * Create sandbox backup
         * @summary Create sandbox backup
         * @param {string} sandboxId Sandbox ID
         * @param {CreateBackupDTO} sandbox Create backup
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBackup(sandboxId: string, sandbox: CreateBackupDTO, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.createBackup(sandboxId, sandbox, options).then((request) => request(axios, basePath));
        },
        /**
         * Destroy sandbox
         * @summary Destroy sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        destroy(sandboxId: string, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.destroy(sandboxId, options).then((request) => request(axios, basePath));
        },
        /**
         * Get sandbox network settings
         * @summary Get sandbox network settings
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkSettings(sandboxId: string, options?: RawAxiosRequestConfig): AxiosPromise<UpdateNetworkSettingsDTO> {
            return localVarFp.getNetworkSettings(sandboxId, options).then((request) => request(axios, basePath));
        },
        /**
         * Get sandbox info
         * @summary Get sandbox info
         * @param {string} sandboxId Sandbox ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        info(sandboxId: string, options?: RawAxiosRequestConfig): AxiosPromise<SandboxInfoResponse> {
            return localVarFp.info(sandboxId, options).then((request) => request(axios, basePath));
        },
        /**
         * Check if the sandbox\'s error reason indicates a recoverable error
         * @summary Check if sandbox error is recoverable
         * @param {string} sandboxId Sandbox ID
         * @param {IsRecoverableDTO} request Error reason to check
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        isRecoverable(sandboxId: string, request: IsRecoverableDTO, options?: RawAxiosRequestConfig): AxiosPromise<IsRecoverableResponse> {
            return localVarFp.isRecoverable(sandboxId, request, options).then((request) => request(axios, basePath));
        },
        /**
         * Recover sandbox from error state using specified recovery type
         * @summary Recover sandbox from error state
         * @param {string} sandboxId Sandbox ID
         * @param {RecoverSandboxDTO} recovery Recovery parameters
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        recover(sandboxId: string, recovery: RecoverSandboxDTO, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.recover(sandboxId, recovery, options).then((request) => request(axios, basePath));
        },
        /**
         * Resize sandbox
         * @summary Resize sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {ResizeSandboxDTO} sandbox Resize sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resize(sandboxId: string, sandbox: ResizeSandboxDTO, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.resize(sandboxId, sandbox, options).then((request) => request(axios, basePath));
        },
        /**
         * Commit the sandbox container filesystem and push the image to the supplied registry under the canonical daytona-{hash}:daytona tag.
         * @summary Snapshot a running sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {CreateSnapshotFromSandboxRequest} body Snapshot from sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        snapshotFromSandbox(sandboxId: string, body: CreateSnapshotFromSandboxRequest, options?: RawAxiosRequestConfig): AxiosPromise<SnapshotInfoResponse> {
            return localVarFp.snapshotFromSandbox(sandboxId, body, options).then((request) => request(axios, basePath));
        },
        /**
         * Start sandbox
         * @summary Start sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {string} [token] Auth token
         * @param {object} [metadata] Metadata
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        start(sandboxId: string, token?: string, metadata?: object, options?: RawAxiosRequestConfig): AxiosPromise<StartSandboxResponse> {
            return localVarFp.start(sandboxId, token, metadata, options).then((request) => request(axios, basePath));
        },
        /**
         * Stop sandbox
         * @summary Stop sandbox
         * @param {string} sandboxId Sandbox ID
         * @param {StopSandboxDTO} [sandbox] Stop sandbox
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        stop(sandboxId: string, sandbox?: StopSandboxDTO, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.stop(sandboxId, sandbox, options).then((request) => request(axios, basePath));
        },
        /**
         * Update sandbox network settings
         * @summary Update sandbox network settings
         * @param {string} sandboxId Sandbox ID
         * @param {UpdateNetworkSettingsDTO} sandbox Update network settings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNetworkSettings(sandboxId: string, sandbox: UpdateNetworkSettingsDTO, options?: RawAxiosRequestConfig): AxiosPromise<string> {
            return localVarFp.updateNetworkSettings(sandboxId, sandbox, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * SandboxApi - object-oriented interface
 */
export class SandboxApi extends BaseAPI {
    /**
     * Create a sandbox
     * @summary Create a sandbox
     * @param {CreateSandboxDTO} sandbox Create sandbox
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public create(sandbox: CreateSandboxDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).create(sandbox, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Create sandbox backup
     * @summary Create sandbox backup
     * @param {string} sandboxId Sandbox ID
     * @param {CreateBackupDTO} sandbox Create backup
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createBackup(sandboxId: string, sandbox: CreateBackupDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).createBackup(sandboxId, sandbox, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Destroy sandbox
     * @summary Destroy sandbox
     * @param {string} sandboxId Sandbox ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public destroy(sandboxId: string, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).destroy(sandboxId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get sandbox network settings
     * @summary Get sandbox network settings
     * @param {string} sandboxId Sandbox ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getNetworkSettings(sandboxId: string, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).getNetworkSettings(sandboxId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get sandbox info
     * @summary Get sandbox info
     * @param {string} sandboxId Sandbox ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public info(sandboxId: string, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).info(sandboxId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Check if the sandbox\'s error reason indicates a recoverable error
     * @summary Check if sandbox error is recoverable
     * @param {string} sandboxId Sandbox ID
     * @param {IsRecoverableDTO} request Error reason to check
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public isRecoverable(sandboxId: string, request: IsRecoverableDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).isRecoverable(sandboxId, request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Recover sandbox from error state using specified recovery type
     * @summary Recover sandbox from error state
     * @param {string} sandboxId Sandbox ID
     * @param {RecoverSandboxDTO} recovery Recovery parameters
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public recover(sandboxId: string, recovery: RecoverSandboxDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).recover(sandboxId, recovery, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Resize sandbox
     * @summary Resize sandbox
     * @param {string} sandboxId Sandbox ID
     * @param {ResizeSandboxDTO} sandbox Resize sandbox
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public resize(sandboxId: string, sandbox: ResizeSandboxDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).resize(sandboxId, sandbox, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Commit the sandbox container filesystem and push the image to the supplied registry under the canonical daytona-{hash}:daytona tag.
     * @summary Snapshot a running sandbox
     * @param {string} sandboxId Sandbox ID
     * @param {CreateSnapshotFromSandboxRequest} body Snapshot from sandbox
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public snapshotFromSandbox(sandboxId: string, body: CreateSnapshotFromSandboxRequest, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).snapshotFromSandbox(sandboxId, body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Start sandbox
     * @summary Start sandbox
     * @param {string} sandboxId Sandbox ID
     * @param {string} [token] Auth token
     * @param {object} [metadata] Metadata
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public start(sandboxId: string, token?: string, metadata?: object, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).start(sandboxId, token, metadata, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Stop sandbox
     * @summary Stop sandbox
     * @param {string} sandboxId Sandbox ID
     * @param {StopSandboxDTO} [sandbox] Stop sandbox
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public stop(sandboxId: string, sandbox?: StopSandboxDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).stop(sandboxId, sandbox, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Update sandbox network settings
     * @summary Update sandbox network settings
     * @param {string} sandboxId Sandbox ID
     * @param {UpdateNetworkSettingsDTO} sandbox Update network settings
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateNetworkSettings(sandboxId: string, sandbox: UpdateNetworkSettingsDTO, options?: RawAxiosRequestConfig) {
        return SandboxApiFp(this.configuration).updateNetworkSettings(sandboxId, sandbox, options).then((request) => request(this.axios, this.basePath));
    }
}

