"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.0-rc1
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnterpriseApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class EnterpriseApi extends runtime.BaseAPI {
    /**
     * License Viewset
     */
    async enterpriseLicenseCreateRaw(requestParameters, initOverrides) {
        if (requestParameters['licenseRequest'] == null) {
            throw new runtime.RequiredError('licenseRequest', 'Required parameter "licenseRequest" was null or undefined when calling enterpriseLicenseCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.LicenseRequestToJSON)(requestParameters['licenseRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LicenseFromJSON)(jsonValue));
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseCreate(requestParameters, initOverrides) {
        const response = await this.enterpriseLicenseCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseDestroyRaw(requestParameters, initOverrides) {
        if (requestParameters['licenseUuid'] == null) {
            throw new runtime.RequiredError('licenseUuid', 'Required parameter "licenseUuid" was null or undefined when calling enterpriseLicenseDestroy().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/{license_uuid}/`;
        urlPath = urlPath.replace(`{${"license_uuid"}}`, encodeURIComponent(String(requestParameters['licenseUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseDestroy(requestParameters, initOverrides) {
        await this.enterpriseLicenseDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Forecast how many users will be required in a year
     */
    async enterpriseLicenseForecastRetrieveRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/forecast/`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LicenseForecastFromJSON)(jsonValue));
    }
    /**
     * Forecast how many users will be required in a year
     */
    async enterpriseLicenseForecastRetrieve(initOverrides) {
        const response = await this.enterpriseLicenseForecastRetrieveRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get install_id
     */
    async enterpriseLicenseInstallIdRetrieveRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/install_id/`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.InstallIDFromJSON)(jsonValue));
    }
    /**
     * Get install_id
     */
    async enterpriseLicenseInstallIdRetrieve(initOverrides) {
        const response = await this.enterpriseLicenseInstallIdRetrieveRaw(initOverrides);
        return await response.value();
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseListRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['name'] != null) {
            queryParameters['name'] = requestParameters['name'];
        }
        if (requestParameters['ordering'] != null) {
            queryParameters['ordering'] = requestParameters['ordering'];
        }
        if (requestParameters['page'] != null) {
            queryParameters['page'] = requestParameters['page'];
        }
        if (requestParameters['pageSize'] != null) {
            queryParameters['page_size'] = requestParameters['pageSize'];
        }
        if (requestParameters['search'] != null) {
            queryParameters['search'] = requestParameters['search'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedLicenseListFromJSON)(jsonValue));
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseList(requestParameters = {}, initOverrides) {
        const response = await this.enterpriseLicenseListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * License Viewset
     */
    async enterpriseLicensePartialUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['licenseUuid'] == null) {
            throw new runtime.RequiredError('licenseUuid', 'Required parameter "licenseUuid" was null or undefined when calling enterpriseLicensePartialUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/{license_uuid}/`;
        urlPath = urlPath.replace(`{${"license_uuid"}}`, encodeURIComponent(String(requestParameters['licenseUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedLicenseRequestToJSON)(requestParameters['patchedLicenseRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LicenseFromJSON)(jsonValue));
    }
    /**
     * License Viewset
     */
    async enterpriseLicensePartialUpdate(requestParameters, initOverrides) {
        const response = await this.enterpriseLicensePartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseRetrieveRaw(requestParameters, initOverrides) {
        if (requestParameters['licenseUuid'] == null) {
            throw new runtime.RequiredError('licenseUuid', 'Required parameter "licenseUuid" was null or undefined when calling enterpriseLicenseRetrieve().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/{license_uuid}/`;
        urlPath = urlPath.replace(`{${"license_uuid"}}`, encodeURIComponent(String(requestParameters['licenseUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LicenseFromJSON)(jsonValue));
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseRetrieve(requestParameters, initOverrides) {
        const response = await this.enterpriseLicenseRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get the total license status
     */
    async enterpriseLicenseSummaryRetrieveRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['cached'] != null) {
            queryParameters['cached'] = requestParameters['cached'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/summary/`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LicenseSummaryFromJSON)(jsonValue));
    }
    /**
     * Get the total license status
     */
    async enterpriseLicenseSummaryRetrieve(requestParameters = {}, initOverrides) {
        const response = await this.enterpriseLicenseSummaryRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['licenseUuid'] == null) {
            throw new runtime.RequiredError('licenseUuid', 'Required parameter "licenseUuid" was null or undefined when calling enterpriseLicenseUpdate().');
        }
        if (requestParameters['licenseRequest'] == null) {
            throw new runtime.RequiredError('licenseRequest', 'Required parameter "licenseRequest" was null or undefined when calling enterpriseLicenseUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/{license_uuid}/`;
        urlPath = urlPath.replace(`{${"license_uuid"}}`, encodeURIComponent(String(requestParameters['licenseUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.LicenseRequestToJSON)(requestParameters['licenseRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LicenseFromJSON)(jsonValue));
    }
    /**
     * License Viewset
     */
    async enterpriseLicenseUpdate(requestParameters, initOverrides) {
        const response = await this.enterpriseLicenseUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get a list of all objects that use this object
     */
    async enterpriseLicenseUsedByListRaw(requestParameters, initOverrides) {
        if (requestParameters['licenseUuid'] == null) {
            throw new runtime.RequiredError('licenseUuid', 'Required parameter "licenseUuid" was null or undefined when calling enterpriseLicenseUsedByList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/enterprise/license/{license_uuid}/used_by/`;
        urlPath = urlPath.replace(`{${"license_uuid"}}`, encodeURIComponent(String(requestParameters['licenseUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UsedByFromJSON));
    }
    /**
     * Get a list of all objects that use this object
     */
    async enterpriseLicenseUsedByList(requestParameters, initOverrides) {
        const response = await this.enterpriseLicenseUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.EnterpriseApi = EnterpriseApi;
//# sourceMappingURL=EnterpriseApi.js.map