/* tslint:disable */
/* eslint-disable */
/**
 * Admin API
 * The Admin API is used to manage the ApeCloud platform. 
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@apecloud.com
 *
 * 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 } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { APIErrorResponse } from '../models';
// @ts-ignore
import type { BackupList } from '../models';
// @ts-ignore
import type { ImportBackup } from '../models';
// @ts-ignore
import type { Storage } from '../models';
// @ts-ignore
import type { StorageCheckResult } from '../models';
// @ts-ignore
import type { StorageCreate } from '../models';
// @ts-ignore
import type { StorageProvider } from '../models';
// @ts-ignore
import type { StorageUpdate } from '../models';
/**
 * StorageApi - axios parameter creator
 * @export
 */
export const StorageApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Check if storage can be accessed
         * @param {StorageCreate} storageCreate 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        checkStorage: async (storageCreate: StorageCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'storageCreate' is not null or undefined
            assertParamExists('checkStorage', 'storageCreate', storageCreate)
            const localVarPath = `/admin/v1/storageCheck`;
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Create a storage
         * @param {string} environmentName name of the environment
         * @param {StorageCreate} storageCreate 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createStorage: async (environmentName: string, storageCreate: StorageCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('createStorage', 'environmentName', environmentName)
            // verify required parameter 'storageCreate' is not null or undefined
            assertParamExists('createStorage', 'storageCreate', storageCreate)
            const localVarPath = `/admin/v1/environments/{environmentName}/storages`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)));
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Delete a storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of the storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteStorage: async (environmentName: string, storageName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('deleteStorage', 'environmentName', environmentName)
            // verify required parameter 'storageName' is not null or undefined
            assertParamExists('deleteStorage', 'storageName', storageName)
            const localVarPath = `/admin/v1/environments/{environmentName}/storages/{storageName}`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)))
                .replace(`{${"storageName"}}`, encodeURIComponent(String(storageName)));
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Get a storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of the storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStorage: async (environmentName: string, storageName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('getStorage', 'environmentName', environmentName)
            // verify required parameter 'storageName' is not null or undefined
            assertParamExists('getStorage', 'storageName', storageName)
            const localVarPath = `/admin/v1/environments/{environmentName}/storages/{storageName}`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)))
                .replace(`{${"storageName"}}`, encodeURIComponent(String(storageName)));
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary scan and import backup records from storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of the storage
         * @param {ImportBackup} importBackup 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importBackup: async (environmentName: string, storageName: string, importBackup: ImportBackup, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('importBackup', 'environmentName', environmentName)
            // verify required parameter 'storageName' is not null or undefined
            assertParamExists('importBackup', 'storageName', storageName)
            // verify required parameter 'importBackup' is not null or undefined
            assertParamExists('importBackup', 'importBackup', importBackup)
            const localVarPath = `/admin/v1/environments/{environmentName}/storages/{storageName}/importbackup`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)))
                .replace(`{${"storageName"}}`, encodeURIComponent(String(storageName)));
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary List storage providers for storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listStorageProviders: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/admin/v1/storageProviders`;
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary List storages
         * @param {string} environmentName name of the environment
         * @param {string} [name] the search key to search storage\&#39;s name
         * @param {string} [key] key to search storage\&#39;s tag
         * @param {string} [value] value to search storage\&#39;s tag
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listStorages: async (environmentName: string, name?: string, key?: string, value?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('listStorages', 'environmentName', environmentName)
            const localVarPath = `/admin/v1/environments/{environmentName}/storages`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)));
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

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

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

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


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Update a storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of storage
         * @param {StorageUpdate} storageUpdate 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateStorage: async (environmentName: string, storageName: string, storageUpdate: StorageUpdate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('updateStorage', 'environmentName', environmentName)
            // verify required parameter 'storageName' is not null or undefined
            assertParamExists('updateStorage', 'storageName', storageName)
            // verify required parameter 'storageUpdate' is not null or undefined
            assertParamExists('updateStorage', 'storageUpdate', storageUpdate)
            const localVarPath = `/admin/v1/environments/{environmentName}/storages/{storageName}`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)))
                .replace(`{${"storageName"}}`, encodeURIComponent(String(storageName)));
            // 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 BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


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

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

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

/**
 * StorageApi - functional programming interface
 * @export
 */
export const StorageApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = StorageApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Check if storage can be accessed
         * @param {StorageCreate} storageCreate 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async checkStorage(storageCreate: StorageCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StorageCheckResult>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.checkStorage(storageCreate, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.checkStorage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Create a storage
         * @param {string} environmentName name of the environment
         * @param {StorageCreate} storageCreate 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createStorage(environmentName: string, storageCreate: StorageCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Storage>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createStorage(environmentName, storageCreate, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.createStorage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Delete a storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of the storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteStorage(environmentName: string, storageName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStorage(environmentName, storageName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.deleteStorage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Get a storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of the storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getStorage(environmentName: string, storageName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Storage>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getStorage(environmentName, storageName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.getStorage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary scan and import backup records from storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of the storage
         * @param {ImportBackup} importBackup 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async importBackup(environmentName: string, storageName: string, importBackup: ImportBackup, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BackupList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.importBackup(environmentName, storageName, importBackup, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.importBackup']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary List storage providers for storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listStorageProviders(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<StorageProvider>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listStorageProviders(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.listStorageProviders']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary List storages
         * @param {string} environmentName name of the environment
         * @param {string} [name] the search key to search storage\&#39;s name
         * @param {string} [key] key to search storage\&#39;s tag
         * @param {string} [value] value to search storage\&#39;s tag
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listStorages(environmentName: string, name?: string, key?: string, value?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Storage>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listStorages(environmentName, name, key, value, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.listStorages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Update a storage
         * @param {string} environmentName name of the environment
         * @param {string} storageName name of storage
         * @param {StorageUpdate} storageUpdate 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateStorage(environmentName: string, storageName: string, storageUpdate: StorageUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Storage>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateStorage(environmentName, storageName, storageUpdate, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageApi.updateStorage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * StorageApi - factory interface
 * @export
 */
export const StorageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = StorageApiFp(configuration)
    return {
        /**
         * 
         * @summary Check if storage can be accessed
         * @param {StorageApiCheckStorageRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        checkStorage(requestParameters: StorageApiCheckStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<StorageCheckResult> {
            return localVarFp.checkStorage(requestParameters.storageCreate, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Create a storage
         * @param {StorageApiCreateStorageRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createStorage(requestParameters: StorageApiCreateStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Storage> {
            return localVarFp.createStorage(requestParameters.environmentName, requestParameters.storageCreate, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Delete a storage
         * @param {StorageApiDeleteStorageRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteStorage(requestParameters: StorageApiDeleteStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteStorage(requestParameters.environmentName, requestParameters.storageName, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Get a storage
         * @param {StorageApiGetStorageRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStorage(requestParameters: StorageApiGetStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Storage> {
            return localVarFp.getStorage(requestParameters.environmentName, requestParameters.storageName, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary scan and import backup records from storage
         * @param {StorageApiImportBackupRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importBackup(requestParameters: StorageApiImportBackupRequest, options?: RawAxiosRequestConfig): AxiosPromise<BackupList> {
            return localVarFp.importBackup(requestParameters.environmentName, requestParameters.storageName, requestParameters.importBackup, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary List storage providers for storage
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listStorageProviders(options?: RawAxiosRequestConfig): AxiosPromise<Array<StorageProvider>> {
            return localVarFp.listStorageProviders(options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary List storages
         * @param {StorageApiListStoragesRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listStorages(requestParameters: StorageApiListStoragesRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<Storage>> {
            return localVarFp.listStorages(requestParameters.environmentName, requestParameters.name, requestParameters.key, requestParameters.value, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Update a storage
         * @param {StorageApiUpdateStorageRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateStorage(requestParameters: StorageApiUpdateStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Storage> {
            return localVarFp.updateStorage(requestParameters.environmentName, requestParameters.storageName, requestParameters.storageUpdate, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * StorageApi - interface
 * @export
 * @interface StorageApi
 */
export interface StorageApiInterface {
    /**
     * 
     * @summary Check if storage can be accessed
     * @param {StorageApiCheckStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    checkStorage(requestParameters: StorageApiCheckStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<StorageCheckResult>;

    /**
     * 
     * @summary Create a storage
     * @param {StorageApiCreateStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    createStorage(requestParameters: StorageApiCreateStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Storage>;

    /**
     * 
     * @summary Delete a storage
     * @param {StorageApiDeleteStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    deleteStorage(requestParameters: StorageApiDeleteStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * 
     * @summary Get a storage
     * @param {StorageApiGetStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    getStorage(requestParameters: StorageApiGetStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Storage>;

    /**
     * 
     * @summary scan and import backup records from storage
     * @param {StorageApiImportBackupRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    importBackup(requestParameters: StorageApiImportBackupRequest, options?: RawAxiosRequestConfig): AxiosPromise<BackupList>;

    /**
     * 
     * @summary List storage providers for storage
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    listStorageProviders(options?: RawAxiosRequestConfig): AxiosPromise<Array<StorageProvider>>;

    /**
     * 
     * @summary List storages
     * @param {StorageApiListStoragesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    listStorages(requestParameters: StorageApiListStoragesRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<Storage>>;

    /**
     * 
     * @summary Update a storage
     * @param {StorageApiUpdateStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApiInterface
     */
    updateStorage(requestParameters: StorageApiUpdateStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Storage>;

}

/**
 * Request parameters for checkStorage operation in StorageApi.
 * @export
 * @interface StorageApiCheckStorageRequest
 */
export interface StorageApiCheckStorageRequest {
    /**
     * 
     * @type {StorageCreate}
     * @memberof StorageApiCheckStorage
     */
    readonly storageCreate: StorageCreate
}

/**
 * Request parameters for createStorage operation in StorageApi.
 * @export
 * @interface StorageApiCreateStorageRequest
 */
export interface StorageApiCreateStorageRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof StorageApiCreateStorage
     */
    readonly environmentName: string

    /**
     * 
     * @type {StorageCreate}
     * @memberof StorageApiCreateStorage
     */
    readonly storageCreate: StorageCreate
}

/**
 * Request parameters for deleteStorage operation in StorageApi.
 * @export
 * @interface StorageApiDeleteStorageRequest
 */
export interface StorageApiDeleteStorageRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof StorageApiDeleteStorage
     */
    readonly environmentName: string

    /**
     * name of the storage
     * @type {string}
     * @memberof StorageApiDeleteStorage
     */
    readonly storageName: string
}

/**
 * Request parameters for getStorage operation in StorageApi.
 * @export
 * @interface StorageApiGetStorageRequest
 */
export interface StorageApiGetStorageRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof StorageApiGetStorage
     */
    readonly environmentName: string

    /**
     * name of the storage
     * @type {string}
     * @memberof StorageApiGetStorage
     */
    readonly storageName: string
}

/**
 * Request parameters for importBackup operation in StorageApi.
 * @export
 * @interface StorageApiImportBackupRequest
 */
export interface StorageApiImportBackupRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof StorageApiImportBackup
     */
    readonly environmentName: string

    /**
     * name of the storage
     * @type {string}
     * @memberof StorageApiImportBackup
     */
    readonly storageName: string

    /**
     * 
     * @type {ImportBackup}
     * @memberof StorageApiImportBackup
     */
    readonly importBackup: ImportBackup
}

/**
 * Request parameters for listStorages operation in StorageApi.
 * @export
 * @interface StorageApiListStoragesRequest
 */
export interface StorageApiListStoragesRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof StorageApiListStorages
     */
    readonly environmentName: string

    /**
     * the search key to search storage\&#39;s name
     * @type {string}
     * @memberof StorageApiListStorages
     */
    readonly name?: string

    /**
     * key to search storage\&#39;s tag
     * @type {string}
     * @memberof StorageApiListStorages
     */
    readonly key?: string

    /**
     * value to search storage\&#39;s tag
     * @type {string}
     * @memberof StorageApiListStorages
     */
    readonly value?: string
}

/**
 * Request parameters for updateStorage operation in StorageApi.
 * @export
 * @interface StorageApiUpdateStorageRequest
 */
export interface StorageApiUpdateStorageRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof StorageApiUpdateStorage
     */
    readonly environmentName: string

    /**
     * name of storage
     * @type {string}
     * @memberof StorageApiUpdateStorage
     */
    readonly storageName: string

    /**
     * 
     * @type {StorageUpdate}
     * @memberof StorageApiUpdateStorage
     */
    readonly storageUpdate: StorageUpdate
}

/**
 * StorageApi - object-oriented interface
 * @export
 * @class StorageApi
 * @extends {BaseAPI}
 */
export class StorageApi extends BaseAPI implements StorageApiInterface {
    /**
     * 
     * @summary Check if storage can be accessed
     * @param {StorageApiCheckStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public checkStorage(requestParameters: StorageApiCheckStorageRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).checkStorage(requestParameters.storageCreate, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Create a storage
     * @param {StorageApiCreateStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public createStorage(requestParameters: StorageApiCreateStorageRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).createStorage(requestParameters.environmentName, requestParameters.storageCreate, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Delete a storage
     * @param {StorageApiDeleteStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public deleteStorage(requestParameters: StorageApiDeleteStorageRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).deleteStorage(requestParameters.environmentName, requestParameters.storageName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Get a storage
     * @param {StorageApiGetStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public getStorage(requestParameters: StorageApiGetStorageRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).getStorage(requestParameters.environmentName, requestParameters.storageName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary scan and import backup records from storage
     * @param {StorageApiImportBackupRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public importBackup(requestParameters: StorageApiImportBackupRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).importBackup(requestParameters.environmentName, requestParameters.storageName, requestParameters.importBackup, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary List storage providers for storage
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public listStorageProviders(options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).listStorageProviders(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary List storages
     * @param {StorageApiListStoragesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public listStorages(requestParameters: StorageApiListStoragesRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).listStorages(requestParameters.environmentName, requestParameters.name, requestParameters.key, requestParameters.value, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Update a storage
     * @param {StorageApiUpdateStorageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageApi
     */
    public updateStorage(requestParameters: StorageApiUpdateStorageRequest, options?: RawAxiosRequestConfig) {
        return StorageApiFp(this.configuration).updateStorage(requestParameters.environmentName, requestParameters.storageName, requestParameters.storageUpdate, options).then((request) => request(this.axios, this.basePath));
    }
}

