/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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.
 */

import type {
    Domain,
    DomainRequest,
    PaginatedDomainList,
    PaginatedTenantList,
    PatchedDomainRequest,
    PatchedTenantRequest,
    Tenant,
    TenantAdminGroupRequestRequest,
    TenantRecoveryKeyRequestRequest,
    TenantRecoveryKeyResponse,
    TenantRequest,
} from "../models/index";
import {
    DomainFromJSON,
    DomainRequestToJSON,
    PaginatedDomainListFromJSON,
    PaginatedTenantListFromJSON,
    PatchedDomainRequestToJSON,
    PatchedTenantRequestToJSON,
    TenantAdminGroupRequestRequestToJSON,
    TenantFromJSON,
    TenantRecoveryKeyRequestRequestToJSON,
    TenantRecoveryKeyResponseFromJSON,
    TenantRequestToJSON,
} from "../models/index";
import * as runtime from "../runtime";

export interface TenantsDomainsCreateRequest {
    domainRequest: DomainRequest;
}

export interface TenantsDomainsDestroyRequest {
    id: number;
}

export interface TenantsDomainsListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface TenantsDomainsPartialUpdateRequest {
    id: number;
    patchedDomainRequest?: PatchedDomainRequest;
}

export interface TenantsDomainsRetrieveRequest {
    id: number;
}

export interface TenantsDomainsUpdateRequest {
    id: number;
    domainRequest: DomainRequest;
}

export interface TenantsTenantsCreateRequest {
    tenantRequest: TenantRequest;
}

export interface TenantsTenantsCreateAdminGroupCreateRequest {
    tenantUuid: string;
    tenantAdminGroupRequestRequest: TenantAdminGroupRequestRequest;
}

export interface TenantsTenantsCreateRecoveryKeyCreateRequest {
    tenantUuid: string;
    tenantRecoveryKeyRequestRequest: TenantRecoveryKeyRequestRequest;
}

export interface TenantsTenantsDestroyRequest {
    tenantUuid: string;
}

export interface TenantsTenantsListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface TenantsTenantsPartialUpdateRequest {
    tenantUuid: string;
    patchedTenantRequest?: PatchedTenantRequest;
}

export interface TenantsTenantsRetrieveRequest {
    tenantUuid: string;
}

export interface TenantsTenantsUpdateRequest {
    tenantUuid: string;
    tenantRequest: TenantRequest;
}

/**
 *
 */
