/* tslint:disable */ /* eslint-disable */ /** * KubeBlocks Cloud Internal API * The Internal API is using for interaction of ApeCloud platform microservices. * * The version of the OpenAPI document: 1.0.0 * * * 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 { ImageRegistry } from '../models'; // @ts-ignore import type { InternalImageRegistryList } from '../models'; /** * ImageRegistryApi - axios parameter creator * @export */ export const ImageRegistryApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Create image registry * @param {ImageRegistry} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createImageRegistry: async (body: ImageRegistry, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined assertParamExists('createImageRegistry', 'body', body) const localVarPath = `/internal/v1/imageRegistries`; // 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 BasicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, 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(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary List image registry names and URLs without credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInternalImageRegistries: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/internal/v1/imageRegistries`; // 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 BasicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ImageRegistryApi - functional programming interface * @export */ export const ImageRegistryApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ImageRegistryApiAxiosParamCreator(configuration) return { /** * * @summary Create image registry * @param {ImageRegistry} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createImageRegistry(body: ImageRegistry, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createImageRegistry(body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ImageRegistryApi.createImageRegistry']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary List image registry names and URLs without credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listInternalImageRegistries(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listInternalImageRegistries(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ImageRegistryApi.listInternalImageRegistries']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * ImageRegistryApi - factory interface * @export */ export const ImageRegistryApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ImageRegistryApiFp(configuration) return { /** * * @summary Create image registry * @param {ImageRegistryApiCreateImageRegistryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createImageRegistry(requestParameters: ImageRegistryApiCreateImageRegistryRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createImageRegistry(requestParameters.body, options).then((request) => request(axios, basePath)); }, /** * * @summary List image registry names and URLs without credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInternalImageRegistries(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listInternalImageRegistries(options).then((request) => request(axios, basePath)); }, }; }; /** * ImageRegistryApi - interface * @export * @interface ImageRegistryApi */ export interface ImageRegistryApiInterface { /** * * @summary Create image registry * @param {ImageRegistryApiCreateImageRegistryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ImageRegistryApiInterface */ createImageRegistry(requestParameters: ImageRegistryApiCreateImageRegistryRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * * @summary List image registry names and URLs without credentials * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ImageRegistryApiInterface */ listInternalImageRegistries(options?: RawAxiosRequestConfig): AxiosPromise; } /** * Request parameters for createImageRegistry operation in ImageRegistryApi. * @export * @interface ImageRegistryApiCreateImageRegistryRequest */ export interface ImageRegistryApiCreateImageRegistryRequest { /** * * @type {ImageRegistry} * @memberof ImageRegistryApiCreateImageRegistry */ readonly body: ImageRegistry } /** * ImageRegistryApi - object-oriented interface * @export * @class ImageRegistryApi * @extends {BaseAPI} */ export class ImageRegistryApi extends BaseAPI implements ImageRegistryApiInterface { /** * * @summary Create image registry * @param {ImageRegistryApiCreateImageRegistryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ImageRegistryApi */ public createImageRegistry(requestParameters: ImageRegistryApiCreateImageRegistryRequest, options?: RawAxiosRequestConfig) { return ImageRegistryApiFp(this.configuration).createImageRegistry(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary List image registry names and URLs without credentials * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ImageRegistryApi */ public listInternalImageRegistries(options?: RawAxiosRequestConfig) { return ImageRegistryApiFp(this.configuration).listInternalImageRegistries(options).then((request) => request(this.axios, this.basePath)); } }