"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.OrganizationParameterApi = exports.OrganizationParameterApiFactory = exports.OrganizationParameterApiFp = exports.OrganizationParameterApiAxiosParamCreator = 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");
/**
 * OrganizationParameterApi - axios parameter creator
 * @export
 */
const OrganizationParameterApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Batch update parameters of an organization
         * @summary Batch update parameters of an organization
         * @param {string} orgName The name of the organization
         * @param {Array<OrgParameter>} orgParameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchUpdateOrgParameters: async (orgName, orgParameter, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('batchUpdateOrgParameters', 'orgName', orgName);
            // verify required parameter 'orgParameter' is not null or undefined
            (0, common_1.assertParamExists)('batchUpdateOrgParameters', 'orgParameter', orgParameter);
            const localVarPath = `/admin/v1/organizations/{orgName}/parameters`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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)(orgParameter, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Get a parameter of an organization
         * @param {string} orgName The name of the organization
         * @param {string} parameterName The name of the parameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getOrgParameter: async (orgName, parameterName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getOrgParameter', 'orgName', orgName);
            // verify required parameter 'parameterName' is not null or undefined
            (0, common_1.assertParamExists)('getOrgParameter', 'parameterName', parameterName);
            const localVarPath = `/admin/v1/organizations/{orgName}/parameters/{parameterName}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"parameterName"}}`, encodeURIComponent(String(parameterName)));
            // 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,
            };
        },
        /**
         *
         * @summary List parameters of an organization
         * @param {string} orgName The name of the organization
         * @param {string} [category] the category of the parameters
         * @param {string} [name] the name of the parameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listOrgParameters: async (orgName, category, name, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listOrgParameters', 'orgName', orgName);
            const localVarPath = `/admin/v1/organizations/{orgName}/parameters`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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);
            if (category !== undefined) {
                localVarQueryParameter['category'] = category;
            }
            if (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }
            (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,
            };
        },
        /**
         * Update a parameter of an organization
         * @summary Update a parameter of an organization
         * @param {string} orgName The name of the organization
         * @param {string} parameterName The name of the parameter
         * @param {OrgParameter} orgParameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchOrgParameter: async (orgName, parameterName, orgParameter, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('patchOrgParameter', 'orgName', orgName);
            // verify required parameter 'parameterName' is not null or undefined
            (0, common_1.assertParamExists)('patchOrgParameter', 'parameterName', parameterName);
            // verify required parameter 'orgParameter' is not null or undefined
            (0, common_1.assertParamExists)('patchOrgParameter', 'orgParameter', orgParameter);
            const localVarPath = `/admin/v1/organizations/{orgName}/parameters/{parameterName}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"parameterName"}}`, encodeURIComponent(String(parameterName)));
            // 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)(orgParameter, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.OrganizationParameterApiAxiosParamCreator = OrganizationParameterApiAxiosParamCreator;
/**
 * OrganizationParameterApi - functional programming interface
 * @export
 */
const OrganizationParameterApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.OrganizationParameterApiAxiosParamCreator)(configuration);
    return {
        /**
         * Batch update parameters of an organization
         * @summary Batch update parameters of an organization
         * @param {string} orgName The name of the organization
         * @param {Array<OrgParameter>} orgParameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async batchUpdateOrgParameters(orgName, orgParameter, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.batchUpdateOrgParameters(orgName, orgParameter, 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['OrganizationParameterApi.batchUpdateOrgParameters']) === 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 a parameter of an organization
         * @param {string} orgName The name of the organization
         * @param {string} parameterName The name of the parameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getOrgParameter(orgName, parameterName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getOrgParameter(orgName, parameterName, 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['OrganizationParameterApi.getOrgParameter']) === 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 List parameters of an organization
         * @param {string} orgName The name of the organization
         * @param {string} [category] the category of the parameters
         * @param {string} [name] the name of the parameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listOrgParameters(orgName, category, name, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgParameters(orgName, category, name, 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['OrganizationParameterApi.listOrgParameters']) === 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);
        },
        /**
         * Update a parameter of an organization
         * @summary Update a parameter of an organization
         * @param {string} orgName The name of the organization
         * @param {string} parameterName The name of the parameter
         * @param {OrgParameter} orgParameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchOrgParameter(orgName, parameterName, orgParameter, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchOrgParameter(orgName, parameterName, orgParameter, 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['OrganizationParameterApi.patchOrgParameter']) === 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.OrganizationParameterApiFp = OrganizationParameterApiFp;
/**
 * OrganizationParameterApi - factory interface
 * @export
 */
const OrganizationParameterApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.OrganizationParameterApiFp)(configuration);
    return {
        /**
         * Batch update parameters of an organization
         * @summary Batch update parameters of an organization
         * @param {OrganizationParameterApiBatchUpdateOrgParametersRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        batchUpdateOrgParameters(requestParameters, options) {
            return localVarFp.batchUpdateOrgParameters(requestParameters.orgName, requestParameters.orgParameter, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Get a parameter of an organization
         * @param {OrganizationParameterApiGetOrgParameterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getOrgParameter(requestParameters, options) {
            return localVarFp.getOrgParameter(requestParameters.orgName, requestParameters.parameterName, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List parameters of an organization
         * @param {OrganizationParameterApiListOrgParametersRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listOrgParameters(requestParameters, options) {
            return localVarFp.listOrgParameters(requestParameters.orgName, requestParameters.category, requestParameters.name, options).then((request) => request(axios, basePath));
        },
        /**
         * Update a parameter of an organization
         * @summary Update a parameter of an organization
         * @param {OrganizationParameterApiPatchOrgParameterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchOrgParameter(requestParameters, options) {
            return localVarFp.patchOrgParameter(requestParameters.orgName, requestParameters.parameterName, requestParameters.orgParameter, options).then((request) => request(axios, basePath));
        },
    };
};
exports.OrganizationParameterApiFactory = OrganizationParameterApiFactory;
/**
 * OrganizationParameterApi - object-oriented interface
 * @export
 * @class OrganizationParameterApi
 * @extends {BaseAPI}
 */
class OrganizationParameterApi extends base_1.BaseAPI {
    /**
     * Batch update parameters of an organization
     * @summary Batch update parameters of an organization
     * @param {OrganizationParameterApiBatchUpdateOrgParametersRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof OrganizationParameterApi
     */
    batchUpdateOrgParameters(requestParameters, options) {
        return (0, exports.OrganizationParameterApiFp)(this.configuration).batchUpdateOrgParameters(requestParameters.orgName, requestParameters.orgParameter, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Get a parameter of an organization
     * @param {OrganizationParameterApiGetOrgParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof OrganizationParameterApi
     */
    getOrgParameter(requestParameters, options) {
        return (0, exports.OrganizationParameterApiFp)(this.configuration).getOrgParameter(requestParameters.orgName, requestParameters.parameterName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List parameters of an organization
     * @param {OrganizationParameterApiListOrgParametersRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof OrganizationParameterApi
     */
    listOrgParameters(requestParameters, options) {
        return (0, exports.OrganizationParameterApiFp)(this.configuration).listOrgParameters(requestParameters.orgName, requestParameters.category, requestParameters.name, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update a parameter of an organization
     * @summary Update a parameter of an organization
     * @param {OrganizationParameterApiPatchOrgParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof OrganizationParameterApi
     */
    patchOrgParameter(requestParameters, options) {
        return (0, exports.OrganizationParameterApiFp)(this.configuration).patchOrgParameter(requestParameters.orgName, requestParameters.parameterName, requestParameters.orgParameter, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.OrganizationParameterApi = OrganizationParameterApi;
//# sourceMappingURL=organization-parameter-api.js.map