export class TenantsApi extends runtime.BaseAPI {
    /**
     * Creates request options for tenantsDomainsCreate without sending the request
     */
    async tenantsDomainsCreateRequestOpts(
        requestParameters: TenantsDomainsCreateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["domainRequest"] == null) {
            throw new runtime.RequiredError(
                "domainRequest",
                'Required parameter "domainRequest" was null or undefined when calling tenantsDomainsCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters["Content-Type"] = "application/json";

        let urlPath = `/tenants/domains/`;

        return {
            path: urlPath,
            method: "POST",
            headers: headerParameters,
            query: queryParameters,
            body: DomainRequestToJSON(requestParameters["domainRequest"]),
        };
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsCreateRaw(
        requestParameters: TenantsDomainsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Domain>> {
        const requestOptions = await this.tenantsDomainsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => DomainFromJSON(jsonValue));
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsCreate(
        requestParameters: TenantsDomainsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Domain> {
        const response = await this.tenantsDomainsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsDomainsDestroy without sending the request
     */
    async tenantsDomainsDestroyRequestOpts(
        requestParameters: TenantsDomainsDestroyRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["id"] == null) {
            throw new runtime.RequiredError(
                "id",
                'Required parameter "id" was null or undefined when calling tenantsDomainsDestroy().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantsDomainsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.tenantsDomainsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsDestroy(
        requestParameters: TenantsDomainsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.tenantsDomainsDestroyRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for tenantsDomainsList without sending the request
     */
    async tenantsDomainsListRequestOpts(
        requestParameters: TenantsDomainsListRequest,
    ): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        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: runtime.HTTPHeaders = {};

        let urlPath = `/tenants/domains/`;

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsListRaw(
        requestParameters: TenantsDomainsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedDomainList>> {
        const requestOptions = await this.tenantsDomainsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) =>
            PaginatedDomainListFromJSON(jsonValue),
        );
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsList(
        requestParameters: TenantsDomainsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedDomainList> {
        const response = await this.tenantsDomainsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsDomainsPartialUpdate without sending the request
     */
    async tenantsDomainsPartialUpdateRequestOpts(
        requestParameters: TenantsDomainsPartialUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["id"] == null) {
            throw new runtime.RequiredError(
                "id",
                'Required parameter "id" was null or undefined when calling tenantsDomainsPartialUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: PatchedDomainRequestToJSON(requestParameters["patchedDomainRequest"]),
        };
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsPartialUpdateRaw(
        requestParameters: TenantsDomainsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Domain>> {
        const requestOptions = await this.tenantsDomainsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => DomainFromJSON(jsonValue));
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsPartialUpdate(
        requestParameters: TenantsDomainsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Domain> {
        const response = await this.tenantsDomainsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

    /**
     * Creates request options for tenantsDomainsRetrieve without sending the request
     */
    async tenantsDomainsRetrieveRequestOpts(
        requestParameters: TenantsDomainsRetrieveRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["id"] == null) {
            throw new runtime.RequiredError(
                "id",
                'Required parameter "id" was null or undefined when calling tenantsDomainsRetrieve().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantsDomainsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Domain>> {
        const requestOptions = await this.tenantsDomainsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => DomainFromJSON(jsonValue));
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsRetrieve(
        requestParameters: TenantsDomainsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Domain> {
        const response = await this.tenantsDomainsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsDomainsUpdate without sending the request
     */
    async tenantsDomainsUpdateRequestOpts(
        requestParameters: TenantsDomainsUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        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: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: DomainRequestToJSON(requestParameters["domainRequest"]),
        };
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsUpdateRaw(
        requestParameters: TenantsDomainsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Domain>> {
        const requestOptions = await this.tenantsDomainsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => DomainFromJSON(jsonValue));
    }

    /**
     * Domain ViewSet
     */
    async tenantsDomainsUpdate(
        requestParameters: TenantsDomainsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Domain> {
        const response = await this.tenantsDomainsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsTenantsCreate without sending the request
     */
    async tenantsTenantsCreateRequestOpts(
        requestParameters: TenantsTenantsCreateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["tenantRequest"] == null) {
            throw new runtime.RequiredError(
                "tenantRequest",
                'Required parameter "tenantRequest" was null or undefined when calling tenantsTenantsCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters["Content-Type"] = "application/json";

        let urlPath = `/tenants/tenants/`;

        return {
            path: urlPath,
            method: "POST",
            headers: headerParameters,
            query: queryParameters,
            body: TenantRequestToJSON(requestParameters["tenantRequest"]),
        };
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsCreateRaw(
        requestParameters: TenantsTenantsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Tenant>> {
        const requestOptions = await this.tenantsTenantsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TenantFromJSON(jsonValue));
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsCreate(
        requestParameters: TenantsTenantsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Tenant> {
        const response = await this.tenantsTenantsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsTenantsCreateAdminGroupCreate without sending the request
     */
    async tenantsTenantsCreateAdminGroupCreateRequestOpts(
        requestParameters: TenantsTenantsCreateAdminGroupCreateRequest,
    ): Promise<runtime.RequestOpts> {
        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: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantAdminGroupRequestRequestToJSON(
                requestParameters["tenantAdminGroupRequestRequest"],
            ),
        };
    }

    /**
     * Create admin group and add user to it.
     */
    async tenantsTenantsCreateAdminGroupCreateRaw(
        requestParameters: TenantsTenantsCreateAdminGroupCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        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: TenantsTenantsCreateAdminGroupCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.tenantsTenantsCreateAdminGroupCreateRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for tenantsTenantsCreateRecoveryKeyCreate without sending the request
     */
    async tenantsTenantsCreateRecoveryKeyCreateRequestOpts(
        requestParameters: TenantsTenantsCreateRecoveryKeyCreateRequest,
    ): Promise<runtime.RequestOpts> {
        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: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantRecoveryKeyRequestRequestToJSON(
                requestParameters["tenantRecoveryKeyRequestRequest"],
            ),
        };
    }

    /**
     * Create recovery key for user.
     */
    async tenantsTenantsCreateRecoveryKeyCreateRaw(
        requestParameters: TenantsTenantsCreateRecoveryKeyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TenantRecoveryKeyResponse>> {
        const requestOptions =
            await this.tenantsTenantsCreateRecoveryKeyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) =>
            TenantRecoveryKeyResponseFromJSON(jsonValue),
        );
    }

    /**
     * Create recovery key for user.
     */
    async tenantsTenantsCreateRecoveryKeyCreate(
        requestParameters: TenantsTenantsCreateRecoveryKeyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TenantRecoveryKeyResponse> {
        const response = await this.tenantsTenantsCreateRecoveryKeyCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

    /**
     * Creates request options for tenantsTenantsDestroy without sending the request
     */
    async tenantsTenantsDestroyRequestOpts(
        requestParameters: TenantsTenantsDestroyRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["tenantUuid"] == null) {
            throw new runtime.RequiredError(
                "tenantUuid",
                'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsDestroy().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantsTenantsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.tenantsTenantsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsDestroy(
        requestParameters: TenantsTenantsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.tenantsTenantsDestroyRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for tenantsTenantsList without sending the request
     */
    async tenantsTenantsListRequestOpts(
        requestParameters: TenantsTenantsListRequest,
    ): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        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: runtime.HTTPHeaders = {};

        let urlPath = `/tenants/tenants/`;

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsListRaw(
        requestParameters: TenantsTenantsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedTenantList>> {
        const requestOptions = await this.tenantsTenantsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) =>
            PaginatedTenantListFromJSON(jsonValue),
        );
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsList(
        requestParameters: TenantsTenantsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedTenantList> {
        const response = await this.tenantsTenantsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsTenantsPartialUpdate without sending the request
     */
    async tenantsTenantsPartialUpdateRequestOpts(
        requestParameters: TenantsTenantsPartialUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["tenantUuid"] == null) {
            throw new runtime.RequiredError(
                "tenantUuid",
                'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsPartialUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: PatchedTenantRequestToJSON(requestParameters["patchedTenantRequest"]),
        };
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsPartialUpdateRaw(
        requestParameters: TenantsTenantsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Tenant>> {
        const requestOptions = await this.tenantsTenantsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TenantFromJSON(jsonValue));
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsPartialUpdate(
        requestParameters: TenantsTenantsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Tenant> {
        const response = await this.tenantsTenantsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

    /**
     * Creates request options for tenantsTenantsRetrieve without sending the request
     */
    async tenantsTenantsRetrieveRequestOpts(
        requestParameters: TenantsTenantsRetrieveRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["tenantUuid"] == null) {
            throw new runtime.RequiredError(
                "tenantUuid",
                'Required parameter "tenantUuid" was null or undefined when calling tenantsTenantsRetrieve().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantsTenantsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Tenant>> {
        const requestOptions = await this.tenantsTenantsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TenantFromJSON(jsonValue));
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsRetrieve(
        requestParameters: TenantsTenantsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Tenant> {
        const response = await this.tenantsTenantsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for tenantsTenantsUpdate without sending the request
     */
    async tenantsTenantsUpdateRequestOpts(
        requestParameters: TenantsTenantsUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        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: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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: TenantRequestToJSON(requestParameters["tenantRequest"]),
        };
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsUpdateRaw(
        requestParameters: TenantsTenantsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Tenant>> {
        const requestOptions = await this.tenantsTenantsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TenantFromJSON(jsonValue));
    }

    /**
     * Tenant Viewset
     */
    async tenantsTenantsUpdate(
        requestParameters: TenantsTenantsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Tenant> {
        const response = await this.tenantsTenantsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
