"use strict";
/* 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.
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageRegistryApi = exports.ImageRegistryApiFactory = exports.ImageRegistryApiFp = exports.ImageRegistryApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
 * ImageRegistryApi - axios parameter creator
 * @export
 */
const ImageRegistryApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Create image registry
         * @param {ImageRegistry} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createImageRegistry: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createImageRegistry', 'body', body);
            const localVarPath = `/admin/v1/imageRegistries`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Delete image registry
         * @param {string} imageRegistryName name of the image registry
         * @param {ImageRegistry} [imageRegistry]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteImageRegistry: async (imageRegistryName, imageRegistry, options = {}) => {
            // verify required parameter 'imageRegistryName' is not null or undefined
            (0, common_1.assertParamExists)('deleteImageRegistry', 'imageRegistryName', imageRegistryName);
            const localVarPath = `/admin/v1/imageRegistries/{imageRegistryName}`
                .replace(`{${"imageRegistryName"}}`, encodeURIComponent(String(imageRegistryName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(imageRegistry, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Get image registry
         * @param {string} imageRegistryName name of the image registry
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getImageRegistry: async (imageRegistryName, options = {}) => {
            // verify required parameter 'imageRegistryName' is not null or undefined
            (0, common_1.assertParamExists)('getImageRegistry', 'imageRegistryName', imageRegistryName);
            const localVarPath = `/admin/v1/imageRegistries/{imageRegistryName}`
                .replace(`{${"imageRegistryName"}}`, encodeURIComponent(String(imageRegistryName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * List image registries
         * @summary List image registries
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listImageRegistries: async (options = {}) => {
            const localVarPath = `/admin/v1/imageRegistries`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * partially update the specified image registry
         * @summary Update image registry
         * @param {string} imageRegistryName name of the image registry
         * @param {ImageRegistry} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchImageRegistry: async (imageRegistryName, body, options = {}) => {
            // verify required parameter 'imageRegistryName' is not null or undefined
            (0, common_1.assertParamExists)('patchImageRegistry', 'imageRegistryName', imageRegistryName);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('patchImageRegistry', 'body', body);
            const localVarPath = `/admin/v1/imageRegistries/{imageRegistryName}`
                .replace(`{${"imageRegistryName"}}`, encodeURIComponent(String(imageRegistryName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.ImageRegistryApiAxiosParamCreator = ImageRegistryApiAxiosParamCreator;
/**
 * ImageRegistryApi - functional programming interface
 * @export
 */
const ImageRegistryApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.ImageRegistryApiAxiosParamCreator)(configuration);
    return {
        /**
         *
         * @summary Create image registry
         * @param {ImageRegistry} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createImageRegistry(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createImageRegistry(body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImageRegistryApi.createImageRegistry']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         *
         * @summary Delete image registry
         * @param {string} imageRegistryName name of the image registry
         * @param {ImageRegistry} [imageRegistry]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteImageRegistry(imageRegistryName, imageRegistry, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteImageRegistry(imageRegistryName, imageRegistry, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImageRegistryApi.deleteImageRegistry']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         *
         * @summary Get image registry
         * @param {string} imageRegistryName name of the image registry
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getImageRegistry(imageRegistryName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getImageRegistry(imageRegistryName, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImageRegistryApi.getImageRegistry']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * List image registries
         * @summary List image registries
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listImageRegistries(options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listImageRegistries(options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImageRegistryApi.listImageRegistries']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * partially update the specified image registry
         * @summary Update image registry
         * @param {string} imageRegistryName name of the image registry
         * @param {ImageRegistry} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchImageRegistry(imageRegistryName, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchImageRegistry(imageRegistryName, body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImageRegistryApi.patchImageRegistry']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    };
};
exports.ImageRegistryApiFp = ImageRegistryApiFp;
/**
 * ImageRegistryApi - factory interface
 * @export
 */
const ImageRegistryApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.ImageRegistryApiFp)(configuration);
    return {
        /**
         *
         * @summary Create image registry
         * @param {ImageRegistryApiCreateImageRegistryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createImageRegistry(requestParameters, options) {
            return localVarFp.createImageRegistry(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Delete image registry
         * @param {ImageRegistryApiDeleteImageRegistryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteImageRegistry(requestParameters, options) {
            return localVarFp.deleteImageRegistry(requestParameters.imageRegistryName, requestParameters.imageRegistry, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Get image registry
         * @param {ImageRegistryApiGetImageRegistryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getImageRegistry(requestParameters, options) {
            return localVarFp.getImageRegistry(requestParameters.imageRegistryName, options).then((request) => request(axios, basePath));
        },
        /**
         * List image registries
         * @summary List image registries
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listImageRegistries(options) {
            return localVarFp.listImageRegistries(options).then((request) => request(axios, basePath));
        },
        /**
         * partially update the specified image registry
         * @summary Update image registry
         * @param {ImageRegistryApiPatchImageRegistryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchImageRegistry(requestParameters, options) {
            return localVarFp.patchImageRegistry(requestParameters.imageRegistryName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};
exports.ImageRegistryApiFactory = ImageRegistryApiFactory;
/**
 * ImageRegistryApi - object-oriented interface
 * @export
 * @class ImageRegistryApi
 * @extends {BaseAPI}
 */
class ImageRegistryApi extends base_1.BaseAPI {
    /**
     *
     * @summary Create image registry
     * @param {ImageRegistryApiCreateImageRegistryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImageRegistryApi
     */
    createImageRegistry(requestParameters, options) {
        return (0, exports.ImageRegistryApiFp)(this.configuration).createImageRegistry(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Delete image registry
     * @param {ImageRegistryApiDeleteImageRegistryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImageRegistryApi
     */
    deleteImageRegistry(requestParameters, options) {
        return (0, exports.ImageRegistryApiFp)(this.configuration).deleteImageRegistry(requestParameters.imageRegistryName, requestParameters.imageRegistry, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Get image registry
     * @param {ImageRegistryApiGetImageRegistryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImageRegistryApi
     */
    getImageRegistry(requestParameters, options) {
        return (0, exports.ImageRegistryApiFp)(this.configuration).getImageRegistry(requestParameters.imageRegistryName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List image registries
     * @summary List image registries
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImageRegistryApi
     */
    listImageRegistries(options) {
        return (0, exports.ImageRegistryApiFp)(this.configuration).listImageRegistries(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * partially update the specified image registry
     * @summary Update image registry
     * @param {ImageRegistryApiPatchImageRegistryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImageRegistryApi
     */
    patchImageRegistry(requestParameters, options) {
        return (0, exports.ImageRegistryApiFp)(this.configuration).patchImageRegistry(requestParameters.imageRegistryName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.ImageRegistryApi = ImageRegistryApi;
//# sourceMappingURL=image-registry-api.js.map