"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.2-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 {
    /**
     * Creates request options for tenantsDomainsCreate without sending the request
     */
    async tenantsDomainsCreateRequestOpts(requestParameters) {
        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/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.DomainRequestToJSON)(requestParameters['domainRequest']),
        };
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsDomainsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsDomainsDestroy without sending the request
     */
    async tenantsDomainsDestroyRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsDestroyRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsDomainsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsDestroy(requestParameters, initOverrides) {
        await this.tenantsDomainsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for tenantsDomainsList without sending the request
     */
    async tenantsDomainsListRequestOpts(requestParameters) {
        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/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsDomainsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsDomainsPartialUpdate without sending the request
     */
    async tenantsDomainsPartialUpdateRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedDomainRequestToJSON)(requestParameters['patchedDomainRequest']),
        };
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsDomainsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsDomainsRetrieve without sending the request
     */
    async tenantsDomainsRetrieveRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsDomainsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsDomainsUpdate without sending the request
     */
    async tenantsDomainsUpdateRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.DomainRequestToJSON)(requestParameters['domainRequest']),
        };
    }
    /**
     * Domain ViewSet
     */
    async tenantsDomainsUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsDomainsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsTenantsCreate without sending the request
     */
    async tenantsTenantsCreateRequestOpts(requestParameters) {
        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/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantRequestToJSON)(requestParameters['tenantRequest']),
        };
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsTenantsCreateAdminGroupCreate without sending the request
     */
    async tenantsTenantsCreateAdminGroupCreateRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantAdminGroupRequestRequestToJSON)(requestParameters['tenantAdminGroupRequestRequest']),
        };
    }
    /**
     * Create admin group and add user to it.
     */
    async tenantsTenantsCreateAdminGroupCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsCreateAdminGroupCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Create admin group and add user to it.
     */
    async tenantsTenantsCreateAdminGroupCreate(requestParameters, initOverrides) {
        await this.tenantsTenantsCreateAdminGroupCreateRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for tenantsTenantsCreateRecoveryKeyCreate without sending the request
     */
    async tenantsTenantsCreateRecoveryKeyCreateRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantRecoveryKeyRequestRequestToJSON)(requestParameters['tenantRecoveryKeyRequestRequest']),
        };
    }
    /**
     * Create recovery key for user.
     */
    async tenantsTenantsCreateRecoveryKeyCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsCreateRecoveryKeyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsTenantsDestroy without sending the request
     */
    async tenantsTenantsDestroyRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsDestroyRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsDestroy(requestParameters, initOverrides) {
        await this.tenantsTenantsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for tenantsTenantsList without sending the request
     */
    async tenantsTenantsListRequestOpts(requestParameters) {
        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/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsTenantsPartialUpdate without sending the request
     */
    async tenantsTenantsPartialUpdateRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedTenantRequestToJSON)(requestParameters['patchedTenantRequest']),
        };
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsTenantsRetrieve without sending the request
     */
    async tenantsTenantsRetrieveRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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();
    }
    /**
     * Creates request options for tenantsTenantsUpdate without sending the request
     */
    async tenantsTenantsUpdateRequestOpts(requestParameters) {
        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'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.TenantRequestToJSON)(requestParameters['tenantRequest']),
        };
    }
    /**
     * Tenant Viewset
     */
    async tenantsTenantsUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tenantsTenantsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, 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