/* 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 {
    Application,
    ApplicationEntitlement,
    ApplicationEntitlementRequest,
    ApplicationRequest,
    AuthenticatedSession,
    Brand,
    BrandRequest,
    BulkDeleteSessionResponse,
    CurrentBrand,
    DataExport,
    Group,
    GroupRequest,
    ImpersonationRequest,
    IntentEnum,
    Link,
    PaginatedApplicationEntitlementList,
    PaginatedApplicationList,
    PaginatedAuthenticatedSessionList,
    PaginatedBrandList,
    PaginatedGroupList,
    PaginatedTokenList,
    PaginatedUserConsentList,
    PaginatedUserList,
    PatchedApplicationEntitlementRequest,
    PatchedApplicationRequest,
    PatchedBrandRequest,
    PatchedGroupRequest,
    PatchedTokenRequest,
    PatchedUserRequest,
    PolicyTestResult,
    SessionUser,
    Token,
    TokenRequest,
    TokenSetKeyRequest,
    TokenView,
    TransactionApplicationRequest,
    TransactionApplicationResponse,
    UsedBy,
    User,
    UserAccountRequest,
    UserConsent,
    UserPasswordSetRequest,
    UserPath,
    UserRecoveryEmailRequest,
    UserRecoveryLinkRequest,
    UserRequest,
    UserServiceAccountRequest,
    UserServiceAccountResponse,
    UserTypeEnum,
} from "../models/index";
import {
    ApplicationEntitlementFromJSON,
    ApplicationEntitlementRequestToJSON,
    ApplicationFromJSON,
    ApplicationRequestToJSON,
    AuthenticatedSessionFromJSON,
    BrandFromJSON,
    BrandRequestToJSON,
    BulkDeleteSessionResponseFromJSON,
    CurrentBrandFromJSON,
    DataExportFromJSON,
    GroupFromJSON,
    GroupRequestToJSON,
    ImpersonationRequestToJSON,
    LinkFromJSON,
    PaginatedApplicationEntitlementListFromJSON,
    PaginatedApplicationListFromJSON,
    PaginatedAuthenticatedSessionListFromJSON,
    PaginatedBrandListFromJSON,
    PaginatedGroupListFromJSON,
    PaginatedTokenListFromJSON,
    PaginatedUserConsentListFromJSON,
    PaginatedUserListFromJSON,
    PatchedApplicationEntitlementRequestToJSON,
    PatchedApplicationRequestToJSON,
    PatchedBrandRequestToJSON,
    PatchedGroupRequestToJSON,
    PatchedTokenRequestToJSON,
    PatchedUserRequestToJSON,
    PolicyTestResultFromJSON,
    SessionUserFromJSON,
    TokenFromJSON,
    TokenRequestToJSON,
    TokenSetKeyRequestToJSON,
    TokenViewFromJSON,
    TransactionApplicationRequestToJSON,
    TransactionApplicationResponseFromJSON,
    UsedByFromJSON,
    UserAccountRequestToJSON,
    UserConsentFromJSON,
    UserFromJSON,
    UserPasswordSetRequestToJSON,
    UserPathFromJSON,
    UserRecoveryEmailRequestToJSON,
    UserRecoveryLinkRequestToJSON,
    UserRequestToJSON,
    UserServiceAccountRequestToJSON,
    UserServiceAccountResponseFromJSON,
} from "../models/index";
import * as runtime from "../runtime";

export interface CoreApplicationEntitlementsCreateRequest {
    applicationEntitlementRequest: ApplicationEntitlementRequest;
}

export interface CoreApplicationEntitlementsDestroyRequest {
    pbmUuid: string;
}

export interface CoreApplicationEntitlementsListRequest {
    app?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    search?: string;
}

export interface CoreApplicationEntitlementsPartialUpdateRequest {
    pbmUuid: string;
    patchedApplicationEntitlementRequest?: PatchedApplicationEntitlementRequest;
}

export interface CoreApplicationEntitlementsRetrieveRequest {
    pbmUuid: string;
}

export interface CoreApplicationEntitlementsUpdateRequest {
    pbmUuid: string;
    applicationEntitlementRequest: ApplicationEntitlementRequest;
}

export interface CoreApplicationEntitlementsUsedByListRequest {
    pbmUuid: string;
}

export interface CoreApplicationsCheckAccessRetrieveRequest {
    slug: string;
    forUser?: number;
}

export interface CoreApplicationsCreateRequest {
    applicationRequest: ApplicationRequest;
}

export interface CoreApplicationsDestroyRequest {
    slug: string;
}

export interface CoreApplicationsListRequest {
    forUser?: number;
    group?: string;
    metaDescription?: string;
    metaLaunchUrl?: string;
    metaPublisher?: string;
    name?: string;
    onlyWithLaunchUrl?: boolean;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    slug?: string;
    superuserFullList?: boolean;
}

export interface CoreApplicationsPartialUpdateRequest {
    slug: string;
    patchedApplicationRequest?: PatchedApplicationRequest;
}

export interface CoreApplicationsRetrieveRequest {
    slug: string;
}

export interface CoreApplicationsUpdateRequest {
    slug: string;
    applicationRequest: ApplicationRequest;
}

export interface CoreApplicationsUsedByListRequest {
    slug: string;
}

export interface CoreAuthenticatedSessionsBulkDeleteDestroyRequest {
    userPks: Array<number>;
}

export interface CoreAuthenticatedSessionsDestroyRequest {
    uuid: string;
}

export interface CoreAuthenticatedSessionsListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sessionLastIp?: string;
    sessionLastUserAgent?: string;
    userUsername?: string;
}

export interface CoreAuthenticatedSessionsRetrieveRequest {
    uuid: string;
}

export interface CoreAuthenticatedSessionsUsedByListRequest {
    uuid: string;
}

export interface CoreBrandsCreateRequest {
    brandRequest: BrandRequest;
}

export interface CoreBrandsDestroyRequest {
    brandUuid: string;
}

export interface CoreBrandsListRequest {
    brandUuid?: string;
    brandingDefaultFlowBackground?: string;
    brandingFavicon?: string;
    brandingLogo?: string;
    brandingTitle?: string;
    clientCertificates?: Array<string>;
    _default?: boolean;
    domain?: string;
    flowAuthentication?: string;
    flowDeviceCode?: string;
    flowInvalidation?: string;
    flowRecovery?: string;
    flowUnenrollment?: string;
    flowUserSettings?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    webCertificate?: string;
}

export interface CoreBrandsPartialUpdateRequest {
    brandUuid: string;
    patchedBrandRequest?: PatchedBrandRequest;
}

export interface CoreBrandsRetrieveRequest {
    brandUuid: string;
}

export interface CoreBrandsUpdateRequest {
    brandUuid: string;
    brandRequest: BrandRequest;
}

export interface CoreBrandsUsedByListRequest {
    brandUuid: string;
}

export interface CoreGroupsAddUserCreateRequest {
    groupUuid: string;
    userAccountRequest: UserAccountRequest;
}

export interface CoreGroupsCreateRequest {
    groupRequest: GroupRequest;
}

export interface CoreGroupsDestroyRequest {
    groupUuid: string;
}

export interface CoreGroupsListRequest {
    attributes?: string;
    includeChildren?: boolean;
    includeInheritedRoles?: boolean;
    includeParents?: boolean;
    includeUsers?: boolean;
    isSuperuser?: boolean;
    membersByPk?: Array<number>;
    membersByUsername?: Array<string>;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface CoreGroupsPartialUpdateRequest {
    groupUuid: string;
    patchedGroupRequest?: PatchedGroupRequest;
}

export interface CoreGroupsRemoveUserCreateRequest {
    groupUuid: string;
    userAccountRequest: UserAccountRequest;
}

export interface CoreGroupsRetrieveRequest {
    groupUuid: string;
    includeChildren?: boolean;
    includeInheritedRoles?: boolean;
    includeParents?: boolean;
    includeUsers?: boolean;
}

export interface CoreGroupsUpdateRequest {
    groupUuid: string;
    groupRequest: GroupRequest;
}

export interface CoreGroupsUsedByListRequest {
    groupUuid: string;
}

export interface CoreTokensCreateRequest {
    tokenRequest: TokenRequest;
}

export interface CoreTokensDestroyRequest {
    identifier: string;
}

export interface CoreTokensListRequest {
    description?: string;
    expires?: Date;
    expiring?: boolean;
    identifier?: string;
    intent?: IntentEnum;
    managed?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    userUsername?: string;
}

export interface CoreTokensPartialUpdateRequest {
    identifier: string;
    patchedTokenRequest?: PatchedTokenRequest;
}

export interface CoreTokensRetrieveRequest {
    identifier: string;
}

export interface CoreTokensSetKeyCreateRequest {
    identifier: string;
    tokenSetKeyRequest: TokenSetKeyRequest;
}

export interface CoreTokensUpdateRequest {
    identifier: string;
    tokenRequest: TokenRequest;
}

export interface CoreTokensUsedByListRequest {
    identifier: string;
}

export interface CoreTokensViewKeyRetrieveRequest {
    identifier: string;
}

export interface CoreTransactionalApplicationsUpdateRequest {
    transactionApplicationRequest: TransactionApplicationRequest;
}

export interface CoreUserConsentDestroyRequest {
    id: number;
}

export interface CoreUserConsentListRequest {
    application?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    user?: number;
}

export interface CoreUserConsentRetrieveRequest {
    id: number;
}

export interface CoreUserConsentUsedByListRequest {
    id: number;
}

export interface CoreUsersCreateRequest {
    userRequest: UserRequest;
}

export interface CoreUsersDestroyRequest {
    id: number;
}

export interface CoreUsersExportCreateRequest {
    attributes?: string;
    dateJoined?: Date;
    dateJoinedGt?: Date;
    dateJoinedLt?: Date;
    email?: string;
    groupsByName?: Array<string>;
    groupsByPk?: Array<string>;
    isActive?: boolean;
    isSuperuser?: boolean;
    lastLogin?: Date;
    lastLoginGt?: Date;
    lastLoginIsnull?: boolean;
    lastLoginLt?: Date;
    lastUpdated?: Date;
    lastUpdatedGt?: Date;
    lastUpdatedLt?: Date;
    name?: string;
    ordering?: string;
    path?: string;
    pathStartswith?: string;
    rolesByName?: Array<string>;
    rolesByPk?: Array<string>;
    search?: string;
    type?: Array<UserTypeEnum>;
    username?: string;
    uuid?: string;
}

export interface CoreUsersImpersonateCreateRequest {
    id: number;
    impersonationRequest: ImpersonationRequest;
}

export interface CoreUsersListRequest {
    attributes?: string;
    dateJoined?: Date;
    dateJoinedGt?: Date;
    dateJoinedLt?: Date;
    email?: string;
    groupsByName?: Array<string>;
    groupsByPk?: Array<string>;
    includeGroups?: boolean;
    includeRoles?: boolean;
    isActive?: boolean;
    isSuperuser?: boolean;
    lastLogin?: Date;
    lastLoginGt?: Date;
    lastLoginIsnull?: boolean;
    lastLoginLt?: Date;
    lastUpdated?: Date;
    lastUpdatedGt?: Date;
    lastUpdatedLt?: Date;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    path?: string;
    pathStartswith?: string;
    rolesByName?: Array<string>;
    rolesByPk?: Array<string>;
    search?: string;
    type?: Array<UserTypeEnum>;
    username?: string;
    uuid?: string;
}

export interface CoreUsersPartialUpdateRequest {
    id: number;
    patchedUserRequest?: PatchedUserRequest;
}

export interface CoreUsersPathsRetrieveRequest {
    search?: string;
}

export interface CoreUsersRecoveryCreateRequest {
    id: number;
    userRecoveryLinkRequest?: UserRecoveryLinkRequest;
}

export interface CoreUsersRecoveryEmailCreateRequest {
    id: number;
    userRecoveryEmailRequest: UserRecoveryEmailRequest;
}

export interface CoreUsersRetrieveRequest {
    id: number;
}

export interface CoreUsersServiceAccountCreateRequest {
    userServiceAccountRequest: UserServiceAccountRequest;
}

export interface CoreUsersSetPasswordCreateRequest {
    id: number;
    userPasswordSetRequest: UserPasswordSetRequest;
}

export interface CoreUsersUpdateRequest {
    id: number;
    userRequest: UserRequest;
}

export interface CoreUsersUsedByListRequest {
    id: number;
}

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/application_entitlements/`;

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsCreateRaw(
        requestParameters: CoreApplicationEntitlementsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ApplicationEntitlement>> {
        const requestOptions =
            await this.coreApplicationEntitlementsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsCreate(
        requestParameters: CoreApplicationEntitlementsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ApplicationEntitlement> {
        const response = await this.coreApplicationEntitlementsCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/application_entitlements/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsDestroyRaw(
        requestParameters: CoreApplicationEntitlementsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.coreApplicationEntitlementsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsDestroy(
        requestParameters: CoreApplicationEntitlementsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreApplicationEntitlementsDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["app"] != null) {
            queryParameters["app"] = requestParameters["app"];
        }

        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["pbmUuid"] != null) {
            queryParameters["pbm_uuid"] = requestParameters["pbmUuid"];
        }

        if (requestParameters["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/application_entitlements/`;

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsListRaw(
        requestParameters: CoreApplicationEntitlementsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedApplicationEntitlementList>> {
        const requestOptions =
            await this.coreApplicationEntitlementsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsList(
        requestParameters: CoreApplicationEntitlementsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedApplicationEntitlementList> {
        const response = await this.coreApplicationEntitlementsListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/application_entitlements/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedApplicationEntitlementRequestToJSON(
                requestParameters["patchedApplicationEntitlementRequest"],
            ),
        };
    }

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsPartialUpdateRaw(
        requestParameters: CoreApplicationEntitlementsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ApplicationEntitlement>> {
        const requestOptions =
            await this.coreApplicationEntitlementsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsPartialUpdate(
        requestParameters: CoreApplicationEntitlementsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ApplicationEntitlement> {
        const response = await this.coreApplicationEntitlementsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/application_entitlements/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsRetrieveRaw(
        requestParameters: CoreApplicationEntitlementsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ApplicationEntitlement>> {
        const requestOptions =
            await this.coreApplicationEntitlementsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsRetrieve(
        requestParameters: CoreApplicationEntitlementsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ApplicationEntitlement> {
        const response = await this.coreApplicationEntitlementsRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        if (requestParameters["applicationEntitlementRequest"] == null) {
            throw new runtime.RequiredError(
                "applicationEntitlementRequest",
                'Required parameter "applicationEntitlementRequest" was null or undefined when calling coreApplicationEntitlementsUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/application_entitlements/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: ApplicationEntitlementRequestToJSON(
                requestParameters["applicationEntitlementRequest"],
            ),
        };
    }

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsUpdateRaw(
        requestParameters: CoreApplicationEntitlementsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ApplicationEntitlement>> {
        const requestOptions =
            await this.coreApplicationEntitlementsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ApplicationEntitlement Viewset
     */
    async coreApplicationEntitlementsUpdate(
        requestParameters: CoreApplicationEntitlementsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ApplicationEntitlement> {
        const response = await this.coreApplicationEntitlementsUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/application_entitlements/{pbm_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async coreApplicationEntitlementsUsedByListRaw(
        requestParameters: CoreApplicationEntitlementsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.coreApplicationEntitlementsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreApplicationEntitlementsUsedByList(
        requestParameters: CoreApplicationEntitlementsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreApplicationEntitlementsUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        if (requestParameters["forUser"] != null) {
            queryParameters["for_user"] = requestParameters["forUser"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/applications/{slug}/check_access/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Check access to a single application by slug
     */
    async coreApplicationsCheckAccessRetrieveRaw(
        requestParameters: CoreApplicationsCheckAccessRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PolicyTestResult>> {
        const requestOptions =
            await this.coreApplicationsCheckAccessRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Check access to a single application by slug
     */
    async coreApplicationsCheckAccessRetrieve(
        requestParameters: CoreApplicationsCheckAccessRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PolicyTestResult> {
        const response = await this.coreApplicationsCheckAccessRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/applications/`;

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

    /**
     * Application Viewset
     */
    async coreApplicationsCreateRaw(
        requestParameters: CoreApplicationsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Application>> {
        const requestOptions = await this.coreApplicationsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Application Viewset
     */
    async coreApplicationsCreate(
        requestParameters: CoreApplicationsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Application> {
        const response = await this.coreApplicationsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/applications/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Application Viewset
     */
    async coreApplicationsDestroyRaw(
        requestParameters: CoreApplicationsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreApplicationsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Application Viewset
     */
    async coreApplicationsDestroy(
        requestParameters: CoreApplicationsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreApplicationsDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["forUser"] != null) {
            queryParameters["for_user"] = requestParameters["forUser"];
        }

        if (requestParameters["group"] != null) {
            queryParameters["group"] = requestParameters["group"];
        }

        if (requestParameters["metaDescription"] != null) {
            queryParameters["meta_description"] = requestParameters["metaDescription"];
        }

        if (requestParameters["metaLaunchUrl"] != null) {
            queryParameters["meta_launch_url"] = requestParameters["metaLaunchUrl"];
        }

        if (requestParameters["metaPublisher"] != null) {
            queryParameters["meta_publisher"] = requestParameters["metaPublisher"];
        }

        if (requestParameters["name"] != null) {
            queryParameters["name"] = requestParameters["name"];
        }

        if (requestParameters["onlyWithLaunchUrl"] != null) {
            queryParameters["only_with_launch_url"] = requestParameters["onlyWithLaunchUrl"];
        }

        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"];
        }

        if (requestParameters["slug"] != null) {
            queryParameters["slug"] = requestParameters["slug"];
        }

        if (requestParameters["superuserFullList"] != null) {
            queryParameters["superuser_full_list"] = requestParameters["superuserFullList"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/applications/`;

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

    /**
     * Custom list method that checks Policy based access instead of guardian
     */
    async coreApplicationsListRaw(
        requestParameters: CoreApplicationsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedApplicationList>> {
        const requestOptions = await this.coreApplicationsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Custom list method that checks Policy based access instead of guardian
     */
    async coreApplicationsList(
        requestParameters: CoreApplicationsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedApplicationList> {
        const response = await this.coreApplicationsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/applications/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedApplicationRequestToJSON(requestParameters["patchedApplicationRequest"]),
        };
    }

    /**
     * Application Viewset
     */
    async coreApplicationsPartialUpdateRaw(
        requestParameters: CoreApplicationsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Application>> {
        const requestOptions =
            await this.coreApplicationsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Application Viewset
     */
    async coreApplicationsPartialUpdate(
        requestParameters: CoreApplicationsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Application> {
        const response = await this.coreApplicationsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/applications/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Application Viewset
     */
    async coreApplicationsRetrieveRaw(
        requestParameters: CoreApplicationsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Application>> {
        const requestOptions = await this.coreApplicationsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Application Viewset
     */
    async coreApplicationsRetrieve(
        requestParameters: CoreApplicationsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Application> {
        const response = await this.coreApplicationsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["applicationRequest"] == null) {
            throw new runtime.RequiredError(
                "applicationRequest",
                'Required parameter "applicationRequest" was null or undefined when calling coreApplicationsUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/applications/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: ApplicationRequestToJSON(requestParameters["applicationRequest"]),
        };
    }

    /**
     * Application Viewset
     */
    async coreApplicationsUpdateRaw(
        requestParameters: CoreApplicationsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Application>> {
        const requestOptions = await this.coreApplicationsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Application Viewset
     */
    async coreApplicationsUpdate(
        requestParameters: CoreApplicationsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Application> {
        const response = await this.coreApplicationsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/applications/{slug}/used_by/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async coreApplicationsUsedByListRaw(
        requestParameters: CoreApplicationsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.coreApplicationsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreApplicationsUsedByList(
        requestParameters: CoreApplicationsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreApplicationsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        if (requestParameters["userPks"] != null) {
            queryParameters["user_pks"] = requestParameters["userPks"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/authenticated_sessions/bulk_delete/`;

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

    /**
     * Bulk revoke all sessions for multiple users
     */
    async coreAuthenticatedSessionsBulkDeleteDestroyRaw(
        requestParameters: CoreAuthenticatedSessionsBulkDeleteDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<BulkDeleteSessionResponse>> {
        const requestOptions =
            await this.coreAuthenticatedSessionsBulkDeleteDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Bulk revoke all sessions for multiple users
     */
    async coreAuthenticatedSessionsBulkDeleteDestroy(
        requestParameters: CoreAuthenticatedSessionsBulkDeleteDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<BulkDeleteSessionResponse> {
        const response = await this.coreAuthenticatedSessionsBulkDeleteDestroyRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/authenticated_sessions/{uuid}/`;
        urlPath = urlPath.replace(
            `{${"uuid"}}`,
            encodeURIComponent(String(requestParameters["uuid"])),
        );

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

    /**
     * AuthenticatedSession Viewset
     */
    async coreAuthenticatedSessionsDestroyRaw(
        requestParameters: CoreAuthenticatedSessionsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.coreAuthenticatedSessionsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatedSession Viewset
     */
    async coreAuthenticatedSessionsDestroy(
        requestParameters: CoreAuthenticatedSessionsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreAuthenticatedSessionsDestroyRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for coreAuthenticatedSessionsList without sending the request
     */
    async coreAuthenticatedSessionsListRequestOpts(
        requestParameters: CoreAuthenticatedSessionsListRequest,
    ): 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"];
        }

        if (requestParameters["sessionLastIp"] != null) {
            queryParameters["session__last_ip"] = requestParameters["sessionLastIp"];
        }

        if (requestParameters["sessionLastUserAgent"] != null) {
            queryParameters["session__last_user_agent"] = requestParameters["sessionLastUserAgent"];
        }

        if (requestParameters["userUsername"] != null) {
            queryParameters["user__username"] = requestParameters["userUsername"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/authenticated_sessions/`;

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

    /**
     * AuthenticatedSession Viewset
     */
    async coreAuthenticatedSessionsListRaw(
        requestParameters: CoreAuthenticatedSessionsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatedSessionList>> {
        const requestOptions =
            await this.coreAuthenticatedSessionsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatedSession Viewset
     */
    async coreAuthenticatedSessionsList(
        requestParameters: CoreAuthenticatedSessionsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatedSessionList> {
        const response = await this.coreAuthenticatedSessionsListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/authenticated_sessions/{uuid}/`;
        urlPath = urlPath.replace(
            `{${"uuid"}}`,
            encodeURIComponent(String(requestParameters["uuid"])),
        );

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

    /**
     * AuthenticatedSession Viewset
     */
    async coreAuthenticatedSessionsRetrieveRaw(
        requestParameters: CoreAuthenticatedSessionsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatedSession>> {
        const requestOptions =
            await this.coreAuthenticatedSessionsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatedSession Viewset
     */
    async coreAuthenticatedSessionsRetrieve(
        requestParameters: CoreAuthenticatedSessionsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatedSession> {
        const response = await this.coreAuthenticatedSessionsRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/authenticated_sessions/{uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"uuid"}}`,
            encodeURIComponent(String(requestParameters["uuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async coreAuthenticatedSessionsUsedByListRaw(
        requestParameters: CoreAuthenticatedSessionsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.coreAuthenticatedSessionsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreAuthenticatedSessionsUsedByList(
        requestParameters: CoreAuthenticatedSessionsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreAuthenticatedSessionsUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/brands/`;

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

    /**
     * Brand Viewset
     */
    async coreBrandsCreateRaw(
        requestParameters: CoreBrandsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Brand>> {
        const requestOptions = await this.coreBrandsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Brand Viewset
     */
    async coreBrandsCreate(
        requestParameters: CoreBrandsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Brand> {
        const response = await this.coreBrandsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for coreBrandsCurrentRetrieve without sending the request
     */
    async coreBrandsCurrentRetrieveRequestOpts(): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/brands/current/`;

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

    /**
     * Get current brand
     */
    async coreBrandsCurrentRetrieveRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<CurrentBrand>> {
        const requestOptions = await this.coreBrandsCurrentRetrieveRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get current brand
     */
    async coreBrandsCurrentRetrieve(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<CurrentBrand> {
        const response = await this.coreBrandsCurrentRetrieveRaw(initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/brands/{brand_uuid}/`;
        urlPath = urlPath.replace(
            `{${"brand_uuid"}}`,
            encodeURIComponent(String(requestParameters["brandUuid"])),
        );

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

    /**
     * Brand Viewset
     */
    async coreBrandsDestroyRaw(
        requestParameters: CoreBrandsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreBrandsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Brand Viewset
     */
    async coreBrandsDestroy(
        requestParameters: CoreBrandsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreBrandsDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["brandUuid"] != null) {
            queryParameters["brand_uuid"] = requestParameters["brandUuid"];
        }

        if (requestParameters["brandingDefaultFlowBackground"] != null) {
            queryParameters["branding_default_flow_background"] =
                requestParameters["brandingDefaultFlowBackground"];
        }

        if (requestParameters["brandingFavicon"] != null) {
            queryParameters["branding_favicon"] = requestParameters["brandingFavicon"];
        }

        if (requestParameters["brandingLogo"] != null) {
            queryParameters["branding_logo"] = requestParameters["brandingLogo"];
        }

        if (requestParameters["brandingTitle"] != null) {
            queryParameters["branding_title"] = requestParameters["brandingTitle"];
        }

        if (requestParameters["clientCertificates"] != null) {
            queryParameters["client_certificates"] = requestParameters["clientCertificates"];
        }

        if (requestParameters["_default"] != null) {
            queryParameters["default"] = requestParameters["_default"];
        }

        if (requestParameters["domain"] != null) {
            queryParameters["domain"] = requestParameters["domain"];
        }

        if (requestParameters["flowAuthentication"] != null) {
            queryParameters["flow_authentication"] = requestParameters["flowAuthentication"];
        }

        if (requestParameters["flowDeviceCode"] != null) {
            queryParameters["flow_device_code"] = requestParameters["flowDeviceCode"];
        }

        if (requestParameters["flowInvalidation"] != null) {
            queryParameters["flow_invalidation"] = requestParameters["flowInvalidation"];
        }

        if (requestParameters["flowRecovery"] != null) {
            queryParameters["flow_recovery"] = requestParameters["flowRecovery"];
        }

        if (requestParameters["flowUnenrollment"] != null) {
            queryParameters["flow_unenrollment"] = requestParameters["flowUnenrollment"];
        }

        if (requestParameters["flowUserSettings"] != null) {
            queryParameters["flow_user_settings"] = requestParameters["flowUserSettings"];
        }

        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"];
        }

        if (requestParameters["webCertificate"] != null) {
            queryParameters["web_certificate"] = requestParameters["webCertificate"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/brands/`;

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

    /**
     * Brand Viewset
     */
    async coreBrandsListRaw(
        requestParameters: CoreBrandsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedBrandList>> {
        const requestOptions = await this.coreBrandsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Brand Viewset
     */
    async coreBrandsList(
        requestParameters: CoreBrandsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedBrandList> {
        const response = await this.coreBrandsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/brands/{brand_uuid}/`;
        urlPath = urlPath.replace(
            `{${"brand_uuid"}}`,
            encodeURIComponent(String(requestParameters["brandUuid"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedBrandRequestToJSON(requestParameters["patchedBrandRequest"]),
        };
    }

    /**
     * Brand Viewset
     */
    async coreBrandsPartialUpdateRaw(
        requestParameters: CoreBrandsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Brand>> {
        const requestOptions = await this.coreBrandsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Brand Viewset
     */
    async coreBrandsPartialUpdate(
        requestParameters: CoreBrandsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Brand> {
        const response = await this.coreBrandsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/brands/{brand_uuid}/`;
        urlPath = urlPath.replace(
            `{${"brand_uuid"}}`,
            encodeURIComponent(String(requestParameters["brandUuid"])),
        );

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

    /**
     * Brand Viewset
     */
    async coreBrandsRetrieveRaw(
        requestParameters: CoreBrandsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Brand>> {
        const requestOptions = await this.coreBrandsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Brand Viewset
     */
    async coreBrandsRetrieve(
        requestParameters: CoreBrandsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Brand> {
        const response = await this.coreBrandsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["brandRequest"] == null) {
            throw new runtime.RequiredError(
                "brandRequest",
                'Required parameter "brandRequest" was null or undefined when calling coreBrandsUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/brands/{brand_uuid}/`;
        urlPath = urlPath.replace(
            `{${"brand_uuid"}}`,
            encodeURIComponent(String(requestParameters["brandUuid"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: BrandRequestToJSON(requestParameters["brandRequest"]),
        };
    }

    /**
     * Brand Viewset
     */
    async coreBrandsUpdateRaw(
        requestParameters: CoreBrandsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Brand>> {
        const requestOptions = await this.coreBrandsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Brand Viewset
     */
    async coreBrandsUpdate(
        requestParameters: CoreBrandsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Brand> {
        const response = await this.coreBrandsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/brands/{brand_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"brand_uuid"}}`,
            encodeURIComponent(String(requestParameters["brandUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async coreBrandsUsedByListRaw(
        requestParameters: CoreBrandsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.coreBrandsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreBrandsUsedByList(
        requestParameters: CoreBrandsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreBrandsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["userAccountRequest"] == null) {
            throw new runtime.RequiredError(
                "userAccountRequest",
                'Required parameter "userAccountRequest" was null or undefined when calling coreGroupsAddUserCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/groups/{group_uuid}/add_user/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

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

    /**
     * Add user to group
     */
    async coreGroupsAddUserCreateRaw(
        requestParameters: CoreGroupsAddUserCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreGroupsAddUserCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Add user to group
     */
    async coreGroupsAddUserCreate(
        requestParameters: CoreGroupsAddUserCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreGroupsAddUserCreateRaw(requestParameters, initOverrides);
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/groups/`;

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

    /**
     * Group Viewset
     */
    async coreGroupsCreateRaw(
        requestParameters: CoreGroupsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Group>> {
        const requestOptions = await this.coreGroupsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group Viewset
     */
    async coreGroupsCreate(
        requestParameters: CoreGroupsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Group> {
        const response = await this.coreGroupsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/groups/{group_uuid}/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

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

    /**
     * Group Viewset
     */
    async coreGroupsDestroyRaw(
        requestParameters: CoreGroupsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreGroupsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group Viewset
     */
    async coreGroupsDestroy(
        requestParameters: CoreGroupsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreGroupsDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["attributes"] != null) {
            queryParameters["attributes"] = requestParameters["attributes"];
        }

        if (requestParameters["includeChildren"] != null) {
            queryParameters["include_children"] = requestParameters["includeChildren"];
        }

        if (requestParameters["includeInheritedRoles"] != null) {
            queryParameters["include_inherited_roles"] = requestParameters["includeInheritedRoles"];
        }

        if (requestParameters["includeParents"] != null) {
            queryParameters["include_parents"] = requestParameters["includeParents"];
        }

        if (requestParameters["includeUsers"] != null) {
            queryParameters["include_users"] = requestParameters["includeUsers"];
        }

        if (requestParameters["isSuperuser"] != null) {
            queryParameters["is_superuser"] = requestParameters["isSuperuser"];
        }

        if (requestParameters["membersByPk"] != null) {
            queryParameters["members_by_pk"] = requestParameters["membersByPk"];
        }

        if (requestParameters["membersByUsername"] != null) {
            queryParameters["members_by_username"] = requestParameters["membersByUsername"];
        }

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

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/groups/`;

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

    /**
     * Group Viewset
     */
    async coreGroupsListRaw(
        requestParameters: CoreGroupsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupList>> {
        const requestOptions = await this.coreGroupsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group Viewset
     */
    async coreGroupsList(
        requestParameters: CoreGroupsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupList> {
        const response = await this.coreGroupsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/groups/{group_uuid}/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedGroupRequestToJSON(requestParameters["patchedGroupRequest"]),
        };
    }

    /**
     * Group Viewset
     */
    async coreGroupsPartialUpdateRaw(
        requestParameters: CoreGroupsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Group>> {
        const requestOptions = await this.coreGroupsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group Viewset
     */
    async coreGroupsPartialUpdate(
        requestParameters: CoreGroupsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Group> {
        const response = await this.coreGroupsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["userAccountRequest"] == null) {
            throw new runtime.RequiredError(
                "userAccountRequest",
                'Required parameter "userAccountRequest" was null or undefined when calling coreGroupsRemoveUserCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/groups/{group_uuid}/remove_user/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

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

    /**
     * Remove user from group
     */
    async coreGroupsRemoveUserCreateRaw(
        requestParameters: CoreGroupsRemoveUserCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreGroupsRemoveUserCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Remove user from group
     */
    async coreGroupsRemoveUserCreate(
        requestParameters: CoreGroupsRemoveUserCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreGroupsRemoveUserCreateRaw(requestParameters, initOverrides);
    }

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

        const queryParameters: any = {};

        if (requestParameters["includeChildren"] != null) {
            queryParameters["include_children"] = requestParameters["includeChildren"];
        }

        if (requestParameters["includeInheritedRoles"] != null) {
            queryParameters["include_inherited_roles"] = requestParameters["includeInheritedRoles"];
        }

        if (requestParameters["includeParents"] != null) {
            queryParameters["include_parents"] = requestParameters["includeParents"];
        }

        if (requestParameters["includeUsers"] != null) {
            queryParameters["include_users"] = requestParameters["includeUsers"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/groups/{group_uuid}/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

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

    /**
     * Group Viewset
     */
    async coreGroupsRetrieveRaw(
        requestParameters: CoreGroupsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Group>> {
        const requestOptions = await this.coreGroupsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group Viewset
     */
    async coreGroupsRetrieve(
        requestParameters: CoreGroupsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Group> {
        const response = await this.coreGroupsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["groupRequest"] == null) {
            throw new runtime.RequiredError(
                "groupRequest",
                'Required parameter "groupRequest" was null or undefined when calling coreGroupsUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/groups/{group_uuid}/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: GroupRequestToJSON(requestParameters["groupRequest"]),
        };
    }

    /**
     * Group Viewset
     */
    async coreGroupsUpdateRaw(
        requestParameters: CoreGroupsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Group>> {
        const requestOptions = await this.coreGroupsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group Viewset
     */
    async coreGroupsUpdate(
        requestParameters: CoreGroupsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Group> {
        const response = await this.coreGroupsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/groups/{group_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"group_uuid"}}`,
            encodeURIComponent(String(requestParameters["groupUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async coreGroupsUsedByListRaw(
        requestParameters: CoreGroupsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.coreGroupsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreGroupsUsedByList(
        requestParameters: CoreGroupsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreGroupsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/tokens/`;

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

    /**
     * Token Viewset
     */
    async coreTokensCreateRaw(
        requestParameters: CoreTokensCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Token>> {
        const requestOptions = await this.coreTokensCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Token Viewset
     */
    async coreTokensCreate(
        requestParameters: CoreTokensCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Token> {
        const response = await this.coreTokensCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/tokens/{identifier}/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

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

    /**
     * Token Viewset
     */
    async coreTokensDestroyRaw(
        requestParameters: CoreTokensDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreTokensDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Token Viewset
     */
    async coreTokensDestroy(
        requestParameters: CoreTokensDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreTokensDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["description"] != null) {
            queryParameters["description"] = requestParameters["description"];
        }

        if (requestParameters["expires"] != null) {
            queryParameters["expires"] = (requestParameters["expires"] as any).toISOString();
        }

        if (requestParameters["expiring"] != null) {
            queryParameters["expiring"] = requestParameters["expiring"];
        }

        if (requestParameters["identifier"] != null) {
            queryParameters["identifier"] = requestParameters["identifier"];
        }

        if (requestParameters["intent"] != null) {
            queryParameters["intent"] = requestParameters["intent"];
        }

        if (requestParameters["managed"] != null) {
            queryParameters["managed"] = requestParameters["managed"];
        }

        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"];
        }

        if (requestParameters["userUsername"] != null) {
            queryParameters["user__username"] = requestParameters["userUsername"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/tokens/`;

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

    /**
     * Token Viewset
     */
    async coreTokensListRaw(
        requestParameters: CoreTokensListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedTokenList>> {
        const requestOptions = await this.coreTokensListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Token Viewset
     */
    async coreTokensList(
        requestParameters: CoreTokensListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedTokenList> {
        const response = await this.coreTokensListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/tokens/{identifier}/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedTokenRequestToJSON(requestParameters["patchedTokenRequest"]),
        };
    }

    /**
     * Token Viewset
     */
    async coreTokensPartialUpdateRaw(
        requestParameters: CoreTokensPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Token>> {
        const requestOptions = await this.coreTokensPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Token Viewset
     */
    async coreTokensPartialUpdate(
        requestParameters: CoreTokensPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Token> {
        const response = await this.coreTokensPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/tokens/{identifier}/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

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

    /**
     * Token Viewset
     */
    async coreTokensRetrieveRaw(
        requestParameters: CoreTokensRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Token>> {
        const requestOptions = await this.coreTokensRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Token Viewset
     */
    async coreTokensRetrieve(
        requestParameters: CoreTokensRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Token> {
        const response = await this.coreTokensRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["tokenSetKeyRequest"] == null) {
            throw new runtime.RequiredError(
                "tokenSetKeyRequest",
                'Required parameter "tokenSetKeyRequest" was null or undefined when calling coreTokensSetKeyCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/tokens/{identifier}/set_key/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

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

    /**
     * Set token key. Action is logged as event. `authentik_core.set_token_key` permission is required.
     */
    async coreTokensSetKeyCreateRaw(
        requestParameters: CoreTokensSetKeyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreTokensSetKeyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Set token key. Action is logged as event. `authentik_core.set_token_key` permission is required.
     */
    async coreTokensSetKeyCreate(
        requestParameters: CoreTokensSetKeyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreTokensSetKeyCreateRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["tokenRequest"] == null) {
            throw new runtime.RequiredError(
                "tokenRequest",
                'Required parameter "tokenRequest" was null or undefined when calling coreTokensUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/tokens/{identifier}/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: TokenRequestToJSON(requestParameters["tokenRequest"]),
        };
    }

    /**
     * Token Viewset
     */
    async coreTokensUpdateRaw(
        requestParameters: CoreTokensUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Token>> {
        const requestOptions = await this.coreTokensUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Token Viewset
     */
    async coreTokensUpdate(
        requestParameters: CoreTokensUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Token> {
        const response = await this.coreTokensUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/tokens/{identifier}/used_by/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async coreTokensUsedByListRaw(
        requestParameters: CoreTokensUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.coreTokensUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreTokensUsedByList(
        requestParameters: CoreTokensUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreTokensUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/tokens/{identifier}/view_key/`;
        urlPath = urlPath.replace(
            `{${"identifier"}}`,
            encodeURIComponent(String(requestParameters["identifier"])),
        );

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

    /**
     * Return token key and log access
     */
    async coreTokensViewKeyRetrieveRaw(
        requestParameters: CoreTokensViewKeyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TokenView>> {
        const requestOptions = await this.coreTokensViewKeyRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Return token key and log access
     */
    async coreTokensViewKeyRetrieve(
        requestParameters: CoreTokensViewKeyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TokenView> {
        const response = await this.coreTokensViewKeyRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/transactional/applications/`;

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: TransactionApplicationRequestToJSON(
                requestParameters["transactionApplicationRequest"],
            ),
        };
    }

    /**
     * Convert data into a blueprint, validate it and apply it
     */
    async coreTransactionalApplicationsUpdateRaw(
        requestParameters: CoreTransactionalApplicationsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TransactionApplicationResponse>> {
        const requestOptions =
            await this.coreTransactionalApplicationsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Convert data into a blueprint, validate it and apply it
     */
    async coreTransactionalApplicationsUpdate(
        requestParameters: CoreTransactionalApplicationsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TransactionApplicationResponse> {
        const response = await this.coreTransactionalApplicationsUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/user_consent/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * UserConsent Viewset
     */
    async coreUserConsentDestroyRaw(
        requestParameters: CoreUserConsentDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreUserConsentDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * UserConsent Viewset
     */
    async coreUserConsentDestroy(
        requestParameters: CoreUserConsentDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreUserConsentDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["application"] != null) {
            queryParameters["application"] = requestParameters["application"];
        }

        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"];
        }

        if (requestParameters["user"] != null) {
            queryParameters["user"] = requestParameters["user"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/user_consent/`;

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

    /**
     * UserConsent Viewset
     */
    async coreUserConsentListRaw(
        requestParameters: CoreUserConsentListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserConsentList>> {
        const requestOptions = await this.coreUserConsentListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserConsent Viewset
     */
    async coreUserConsentList(
        requestParameters: CoreUserConsentListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserConsentList> {
        const response = await this.coreUserConsentListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/user_consent/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * UserConsent Viewset
     */
    async coreUserConsentRetrieveRaw(
        requestParameters: CoreUserConsentRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserConsent>> {
        const requestOptions = await this.coreUserConsentRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserConsent Viewset
     */
    async coreUserConsentRetrieve(
        requestParameters: CoreUserConsentRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserConsent> {
        const response = await this.coreUserConsentRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/user_consent/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Get a list of all objects that use this object
     */
    async coreUserConsentUsedByListRaw(
        requestParameters: CoreUserConsentUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.coreUserConsentUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreUserConsentUsedByList(
        requestParameters: CoreUserConsentUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreUserConsentUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/`;

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

    /**
     * User Viewset
     */
    async coreUsersCreateRaw(
        requestParameters: CoreUsersCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<User>> {
        const requestOptions = await this.coreUsersCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User Viewset
     */
    async coreUsersCreate(
        requestParameters: CoreUsersCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<User> {
        const response = await this.coreUsersCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User Viewset
     */
    async coreUsersDestroyRaw(
        requestParameters: CoreUsersDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreUsersDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User Viewset
     */
    async coreUsersDestroy(
        requestParameters: CoreUsersDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreUsersDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["attributes"] != null) {
            queryParameters["attributes"] = requestParameters["attributes"];
        }

        if (requestParameters["dateJoined"] != null) {
            queryParameters["date_joined"] = (requestParameters["dateJoined"] as any).toISOString();
        }

        if (requestParameters["dateJoinedGt"] != null) {
            queryParameters["date_joined__gt"] = (
                requestParameters["dateJoinedGt"] as any
            ).toISOString();
        }

        if (requestParameters["dateJoinedLt"] != null) {
            queryParameters["date_joined__lt"] = (
                requestParameters["dateJoinedLt"] as any
            ).toISOString();
        }

        if (requestParameters["email"] != null) {
            queryParameters["email"] = requestParameters["email"];
        }

        if (requestParameters["groupsByName"] != null) {
            queryParameters["groups_by_name"] = requestParameters["groupsByName"];
        }

        if (requestParameters["groupsByPk"] != null) {
            queryParameters["groups_by_pk"] = requestParameters["groupsByPk"];
        }

        if (requestParameters["isActive"] != null) {
            queryParameters["is_active"] = requestParameters["isActive"];
        }

        if (requestParameters["isSuperuser"] != null) {
            queryParameters["is_superuser"] = requestParameters["isSuperuser"];
        }

        if (requestParameters["lastLogin"] != null) {
            queryParameters["last_login"] = (requestParameters["lastLogin"] as any).toISOString();
        }

        if (requestParameters["lastLoginGt"] != null) {
            queryParameters["last_login__gt"] = (
                requestParameters["lastLoginGt"] as any
            ).toISOString();
        }

        if (requestParameters["lastLoginIsnull"] != null) {
            queryParameters["last_login__isnull"] = requestParameters["lastLoginIsnull"];
        }

        if (requestParameters["lastLoginLt"] != null) {
            queryParameters["last_login__lt"] = (
                requestParameters["lastLoginLt"] as any
            ).toISOString();
        }

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

        if (requestParameters["lastUpdatedGt"] != null) {
            queryParameters["last_updated__gt"] = (
                requestParameters["lastUpdatedGt"] as any
            ).toISOString();
        }

        if (requestParameters["lastUpdatedLt"] != null) {
            queryParameters["last_updated__lt"] = (
                requestParameters["lastUpdatedLt"] as any
            ).toISOString();
        }

        if (requestParameters["name"] != null) {
            queryParameters["name"] = requestParameters["name"];
        }

        if (requestParameters["ordering"] != null) {
            queryParameters["ordering"] = requestParameters["ordering"];
        }

        if (requestParameters["path"] != null) {
            queryParameters["path"] = requestParameters["path"];
        }

        if (requestParameters["pathStartswith"] != null) {
            queryParameters["path_startswith"] = requestParameters["pathStartswith"];
        }

        if (requestParameters["rolesByName"] != null) {
            queryParameters["roles_by_name"] = requestParameters["rolesByName"];
        }

        if (requestParameters["rolesByPk"] != null) {
            queryParameters["roles_by_pk"] = requestParameters["rolesByPk"];
        }

        if (requestParameters["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        if (requestParameters["type"] != null) {
            queryParameters["type"] = requestParameters["type"];
        }

        if (requestParameters["username"] != null) {
            queryParameters["username"] = requestParameters["username"];
        }

        if (requestParameters["uuid"] != null) {
            queryParameters["uuid"] = requestParameters["uuid"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/export/`;

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

    /**
     * Create a data export for this data type. Note that the export is generated asynchronously: this method returns a `DataExport` object that will initially have `completed=false` as well as the permanent URL to that object in the `Location` header. You can poll that URL until `completed=true`, at which point the `file_url` property will contain a URL to download
     */
    async coreUsersExportCreateRaw(
        requestParameters: CoreUsersExportCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DataExport>> {
        const requestOptions = await this.coreUsersExportCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Create a data export for this data type. Note that the export is generated asynchronously: this method returns a `DataExport` object that will initially have `completed=false` as well as the permanent URL to that object in the `Location` header. You can poll that URL until `completed=true`, at which point the `file_url` property will contain a URL to download
     */
    async coreUsersExportCreate(
        requestParameters: CoreUsersExportCreateRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DataExport> {
        const response = await this.coreUsersExportCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["impersonationRequest"] == null) {
            throw new runtime.RequiredError(
                "impersonationRequest",
                'Required parameter "impersonationRequest" was null or undefined when calling coreUsersImpersonateCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/{id}/impersonate/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Impersonate a user
     */
    async coreUsersImpersonateCreateRaw(
        requestParameters: CoreUsersImpersonateCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreUsersImpersonateCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Impersonate a user
     */
    async coreUsersImpersonateCreate(
        requestParameters: CoreUsersImpersonateCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreUsersImpersonateCreateRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for coreUsersImpersonateEndRetrieve without sending the request
     */
    async coreUsersImpersonateEndRetrieveRequestOpts(): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/impersonate_end/`;

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

    /**
     * End Impersonation a user
     */
    async coreUsersImpersonateEndRetrieveRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreUsersImpersonateEndRetrieveRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * End Impersonation a user
     */
    async coreUsersImpersonateEndRetrieve(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreUsersImpersonateEndRetrieveRaw(initOverrides);
    }

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

        if (requestParameters["attributes"] != null) {
            queryParameters["attributes"] = requestParameters["attributes"];
        }

        if (requestParameters["dateJoined"] != null) {
            queryParameters["date_joined"] = (requestParameters["dateJoined"] as any).toISOString();
        }

        if (requestParameters["dateJoinedGt"] != null) {
            queryParameters["date_joined__gt"] = (
                requestParameters["dateJoinedGt"] as any
            ).toISOString();
        }

        if (requestParameters["dateJoinedLt"] != null) {
            queryParameters["date_joined__lt"] = (
                requestParameters["dateJoinedLt"] as any
            ).toISOString();
        }

        if (requestParameters["email"] != null) {
            queryParameters["email"] = requestParameters["email"];
        }

        if (requestParameters["groupsByName"] != null) {
            queryParameters["groups_by_name"] = requestParameters["groupsByName"];
        }

        if (requestParameters["groupsByPk"] != null) {
            queryParameters["groups_by_pk"] = requestParameters["groupsByPk"];
        }

        if (requestParameters["includeGroups"] != null) {
            queryParameters["include_groups"] = requestParameters["includeGroups"];
        }

        if (requestParameters["includeRoles"] != null) {
            queryParameters["include_roles"] = requestParameters["includeRoles"];
        }

        if (requestParameters["isActive"] != null) {
            queryParameters["is_active"] = requestParameters["isActive"];
        }

        if (requestParameters["isSuperuser"] != null) {
            queryParameters["is_superuser"] = requestParameters["isSuperuser"];
        }

        if (requestParameters["lastLogin"] != null) {
            queryParameters["last_login"] = (requestParameters["lastLogin"] as any).toISOString();
        }

        if (requestParameters["lastLoginGt"] != null) {
            queryParameters["last_login__gt"] = (
                requestParameters["lastLoginGt"] as any
            ).toISOString();
        }

        if (requestParameters["lastLoginIsnull"] != null) {
            queryParameters["last_login__isnull"] = requestParameters["lastLoginIsnull"];
        }

        if (requestParameters["lastLoginLt"] != null) {
            queryParameters["last_login__lt"] = (
                requestParameters["lastLoginLt"] as any
            ).toISOString();
        }

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

        if (requestParameters["lastUpdatedGt"] != null) {
            queryParameters["last_updated__gt"] = (
                requestParameters["lastUpdatedGt"] as any
            ).toISOString();
        }

        if (requestParameters["lastUpdatedLt"] != null) {
            queryParameters["last_updated__lt"] = (
                requestParameters["lastUpdatedLt"] as any
            ).toISOString();
        }

        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["path"] != null) {
            queryParameters["path"] = requestParameters["path"];
        }

        if (requestParameters["pathStartswith"] != null) {
            queryParameters["path_startswith"] = requestParameters["pathStartswith"];
        }

        if (requestParameters["rolesByName"] != null) {
            queryParameters["roles_by_name"] = requestParameters["rolesByName"];
        }

        if (requestParameters["rolesByPk"] != null) {
            queryParameters["roles_by_pk"] = requestParameters["rolesByPk"];
        }

        if (requestParameters["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        if (requestParameters["type"] != null) {
            queryParameters["type"] = requestParameters["type"];
        }

        if (requestParameters["username"] != null) {
            queryParameters["username"] = requestParameters["username"];
        }

        if (requestParameters["uuid"] != null) {
            queryParameters["uuid"] = requestParameters["uuid"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/`;

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

    /**
     * User Viewset
     */
    async coreUsersListRaw(
        requestParameters: CoreUsersListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserList>> {
        const requestOptions = await this.coreUsersListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User Viewset
     */
    async coreUsersList(
        requestParameters: CoreUsersListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserList> {
        const response = await this.coreUsersListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for coreUsersMeRetrieve without sending the request
     */
    async coreUsersMeRetrieveRequestOpts(): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/me/`;

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

    /**
     * Get information about current user
     */
    async coreUsersMeRetrieveRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SessionUser>> {
        const requestOptions = await this.coreUsersMeRetrieveRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get information about current user
     */
    async coreUsersMeRetrieve(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SessionUser> {
        const response = await this.coreUsersMeRetrieveRaw(initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedUserRequestToJSON(requestParameters["patchedUserRequest"]),
        };
    }

    /**
     * User Viewset
     */
    async coreUsersPartialUpdateRaw(
        requestParameters: CoreUsersPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<User>> {
        const requestOptions = await this.coreUsersPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User Viewset
     */
    async coreUsersPartialUpdate(
        requestParameters: CoreUsersPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<User> {
        const response = await this.coreUsersPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/paths/`;

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

    /**
     * Get all user paths
     */
    async coreUsersPathsRetrieveRaw(
        requestParameters: CoreUsersPathsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserPath>> {
        const requestOptions = await this.coreUsersPathsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all user paths
     */
    async coreUsersPathsRetrieve(
        requestParameters: CoreUsersPathsRetrieveRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserPath> {
        const response = await this.coreUsersPathsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/{id}/recovery/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Create a temporary link that a user can use to recover their account
     */
    async coreUsersRecoveryCreateRaw(
        requestParameters: CoreUsersRecoveryCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Link>> {
        const requestOptions = await this.coreUsersRecoveryCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Create a temporary link that a user can use to recover their account
     */
    async coreUsersRecoveryCreate(
        requestParameters: CoreUsersRecoveryCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Link> {
        const response = await this.coreUsersRecoveryCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters["userRecoveryEmailRequest"] == null) {
            throw new runtime.RequiredError(
                "userRecoveryEmailRequest",
                'Required parameter "userRecoveryEmailRequest" was null or undefined when calling coreUsersRecoveryEmailCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/{id}/recovery_email/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Send an email with a temporary link that a user can use to recover their account
     */
    async coreUsersRecoveryEmailCreateRaw(
        requestParameters: CoreUsersRecoveryEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.coreUsersRecoveryEmailCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Send an email with a temporary link that a user can use to recover their account
     */
    async coreUsersRecoveryEmailCreate(
        requestParameters: CoreUsersRecoveryEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreUsersRecoveryEmailCreateRaw(requestParameters, initOverrides);
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User Viewset
     */
    async coreUsersRetrieveRaw(
        requestParameters: CoreUsersRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<User>> {
        const requestOptions = await this.coreUsersRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User Viewset
     */
    async coreUsersRetrieve(
        requestParameters: CoreUsersRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<User> {
        const response = await this.coreUsersRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/service_account/`;

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

    /**
     * Create a new user account that is marked as a service account
     */
    async coreUsersServiceAccountCreateRaw(
        requestParameters: CoreUsersServiceAccountCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserServiceAccountResponse>> {
        const requestOptions =
            await this.coreUsersServiceAccountCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Create a new user account that is marked as a service account
     */
    async coreUsersServiceAccountCreate(
        requestParameters: CoreUsersServiceAccountCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserServiceAccountResponse> {
        const response = await this.coreUsersServiceAccountCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        if (requestParameters["userPasswordSetRequest"] == null) {
            throw new runtime.RequiredError(
                "userPasswordSetRequest",
                'Required parameter "userPasswordSetRequest" was null or undefined when calling coreUsersSetPasswordCreate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/{id}/set_password/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Set password for user
     */
    async coreUsersSetPasswordCreateRaw(
        requestParameters: CoreUsersSetPasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.coreUsersSetPasswordCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Set password for user
     */
    async coreUsersSetPasswordCreate(
        requestParameters: CoreUsersSetPasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.coreUsersSetPasswordCreateRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["userRequest"] == null) {
            throw new runtime.RequiredError(
                "userRequest",
                'Required parameter "userRequest" was null or undefined when calling coreUsersUpdate().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        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 = `/core/users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: UserRequestToJSON(requestParameters["userRequest"]),
        };
    }

    /**
     * User Viewset
     */
    async coreUsersUpdateRaw(
        requestParameters: CoreUsersUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<User>> {
        const requestOptions = await this.coreUsersUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User Viewset
     */
    async coreUsersUpdate(
        requestParameters: CoreUsersUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<User> {
        const response = await this.coreUsersUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/core/users/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Get a list of all objects that use this object
     */
    async coreUsersUsedByListRaw(
        requestParameters: CoreUsersUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.coreUsersUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async coreUsersUsedByList(
        requestParameters: CoreUsersUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.coreUsersUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
