"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.TenantsApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class TenantsApi extends runtime.BaseAPI {
    /**
     * Domain ViewSet
     */
    async tenantsDomainsCreateRaw(requestParameters, initOverrides) {
        if (requestParameters['domainRequest'] == null) {
            throw new runtime.RequiredError('domainRequest', 'Required parameter "domainRequest" was null or undefined when calling tenantsDomainsCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/domains/`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.DomainRequestToJSON)(requestParameters['domainRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DomainFromJSON)(jsonValue));
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsCreate(requestParameters, initOverrides) {
        const response = await this.tenantsDomainsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsDestroyRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tenantsDomainsDestroy().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/tenants/domains/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsDestroy(requestParameters, initOverrides) {
        await this.tenantsDomainsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsListRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        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 = {};
        let urlPath = `/tenants/domains/`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedDomainListFromJSON)(jsonValue));
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsList(requestParameters = {}, initOverrides) {
        const response = await this.tenantsDomainsListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsPartialUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tenantsDomainsPartialUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/domains/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedDomainRequestToJSON)(requestParameters['patchedDomainRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DomainFromJSON)(jsonValue));
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsPartialUpdate(requestParameters, initOverrides) {
        const response = await this.tenantsDomainsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsRetrieveRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tenantsDomainsRetrieve().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/tenants/domains/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DomainFromJSON)(jsonValue));
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsRetrieve(requestParameters, initOverrides) {
        const response = await this.tenantsDomainsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tenantsDomainsUpdate().');
        }
        if (requestParameters['domainRequest'] == null) {
            throw new runtime.RequiredError('domainRequest', 'Required parameter "domainRequest" was null or undefined when calling tenantsDomainsUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/domains/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.DomainRequestToJSON)(requestParameters['domainRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DomainFromJSON)(jsonValue));
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsUpdate(requestParameters, initOverrides) {
        const response = await this.tenantsDomainsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsCreateRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantRequest'] == null) {
            throw new runtime.RequiredError('tenantRequest', 'Required parameter "tenantRequest" was null or undefined when calling tenantsTenantsCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/tenants/`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantRequestToJSON)(requestParameters['tenantRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TenantFromJSON)(jsonValue));
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsCreate(requestParameters, initOverrides) {
        const response = await this.tenantsTenantsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Create admin group and add user to it.
     */
    async tenantsTenantsCreateAdminGroupCreateRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantUuid'] == null) {
            throw new runtime.RequiredError('tenantUuid', 'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsCreateAdminGroupCreate().');
        }
        if (requestParameters['tenantAdminGroupRequestRequest'] == null) {
            throw new runtime.RequiredError('tenantAdminGroupRequestRequest', 'Required parameter "tenantAdminGroupRequestRequest" was null or undefined when calling tenantsTenantsCreateAdminGroupCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/tenants/{tenant_uuid}/create_admin_group/`;
        urlPath = urlPath.replace(`{${"tenant_uuid"}}`, encodeURIComponent(String(requestParameters['tenantUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantAdminGroupRequestRequestToJSON)(requestParameters['tenantAdminGroupRequestRequest']),
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Create admin group and add user to it.
     */
    async tenantsTenantsCreateAdminGroupCreate(requestParameters, initOverrides) {
        await this.tenantsTenantsCreateAdminGroupCreateRaw(requestParameters, initOverrides);
    }
    /**
     * Create recovery key for user.
     */
    async tenantsTenantsCreateRecoveryKeyCreateRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantUuid'] == null) {
            throw new runtime.RequiredError('tenantUuid', 'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsCreateRecoveryKeyCreate().');
        }
        if (requestParameters['tenantRecoveryKeyRequestRequest'] == null) {
            throw new runtime.RequiredError('tenantRecoveryKeyRequestRequest', 'Required parameter "tenantRecoveryKeyRequestRequest" was null or undefined when calling tenantsTenantsCreateRecoveryKeyCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/tenants/{tenant_uuid}/create_recovery_key/`;
        urlPath = urlPath.replace(`{${"tenant_uuid"}}`, encodeURIComponent(String(requestParameters['tenantUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantRecoveryKeyRequestRequestToJSON)(requestParameters['tenantRecoveryKeyRequestRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TenantRecoveryKeyResponseFromJSON)(jsonValue));
    }
    /**
     * Create recovery key for user.
     */
    async tenantsTenantsCreateRecoveryKeyCreate(requestParameters, initOverrides) {
        const response = await this.tenantsTenantsCreateRecoveryKeyCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsDestroyRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantUuid'] == null) {
            throw new runtime.RequiredError('tenantUuid', 'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsDestroy().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/tenants/tenants/{tenant_uuid}/`;
        urlPath = urlPath.replace(`{${"tenant_uuid"}}`, encodeURIComponent(String(requestParameters['tenantUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsDestroy(requestParameters, initOverrides) {
        await this.tenantsTenantsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsListRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        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 = {};
        let urlPath = `/tenants/tenants/`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedTenantListFromJSON)(jsonValue));
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsList(requestParameters = {}, initOverrides) {
        const response = await this.tenantsTenantsListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsPartialUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantUuid'] == null) {
            throw new runtime.RequiredError('tenantUuid', 'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsPartialUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/tenants/{tenant_uuid}/`;
        urlPath = urlPath.replace(`{${"tenant_uuid"}}`, encodeURIComponent(String(requestParameters['tenantUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedTenantRequestToJSON)(requestParameters['patchedTenantRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TenantFromJSON)(jsonValue));
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsPartialUpdate(requestParameters, initOverrides) {
        const response = await this.tenantsTenantsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsRetrieveRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantUuid'] == null) {
            throw new runtime.RequiredError('tenantUuid', 'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsRetrieve().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/tenants/tenants/{tenant_uuid}/`;
        urlPath = urlPath.replace(`{${"tenant_uuid"}}`, encodeURIComponent(String(requestParameters['tenantUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TenantFromJSON)(jsonValue));
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsRetrieve(requestParameters, initOverrides) {
        const response = await this.tenantsTenantsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['tenantUuid'] == null) {
            throw new runtime.RequiredError('tenantUuid', 'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsUpdate().');
        }
        if (requestParameters['tenantRequest'] == null) {
            throw new runtime.RequiredError('tenantRequest', 'Required parameter "tenantRequest" was null or undefined when calling tenantsTenantsUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/tenants/tenants/{tenant_uuid}/`;
        urlPath = urlPath.replace(`{${"tenant_uuid"}}`, encodeURIComponent(String(requestParameters['tenantUuid'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantRequestToJSON)(requestParameters['tenantRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TenantFromJSON)(jsonValue));
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsUpdate(requestParameters, initOverrides) {
        const response = await this.tenantsTenantsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.TenantsApi = TenantsApi;
//# sourceMappingURL=TenantsApi.js.map