/* 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 {
    AuthenticatorAttachmentEnum,
    AuthenticatorDuoStage,
    AuthenticatorDuoStageDeviceImportResponse,
    AuthenticatorDuoStageManualDeviceImportRequest,
    AuthenticatorDuoStageRequest,
    AuthenticatorEmailStage,
    AuthenticatorEmailStageRequest,
    AuthenticatorEndpointGDTCStage,
    AuthenticatorEndpointGDTCStageRequest,
    AuthenticatorSMSStage,
    AuthenticatorSMSStageRequest,
    AuthenticatorStaticStage,
    AuthenticatorStaticStageRequest,
    AuthenticatorTOTPStage,
    AuthenticatorTOTPStageRequest,
    AuthenticatorValidateStage,
    AuthenticatorValidateStageRequest,
    AuthenticatorWebAuthnStage,
    AuthenticatorWebAuthnStageRequest,
    AuthTypeEnum,
    CaptchaStage,
    CaptchaStageRequest,
    CertAttributeEnum,
    ConsentModeEnum,
    ConsentStage,
    ConsentStageRequest,
    DenyStage,
    DenyStageRequest,
    DigitsEnum,
    DummyStage,
    DummyStageRequest,
    DuoDeviceEnrollmentStatus,
    EmailStage,
    EmailStageRequest,
    EndpointStage,
    EndpointStageRequest,
    GeoipBindingEnum,
    IdentificationStage,
    IdentificationStageRequest,
    Invitation,
    InvitationRequest,
    InvitationSendEmailRequest,
    InvitationStage,
    InvitationStageRequest,
    MutualTLSStage,
    MutualTLSStageRequest,
    NetworkBindingEnum,
    NotConfiguredActionEnum,
    PaginatedAuthenticatorDuoStageList,
    PaginatedAuthenticatorEmailStageList,
    PaginatedAuthenticatorEndpointGDTCStageList,
    PaginatedAuthenticatorSMSStageList,
    PaginatedAuthenticatorStaticStageList,
    PaginatedAuthenticatorTOTPStageList,
    PaginatedAuthenticatorValidateStageList,
    PaginatedAuthenticatorWebAuthnStageList,
    PaginatedCaptchaStageList,
    PaginatedConsentStageList,
    PaginatedDenyStageList,
    PaginatedDummyStageList,
    PaginatedEmailStageList,
    PaginatedEndpointStageList,
    PaginatedIdentificationStageList,
    PaginatedInvitationList,
    PaginatedInvitationStageList,
    PaginatedMutualTLSStageList,
    PaginatedPasswordStageList,
    PaginatedPromptList,
    PaginatedPromptStageList,
    PaginatedRedirectStageList,
    PaginatedSourceStageList,
    PaginatedStageList,
    PaginatedUserDeleteStageList,
    PaginatedUserLoginStageList,
    PaginatedUserLogoutStageList,
    PaginatedUserWriteStageList,
    PaginatedWebAuthnDeviceTypeList,
    PasswordStage,
    PasswordStageRequest,
    PatchedAuthenticatorDuoStageRequest,
    PatchedAuthenticatorEmailStageRequest,
    PatchedAuthenticatorEndpointGDTCStageRequest,
    PatchedAuthenticatorSMSStageRequest,
    PatchedAuthenticatorStaticStageRequest,
    PatchedAuthenticatorTOTPStageRequest,
    PatchedAuthenticatorValidateStageRequest,
    PatchedAuthenticatorWebAuthnStageRequest,
    PatchedCaptchaStageRequest,
    PatchedConsentStageRequest,
    PatchedDenyStageRequest,
    PatchedDummyStageRequest,
    PatchedEmailStageRequest,
    PatchedEndpointStageRequest,
    PatchedIdentificationStageRequest,
    PatchedInvitationRequest,
    PatchedInvitationStageRequest,
    PatchedMutualTLSStageRequest,
    PatchedPasswordStageRequest,
    PatchedPromptRequest,
    PatchedPromptStageRequest,
    PatchedRedirectStageRequest,
    PatchedSourceStageRequest,
    PatchedUserDeleteStageRequest,
    PatchedUserLoginStageRequest,
    PatchedUserLogoutStageRequest,
    PatchedUserWriteStageRequest,
    Prompt,
    PromptChallenge,
    PromptRequest,
    PromptStage,
    PromptStageRequest,
    PromptTypeEnum,
    ProviderEnum,
    RedirectStage,
    RedirectStageRequest,
    SourceStage,
    SourceStageRequest,
    Stage,
    StageModeEnum,
    TypeCreate,
    UsedBy,
    UserAttributeEnum,
    UserCreationModeEnum,
    UserDeleteStage,
    UserDeleteStageRequest,
    UserLoginStage,
    UserLoginStageRequest,
    UserLogoutStage,
    UserLogoutStageRequest,
    UserSetting,
    UserTypeEnum,
    UserVerificationEnum,
    UserWriteStage,
    UserWriteStageRequest,
    WebAuthnDeviceType,
} from "../models/index";
import {
    AuthenticatorDuoStageDeviceImportResponseFromJSON,
    AuthenticatorDuoStageFromJSON,
    AuthenticatorDuoStageManualDeviceImportRequestToJSON,
    AuthenticatorDuoStageRequestToJSON,
    AuthenticatorEmailStageFromJSON,
    AuthenticatorEmailStageRequestToJSON,
    AuthenticatorEndpointGDTCStageFromJSON,
    AuthenticatorEndpointGDTCStageRequestToJSON,
    AuthenticatorSMSStageFromJSON,
    AuthenticatorSMSStageRequestToJSON,
    AuthenticatorStaticStageFromJSON,
    AuthenticatorStaticStageRequestToJSON,
    AuthenticatorTOTPStageFromJSON,
    AuthenticatorTOTPStageRequestToJSON,
    AuthenticatorValidateStageFromJSON,
    AuthenticatorValidateStageRequestToJSON,
    AuthenticatorWebAuthnStageFromJSON,
    AuthenticatorWebAuthnStageRequestToJSON,
    CaptchaStageFromJSON,
    CaptchaStageRequestToJSON,
    ConsentStageFromJSON,
    ConsentStageRequestToJSON,
    DenyStageFromJSON,
    DenyStageRequestToJSON,
    DummyStageFromJSON,
    DummyStageRequestToJSON,
    DuoDeviceEnrollmentStatusFromJSON,
    EmailStageFromJSON,
    EmailStageRequestToJSON,
    EndpointStageFromJSON,
    EndpointStageRequestToJSON,
    IdentificationStageFromJSON,
    IdentificationStageRequestToJSON,
    InvitationFromJSON,
    InvitationRequestToJSON,
    InvitationSendEmailRequestToJSON,
    InvitationStageFromJSON,
    InvitationStageRequestToJSON,
    MutualTLSStageFromJSON,
    MutualTLSStageRequestToJSON,
    PaginatedAuthenticatorDuoStageListFromJSON,
    PaginatedAuthenticatorEmailStageListFromJSON,
    PaginatedAuthenticatorEndpointGDTCStageListFromJSON,
    PaginatedAuthenticatorSMSStageListFromJSON,
    PaginatedAuthenticatorStaticStageListFromJSON,
    PaginatedAuthenticatorTOTPStageListFromJSON,
    PaginatedAuthenticatorValidateStageListFromJSON,
    PaginatedAuthenticatorWebAuthnStageListFromJSON,
    PaginatedCaptchaStageListFromJSON,
    PaginatedConsentStageListFromJSON,
    PaginatedDenyStageListFromJSON,
    PaginatedDummyStageListFromJSON,
    PaginatedEmailStageListFromJSON,
    PaginatedEndpointStageListFromJSON,
    PaginatedIdentificationStageListFromJSON,
    PaginatedInvitationListFromJSON,
    PaginatedInvitationStageListFromJSON,
    PaginatedMutualTLSStageListFromJSON,
    PaginatedPasswordStageListFromJSON,
    PaginatedPromptListFromJSON,
    PaginatedPromptStageListFromJSON,
    PaginatedRedirectStageListFromJSON,
    PaginatedSourceStageListFromJSON,
    PaginatedStageListFromJSON,
    PaginatedUserDeleteStageListFromJSON,
    PaginatedUserLoginStageListFromJSON,
    PaginatedUserLogoutStageListFromJSON,
    PaginatedUserWriteStageListFromJSON,
    PaginatedWebAuthnDeviceTypeListFromJSON,
    PasswordStageFromJSON,
    PasswordStageRequestToJSON,
    PatchedAuthenticatorDuoStageRequestToJSON,
    PatchedAuthenticatorEmailStageRequestToJSON,
    PatchedAuthenticatorEndpointGDTCStageRequestToJSON,
    PatchedAuthenticatorSMSStageRequestToJSON,
    PatchedAuthenticatorStaticStageRequestToJSON,
    PatchedAuthenticatorTOTPStageRequestToJSON,
    PatchedAuthenticatorValidateStageRequestToJSON,
    PatchedAuthenticatorWebAuthnStageRequestToJSON,
    PatchedCaptchaStageRequestToJSON,
    PatchedConsentStageRequestToJSON,
    PatchedDenyStageRequestToJSON,
    PatchedDummyStageRequestToJSON,
    PatchedEmailStageRequestToJSON,
    PatchedEndpointStageRequestToJSON,
    PatchedIdentificationStageRequestToJSON,
    PatchedInvitationRequestToJSON,
    PatchedInvitationStageRequestToJSON,
    PatchedMutualTLSStageRequestToJSON,
    PatchedPasswordStageRequestToJSON,
    PatchedPromptRequestToJSON,
    PatchedPromptStageRequestToJSON,
    PatchedRedirectStageRequestToJSON,
    PatchedSourceStageRequestToJSON,
    PatchedUserDeleteStageRequestToJSON,
    PatchedUserLoginStageRequestToJSON,
    PatchedUserLogoutStageRequestToJSON,
    PatchedUserWriteStageRequestToJSON,
    PromptChallengeFromJSON,
    PromptFromJSON,
    PromptRequestToJSON,
    PromptStageFromJSON,
    PromptStageRequestToJSON,
    RedirectStageFromJSON,
    RedirectStageRequestToJSON,
    SourceStageFromJSON,
    SourceStageRequestToJSON,
    StageFromJSON,
    TypeCreateFromJSON,
    UsedByFromJSON,
    UserDeleteStageFromJSON,
    UserDeleteStageRequestToJSON,
    UserLoginStageFromJSON,
    UserLoginStageRequestToJSON,
    UserLogoutStageFromJSON,
    UserLogoutStageRequestToJSON,
    UserSettingFromJSON,
    UserWriteStageFromJSON,
    UserWriteStageRequestToJSON,
    WebAuthnDeviceTypeFromJSON,
} from "../models/index";
import * as runtime from "../runtime";

export interface StagesAllDestroyRequest {
    stageUuid: string;
}

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

export interface StagesAllRetrieveRequest {
    stageUuid: string;
}

export interface StagesAllUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorDuoCreateRequest {
    authenticatorDuoStageRequest: AuthenticatorDuoStageRequest;
}

export interface StagesAuthenticatorDuoDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorDuoEnrollmentStatusCreateRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorDuoImportDeviceManualCreateRequest {
    stageUuid: string;
    authenticatorDuoStageManualDeviceImportRequest: AuthenticatorDuoStageManualDeviceImportRequest;
}

export interface StagesAuthenticatorDuoImportDevicesAutomaticCreateRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorDuoListRequest {
    apiHostname?: string;
    clientId?: string;
    configureFlow?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface StagesAuthenticatorDuoPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorDuoStageRequest?: PatchedAuthenticatorDuoStageRequest;
}

export interface StagesAuthenticatorDuoRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorDuoUpdateRequest {
    stageUuid: string;
    authenticatorDuoStageRequest: AuthenticatorDuoStageRequest;
}

export interface StagesAuthenticatorDuoUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorEmailCreateRequest {
    authenticatorEmailStageRequest: AuthenticatorEmailStageRequest;
}

export interface StagesAuthenticatorEmailDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorEmailListRequest {
    configureFlow?: string;
    friendlyName?: string;
    fromAddress?: string;
    host?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    password?: string;
    port?: number;
    search?: string;
    stageUuid?: string;
    subject?: string;
    template?: string;
    timeout?: number;
    tokenExpiry?: string;
    useGlobalSettings?: boolean;
    useSsl?: boolean;
    useTls?: boolean;
    username?: string;
}

export interface StagesAuthenticatorEmailPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorEmailStageRequest?: PatchedAuthenticatorEmailStageRequest;
}

export interface StagesAuthenticatorEmailRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorEmailUpdateRequest {
    stageUuid: string;
    authenticatorEmailStageRequest: AuthenticatorEmailStageRequest;
}

export interface StagesAuthenticatorEmailUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorEndpointGdtcCreateRequest {
    authenticatorEndpointGDTCStageRequest: AuthenticatorEndpointGDTCStageRequest;
}

export interface StagesAuthenticatorEndpointGdtcDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorEndpointGdtcListRequest {
    configureFlow?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface StagesAuthenticatorEndpointGdtcPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorEndpointGDTCStageRequest?: PatchedAuthenticatorEndpointGDTCStageRequest;
}

export interface StagesAuthenticatorEndpointGdtcRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorEndpointGdtcUpdateRequest {
    stageUuid: string;
    authenticatorEndpointGDTCStageRequest: AuthenticatorEndpointGDTCStageRequest;
}

export interface StagesAuthenticatorEndpointGdtcUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorSmsCreateRequest {
    authenticatorSMSStageRequest: AuthenticatorSMSStageRequest;
}

export interface StagesAuthenticatorSmsDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorSmsListRequest {
    accountSid?: string;
    auth?: string;
    authPassword?: string;
    authType?: AuthTypeEnum;
    configureFlow?: string;
    friendlyName?: string;
    fromNumber?: string;
    mapping?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    provider?: ProviderEnum;
    search?: string;
    stageUuid?: string;
    verifyOnly?: boolean;
}

export interface StagesAuthenticatorSmsPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorSMSStageRequest?: PatchedAuthenticatorSMSStageRequest;
}

export interface StagesAuthenticatorSmsRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorSmsUpdateRequest {
    stageUuid: string;
    authenticatorSMSStageRequest: AuthenticatorSMSStageRequest;
}

export interface StagesAuthenticatorSmsUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorStaticCreateRequest {
    authenticatorStaticStageRequest: AuthenticatorStaticStageRequest;
}

export interface StagesAuthenticatorStaticDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorStaticListRequest {
    configureFlow?: string;
    friendlyName?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
    tokenCount?: number;
    tokenLength?: number;
}

export interface StagesAuthenticatorStaticPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorStaticStageRequest?: PatchedAuthenticatorStaticStageRequest;
}

export interface StagesAuthenticatorStaticRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorStaticUpdateRequest {
    stageUuid: string;
    authenticatorStaticStageRequest: AuthenticatorStaticStageRequest;
}

export interface StagesAuthenticatorStaticUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorTotpCreateRequest {
    authenticatorTOTPStageRequest: AuthenticatorTOTPStageRequest;
}

export interface StagesAuthenticatorTotpDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorTotpListRequest {
    configureFlow?: string;
    digits?: DigitsEnum;
    friendlyName?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
}

export interface StagesAuthenticatorTotpPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorTOTPStageRequest?: PatchedAuthenticatorTOTPStageRequest;
}

export interface StagesAuthenticatorTotpRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorTotpUpdateRequest {
    stageUuid: string;
    authenticatorTOTPStageRequest: AuthenticatorTOTPStageRequest;
}

export interface StagesAuthenticatorTotpUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorValidateCreateRequest {
    authenticatorValidateStageRequest: AuthenticatorValidateStageRequest;
}

export interface StagesAuthenticatorValidateDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorValidateListRequest {
    configurationStages?: Array<string>;
    name?: string;
    notConfiguredAction?: NotConfiguredActionEnum;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface StagesAuthenticatorValidatePartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorValidateStageRequest?: PatchedAuthenticatorValidateStageRequest;
}

export interface StagesAuthenticatorValidateRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorValidateUpdateRequest {
    stageUuid: string;
    authenticatorValidateStageRequest: AuthenticatorValidateStageRequest;
}

export interface StagesAuthenticatorValidateUsedByListRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorWebauthnCreateRequest {
    authenticatorWebAuthnStageRequest: AuthenticatorWebAuthnStageRequest;
}

export interface StagesAuthenticatorWebauthnDestroyRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorWebauthnDeviceTypesListRequest {
    aaguid?: string;
    description?: string;
    icon?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface StagesAuthenticatorWebauthnDeviceTypesRetrieveRequest {
    aaguid: string;
}

export interface StagesAuthenticatorWebauthnListRequest {
    authenticatorAttachment?: AuthenticatorAttachmentEnum | null;
    configureFlow?: string;
    deviceTypeRestrictions?: Array<string>;
    maxAttempts?: number;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    residentKeyRequirement?: UserVerificationEnum;
    search?: string;
    userVerification?: UserVerificationEnum;
}

export interface StagesAuthenticatorWebauthnPartialUpdateRequest {
    stageUuid: string;
    patchedAuthenticatorWebAuthnStageRequest?: PatchedAuthenticatorWebAuthnStageRequest;
}

export interface StagesAuthenticatorWebauthnRetrieveRequest {
    stageUuid: string;
}

export interface StagesAuthenticatorWebauthnUpdateRequest {
    stageUuid: string;
    authenticatorWebAuthnStageRequest: AuthenticatorWebAuthnStageRequest;
}

export interface StagesAuthenticatorWebauthnUsedByListRequest {
    stageUuid: string;
}

export interface StagesCaptchaCreateRequest {
    captchaStageRequest: CaptchaStageRequest;
}

export interface StagesCaptchaDestroyRequest {
    stageUuid: string;
}

export interface StagesCaptchaListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    publicKey?: string;
    search?: string;
}

export interface StagesCaptchaPartialUpdateRequest {
    stageUuid: string;
    patchedCaptchaStageRequest?: PatchedCaptchaStageRequest;
}

export interface StagesCaptchaRetrieveRequest {
    stageUuid: string;
}

export interface StagesCaptchaUpdateRequest {
    stageUuid: string;
    captchaStageRequest: CaptchaStageRequest;
}

export interface StagesCaptchaUsedByListRequest {
    stageUuid: string;
}

export interface StagesConsentCreateRequest {
    consentStageRequest: ConsentStageRequest;
}

export interface StagesConsentDestroyRequest {
    stageUuid: string;
}

export interface StagesConsentListRequest {
    consentExpireIn?: string;
    mode?: ConsentModeEnum;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
}

export interface StagesConsentPartialUpdateRequest {
    stageUuid: string;
    patchedConsentStageRequest?: PatchedConsentStageRequest;
}

export interface StagesConsentRetrieveRequest {
    stageUuid: string;
}

export interface StagesConsentUpdateRequest {
    stageUuid: string;
    consentStageRequest: ConsentStageRequest;
}

export interface StagesConsentUsedByListRequest {
    stageUuid: string;
}

export interface StagesDenyCreateRequest {
    denyStageRequest: DenyStageRequest;
}

export interface StagesDenyDestroyRequest {
    stageUuid: string;
}

export interface StagesDenyListRequest {
    denyMessage?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
}

export interface StagesDenyPartialUpdateRequest {
    stageUuid: string;
    patchedDenyStageRequest?: PatchedDenyStageRequest;
}

export interface StagesDenyRetrieveRequest {
    stageUuid: string;
}

export interface StagesDenyUpdateRequest {
    stageUuid: string;
    denyStageRequest: DenyStageRequest;
}

export interface StagesDenyUsedByListRequest {
    stageUuid: string;
}

export interface StagesDummyCreateRequest {
    dummyStageRequest: DummyStageRequest;
}

export interface StagesDummyDestroyRequest {
    stageUuid: string;
}

export interface StagesDummyListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
    throwError?: boolean;
}

export interface StagesDummyPartialUpdateRequest {
    stageUuid: string;
    patchedDummyStageRequest?: PatchedDummyStageRequest;
}

export interface StagesDummyRetrieveRequest {
    stageUuid: string;
}

export interface StagesDummyUpdateRequest {
    stageUuid: string;
    dummyStageRequest: DummyStageRequest;
}

export interface StagesDummyUsedByListRequest {
    stageUuid: string;
}

export interface StagesEmailCreateRequest {
    emailStageRequest: EmailStageRequest;
}

export interface StagesEmailDestroyRequest {
    stageUuid: string;
}

export interface StagesEmailListRequest {
    activateUserOnSuccess?: boolean;
    fromAddress?: string;
    host?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    port?: number;
    search?: string;
    subject?: string;
    template?: string;
    timeout?: number;
    tokenExpiry?: string;
    useGlobalSettings?: boolean;
    useSsl?: boolean;
    useTls?: boolean;
    username?: string;
}

export interface StagesEmailPartialUpdateRequest {
    stageUuid: string;
    patchedEmailStageRequest?: PatchedEmailStageRequest;
}

export interface StagesEmailRetrieveRequest {
    stageUuid: string;
}

export interface StagesEmailUpdateRequest {
    stageUuid: string;
    emailStageRequest: EmailStageRequest;
}

export interface StagesEmailUsedByListRequest {
    stageUuid: string;
}

export interface StagesEndpointsCreateRequest {
    endpointStageRequest: EndpointStageRequest;
}

export interface StagesEndpointsDestroyRequest {
    stageUuid: string;
}

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

export interface StagesEndpointsPartialUpdateRequest {
    stageUuid: string;
    patchedEndpointStageRequest?: PatchedEndpointStageRequest;
}

export interface StagesEndpointsRetrieveRequest {
    stageUuid: string;
}

export interface StagesEndpointsUpdateRequest {
    stageUuid: string;
    endpointStageRequest: EndpointStageRequest;
}

export interface StagesEndpointsUsedByListRequest {
    stageUuid: string;
}

export interface StagesIdentificationCreateRequest {
    identificationStageRequest: IdentificationStageRequest;
}

export interface StagesIdentificationDestroyRequest {
    stageUuid: string;
}

export interface StagesIdentificationListRequest {
    captchaStage?: string;
    caseInsensitiveMatching?: boolean;
    enrollmentFlow?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    passwordStage?: string;
    passwordlessFlow?: string;
    recoveryFlow?: string;
    search?: string;
    showMatchedUser?: boolean;
    showSourceLabels?: boolean;
    webauthnStage?: string;
}

export interface StagesIdentificationPartialUpdateRequest {
    stageUuid: string;
    patchedIdentificationStageRequest?: PatchedIdentificationStageRequest;
}

export interface StagesIdentificationRetrieveRequest {
    stageUuid: string;
}

export interface StagesIdentificationUpdateRequest {
    stageUuid: string;
    identificationStageRequest: IdentificationStageRequest;
}

export interface StagesIdentificationUsedByListRequest {
    stageUuid: string;
}

export interface StagesInvitationInvitationsCreateRequest {
    invitationRequest: InvitationRequest;
}

export interface StagesInvitationInvitationsDestroyRequest {
    inviteUuid: string;
}

export interface StagesInvitationInvitationsListRequest {
    createdByUsername?: string;
    expires?: Date;
    flowSlug?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface StagesInvitationInvitationsPartialUpdateRequest {
    inviteUuid: string;
    patchedInvitationRequest?: PatchedInvitationRequest;
}

export interface StagesInvitationInvitationsRetrieveRequest {
    inviteUuid: string;
}

export interface StagesInvitationInvitationsSendEmailCreateRequest {
    inviteUuid: string;
    invitationSendEmailRequest: InvitationSendEmailRequest;
}

export interface StagesInvitationInvitationsUpdateRequest {
    inviteUuid: string;
    invitationRequest: InvitationRequest;
}

export interface StagesInvitationInvitationsUsedByListRequest {
    inviteUuid: string;
}

export interface StagesInvitationStagesCreateRequest {
    invitationStageRequest: InvitationStageRequest;
}

export interface StagesInvitationStagesDestroyRequest {
    stageUuid: string;
}

export interface StagesInvitationStagesListRequest {
    continueFlowWithoutInvitation?: boolean;
    name?: string;
    noFlows?: boolean;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
}

export interface StagesInvitationStagesPartialUpdateRequest {
    stageUuid: string;
    patchedInvitationStageRequest?: PatchedInvitationStageRequest;
}

export interface StagesInvitationStagesRetrieveRequest {
    stageUuid: string;
}

export interface StagesInvitationStagesUpdateRequest {
    stageUuid: string;
    invitationStageRequest: InvitationStageRequest;
}

export interface StagesInvitationStagesUsedByListRequest {
    stageUuid: string;
}

export interface StagesMtlsCreateRequest {
    mutualTLSStageRequest: MutualTLSStageRequest;
}

export interface StagesMtlsDestroyRequest {
    stageUuid: string;
}

export interface StagesMtlsListRequest {
    certAttribute?: CertAttributeEnum;
    certificateAuthorities?: Array<string>;
    mode?: StageModeEnum;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
    userAttribute?: UserAttributeEnum;
}

export interface StagesMtlsPartialUpdateRequest {
    stageUuid: string;
    patchedMutualTLSStageRequest?: PatchedMutualTLSStageRequest;
}

export interface StagesMtlsRetrieveRequest {
    stageUuid: string;
}

export interface StagesMtlsUpdateRequest {
    stageUuid: string;
    mutualTLSStageRequest: MutualTLSStageRequest;
}

export interface StagesMtlsUsedByListRequest {
    stageUuid: string;
}

export interface StagesPasswordCreateRequest {
    passwordStageRequest: PasswordStageRequest;
}

export interface StagesPasswordDestroyRequest {
    stageUuid: string;
}

export interface StagesPasswordListRequest {
    allowShowPassword?: boolean;
    configureFlow?: string;
    failedAttemptsBeforeCancel?: number;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface StagesPasswordPartialUpdateRequest {
    stageUuid: string;
    patchedPasswordStageRequest?: PatchedPasswordStageRequest;
}

export interface StagesPasswordRetrieveRequest {
    stageUuid: string;
}

export interface StagesPasswordUpdateRequest {
    stageUuid: string;
    passwordStageRequest: PasswordStageRequest;
}

export interface StagesPasswordUsedByListRequest {
    stageUuid: string;
}

export interface StagesPromptPromptsCreateRequest {
    promptRequest: PromptRequest;
}

export interface StagesPromptPromptsDestroyRequest {
    promptUuid: string;
}

export interface StagesPromptPromptsListRequest {
    fieldKey?: string;
    label?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    placeholder?: string;
    search?: string;
    type?: PromptTypeEnum;
}

export interface StagesPromptPromptsPartialUpdateRequest {
    promptUuid: string;
    patchedPromptRequest?: PatchedPromptRequest;
}

export interface StagesPromptPromptsPreviewCreateRequest {
    promptRequest: PromptRequest;
}

export interface StagesPromptPromptsRetrieveRequest {
    promptUuid: string;
}

export interface StagesPromptPromptsUpdateRequest {
    promptUuid: string;
    promptRequest: PromptRequest;
}

export interface StagesPromptPromptsUsedByListRequest {
    promptUuid: string;
}

export interface StagesPromptStagesCreateRequest {
    promptStageRequest: PromptStageRequest;
}

export interface StagesPromptStagesDestroyRequest {
    stageUuid: string;
}

export interface StagesPromptStagesListRequest {
    fields?: Array<string>;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
    validationPolicies?: Array<string>;
}

export interface StagesPromptStagesPartialUpdateRequest {
    stageUuid: string;
    patchedPromptStageRequest?: PatchedPromptStageRequest;
}

export interface StagesPromptStagesRetrieveRequest {
    stageUuid: string;
}

export interface StagesPromptStagesUpdateRequest {
    stageUuid: string;
    promptStageRequest: PromptStageRequest;
}

export interface StagesPromptStagesUsedByListRequest {
    stageUuid: string;
}

export interface StagesRedirectCreateRequest {
    redirectStageRequest: RedirectStageRequest;
}

export interface StagesRedirectDestroyRequest {
    stageUuid: string;
}

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

export interface StagesRedirectPartialUpdateRequest {
    stageUuid: string;
    patchedRedirectStageRequest?: PatchedRedirectStageRequest;
}

export interface StagesRedirectRetrieveRequest {
    stageUuid: string;
}

export interface StagesRedirectUpdateRequest {
    stageUuid: string;
    redirectStageRequest: RedirectStageRequest;
}

export interface StagesRedirectUsedByListRequest {
    stageUuid: string;
}

export interface StagesSourceCreateRequest {
    sourceStageRequest: SourceStageRequest;
}

export interface StagesSourceDestroyRequest {
    stageUuid: string;
}

export interface StagesSourceListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    resumeTimeout?: string;
    search?: string;
    source?: string;
    stageUuid?: string;
}

export interface StagesSourcePartialUpdateRequest {
    stageUuid: string;
    patchedSourceStageRequest?: PatchedSourceStageRequest;
}

export interface StagesSourceRetrieveRequest {
    stageUuid: string;
}

export interface StagesSourceUpdateRequest {
    stageUuid: string;
    sourceStageRequest: SourceStageRequest;
}

export interface StagesSourceUsedByListRequest {
    stageUuid: string;
}

export interface StagesUserDeleteCreateRequest {
    userDeleteStageRequest: UserDeleteStageRequest;
}

export interface StagesUserDeleteDestroyRequest {
    stageUuid: string;
}

export interface StagesUserDeleteListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
}

export interface StagesUserDeletePartialUpdateRequest {
    stageUuid: string;
    patchedUserDeleteStageRequest?: PatchedUserDeleteStageRequest;
}

export interface StagesUserDeleteRetrieveRequest {
    stageUuid: string;
}

export interface StagesUserDeleteUpdateRequest {
    stageUuid: string;
    userDeleteStageRequest: UserDeleteStageRequest;
}

export interface StagesUserDeleteUsedByListRequest {
    stageUuid: string;
}

export interface StagesUserLoginCreateRequest {
    userLoginStageRequest: UserLoginStageRequest;
}

export interface StagesUserLoginDestroyRequest {
    stageUuid: string;
}

export interface StagesUserLoginListRequest {
    geoipBinding?: GeoipBindingEnum;
    name?: string;
    networkBinding?: NetworkBindingEnum;
    ordering?: string;
    page?: number;
    pageSize?: number;
    rememberDevice?: string;
    rememberMeOffset?: string;
    search?: string;
    sessionDuration?: string;
    stageUuid?: string;
    terminateOtherSessions?: boolean;
}

export interface StagesUserLoginPartialUpdateRequest {
    stageUuid: string;
    patchedUserLoginStageRequest?: PatchedUserLoginStageRequest;
}

export interface StagesUserLoginRetrieveRequest {
    stageUuid: string;
}

export interface StagesUserLoginUpdateRequest {
    stageUuid: string;
    userLoginStageRequest: UserLoginStageRequest;
}

export interface StagesUserLoginUsedByListRequest {
    stageUuid: string;
}

export interface StagesUserLogoutCreateRequest {
    userLogoutStageRequest: UserLogoutStageRequest;
}

export interface StagesUserLogoutDestroyRequest {
    stageUuid: string;
}

export interface StagesUserLogoutListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
}

export interface StagesUserLogoutPartialUpdateRequest {
    stageUuid: string;
    patchedUserLogoutStageRequest?: PatchedUserLogoutStageRequest;
}

export interface StagesUserLogoutRetrieveRequest {
    stageUuid: string;
}

export interface StagesUserLogoutUpdateRequest {
    stageUuid: string;
    userLogoutStageRequest: UserLogoutStageRequest;
}

export interface StagesUserLogoutUsedByListRequest {
    stageUuid: string;
}

export interface StagesUserWriteCreateRequest {
    userWriteStageRequest: UserWriteStageRequest;
}

export interface StagesUserWriteDestroyRequest {
    stageUuid: string;
}

export interface StagesUserWriteListRequest {
    createUsersAsInactive?: boolean;
    createUsersGroup?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    stageUuid?: string;
    userCreationMode?: UserCreationModeEnum;
    userPathTemplate?: string;
    userType?: UserTypeEnum;
}

export interface StagesUserWritePartialUpdateRequest {
    stageUuid: string;
    patchedUserWriteStageRequest?: PatchedUserWriteStageRequest;
}

export interface StagesUserWriteRetrieveRequest {
    stageUuid: string;
}

export interface StagesUserWriteUpdateRequest {
    stageUuid: string;
    userWriteStageRequest: UserWriteStageRequest;
}

export interface StagesUserWriteUsedByListRequest {
    stageUuid: string;
}

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

        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 = `/stages/all/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Stage Viewset
     */
    async stagesAllDestroyRaw(
        requestParameters: StagesAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesAllDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Stage Viewset
     */
    async stagesAllDestroy(
        requestParameters: StagesAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAllDestroyRaw(requestParameters, initOverrides);
    }

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

        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 = `/stages/all/`;

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

    /**
     * Stage Viewset
     */
    async stagesAllListRaw(
        requestParameters: StagesAllListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedStageList>> {
        const requestOptions = await this.stagesAllListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Stage Viewset
     */
    async stagesAllList(
        requestParameters: StagesAllListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedStageList> {
        const response = await this.stagesAllListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/all/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Stage Viewset
     */
    async stagesAllRetrieveRaw(
        requestParameters: StagesAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Stage>> {
        const requestOptions = await this.stagesAllRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Stage Viewset
     */
    async stagesAllRetrieve(
        requestParameters: StagesAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Stage> {
        const response = await this.stagesAllRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for stagesAllTypesList without sending the request
     */
    async stagesAllTypesListRequestOpts(): 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 = `/stages/all/types/`;

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

    /**
     * Get all creatable types
     */
    async stagesAllTypesListRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<TypeCreate>>> {
        const requestOptions = await this.stagesAllTypesListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all creatable types
     */
    async stagesAllTypesList(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<TypeCreate>> {
        const response = await this.stagesAllTypesListRaw(initOverrides);
        return await response.value();
    }

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

        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 = `/stages/all/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAllUsedByListRaw(
        requestParameters: StagesAllUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesAllUsedByListRequestOpts(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 stagesAllUsedByList(
        requestParameters: StagesAllUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAllUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for stagesAllUserSettingsList without sending the request
     */
    async stagesAllUserSettingsListRequestOpts(): 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 = `/stages/all/user_settings/`;

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

    /**
     * Get all stages the user can configure
     */
    async stagesAllUserSettingsListRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UserSetting>>> {
        const requestOptions = await this.stagesAllUserSettingsListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all stages the user can configure
     */
    async stagesAllUserSettingsList(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UserSetting>> {
        const response = await this.stagesAllUserSettingsListRaw(initOverrides);
        return await response.value();
    }

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

        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 = `/stages/authenticator/duo/`;

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoCreateRaw(
        requestParameters: StagesAuthenticatorDuoCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorDuoStage>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoCreate(
        requestParameters: StagesAuthenticatorDuoCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorDuoStage> {
        const response = await this.stagesAuthenticatorDuoCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/duo/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoDestroyRaw(
        requestParameters: StagesAuthenticatorDuoDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoDestroy(
        requestParameters: StagesAuthenticatorDuoDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorDuoDestroyRaw(requestParameters, initOverrides);
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        let urlPath = `/stages/authenticator/duo/{stage_uuid}/enrollment_status/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Check enrollment status of user details in current session
     */
    async stagesAuthenticatorDuoEnrollmentStatusCreateRaw(
        requestParameters: StagesAuthenticatorDuoEnrollmentStatusCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DuoDeviceEnrollmentStatus>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoEnrollmentStatusCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Check enrollment status of user details in current session
     */
    async stagesAuthenticatorDuoEnrollmentStatusCreate(
        requestParameters: StagesAuthenticatorDuoEnrollmentStatusCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DuoDeviceEnrollmentStatus> {
        const response = await this.stagesAuthenticatorDuoEnrollmentStatusCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/duo/{stage_uuid}/import_device_manual/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Import duo devices into authentik
     */
    async stagesAuthenticatorDuoImportDeviceManualCreateRaw(
        requestParameters: StagesAuthenticatorDuoImportDeviceManualCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoImportDeviceManualCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Import duo devices into authentik
     */
    async stagesAuthenticatorDuoImportDeviceManualCreate(
        requestParameters: StagesAuthenticatorDuoImportDeviceManualCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorDuoImportDeviceManualCreateRaw(
            requestParameters,
            initOverrides,
        );
    }

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

        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 = `/stages/authenticator/duo/{stage_uuid}/import_devices_automatic/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Import duo devices into authentik
     */
    async stagesAuthenticatorDuoImportDevicesAutomaticCreateRaw(
        requestParameters: StagesAuthenticatorDuoImportDevicesAutomaticCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorDuoStageDeviceImportResponse>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoImportDevicesAutomaticCreateRequestOpts(
                requestParameters,
            );
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Import duo devices into authentik
     */
    async stagesAuthenticatorDuoImportDevicesAutomaticCreate(
        requestParameters: StagesAuthenticatorDuoImportDevicesAutomaticCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorDuoStageDeviceImportResponse> {
        const response = await this.stagesAuthenticatorDuoImportDevicesAutomaticCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

        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 = `/stages/authenticator/duo/`;

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoListRaw(
        requestParameters: StagesAuthenticatorDuoListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorDuoStageList>> {
        const requestOptions = await this.stagesAuthenticatorDuoListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoList(
        requestParameters: StagesAuthenticatorDuoListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorDuoStageList> {
        const response = await this.stagesAuthenticatorDuoListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/authenticator/duo/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoPartialUpdateRaw(
        requestParameters: StagesAuthenticatorDuoPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorDuoStage>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoPartialUpdate(
        requestParameters: StagesAuthenticatorDuoPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorDuoStage> {
        const response = await this.stagesAuthenticatorDuoPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/duo/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoRetrieveRaw(
        requestParameters: StagesAuthenticatorDuoRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorDuoStage>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoRetrieve(
        requestParameters: StagesAuthenticatorDuoRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorDuoStage> {
        const response = await this.stagesAuthenticatorDuoRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/duo/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoUpdateRaw(
        requestParameters: StagesAuthenticatorDuoUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorDuoStage>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorDuoStage Viewset
     */
    async stagesAuthenticatorDuoUpdate(
        requestParameters: StagesAuthenticatorDuoUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorDuoStage> {
        const response = await this.stagesAuthenticatorDuoUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/duo/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorDuoUsedByListRaw(
        requestParameters: StagesAuthenticatorDuoUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorDuoUsedByListRequestOpts(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 stagesAuthenticatorDuoUsedByList(
        requestParameters: StagesAuthenticatorDuoUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorDuoUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/email/`;

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailCreateRaw(
        requestParameters: StagesAuthenticatorEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEmailStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailCreate(
        requestParameters: StagesAuthenticatorEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEmailStage> {
        const response = await this.stagesAuthenticatorEmailCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailDestroyRaw(
        requestParameters: StagesAuthenticatorEmailDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailDestroy(
        requestParameters: StagesAuthenticatorEmailDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorEmailDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/stages/authenticator/email/`;

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailListRaw(
        requestParameters: StagesAuthenticatorEmailListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorEmailStageList>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailList(
        requestParameters: StagesAuthenticatorEmailListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorEmailStageList> {
        const response = await this.stagesAuthenticatorEmailListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailPartialUpdateRaw(
        requestParameters: StagesAuthenticatorEmailPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEmailStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailPartialUpdate(
        requestParameters: StagesAuthenticatorEmailPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEmailStage> {
        const response = await this.stagesAuthenticatorEmailPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailRetrieveRaw(
        requestParameters: StagesAuthenticatorEmailRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEmailStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailRetrieve(
        requestParameters: StagesAuthenticatorEmailRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEmailStage> {
        const response = await this.stagesAuthenticatorEmailRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailUpdateRaw(
        requestParameters: StagesAuthenticatorEmailUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEmailStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEmailStage Viewset
     */
    async stagesAuthenticatorEmailUpdate(
        requestParameters: StagesAuthenticatorEmailUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEmailStage> {
        const response = await this.stagesAuthenticatorEmailUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/email/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorEmailUsedByListRaw(
        requestParameters: StagesAuthenticatorEmailUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorEmailUsedByListRequestOpts(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 stagesAuthenticatorEmailUsedByList(
        requestParameters: StagesAuthenticatorEmailUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorEmailUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/endpoint_gdtc/`;

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcCreateRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEndpointGDTCStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcCreate(
        requestParameters: StagesAuthenticatorEndpointGdtcCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEndpointGDTCStage> {
        const response = await this.stagesAuthenticatorEndpointGdtcCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/endpoint_gdtc/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcDestroyRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcDestroy(
        requestParameters: StagesAuthenticatorEndpointGdtcDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorEndpointGdtcDestroyRaw(requestParameters, initOverrides);
    }

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

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

        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 = `/stages/authenticator/endpoint_gdtc/`;

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcListRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorEndpointGDTCStageList>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcList(
        requestParameters: StagesAuthenticatorEndpointGdtcListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorEndpointGDTCStageList> {
        const response = await this.stagesAuthenticatorEndpointGdtcListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/endpoint_gdtc/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcPartialUpdateRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEndpointGDTCStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcPartialUpdate(
        requestParameters: StagesAuthenticatorEndpointGdtcPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEndpointGDTCStage> {
        const response = await this.stagesAuthenticatorEndpointGdtcPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/endpoint_gdtc/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcRetrieveRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEndpointGDTCStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcRetrieve(
        requestParameters: StagesAuthenticatorEndpointGdtcRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEndpointGDTCStage> {
        const response = await this.stagesAuthenticatorEndpointGdtcRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/endpoint_gdtc/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcUpdateRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorEndpointGDTCStage>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorEndpointGDTCStage Viewset
     */
    async stagesAuthenticatorEndpointGdtcUpdate(
        requestParameters: StagesAuthenticatorEndpointGdtcUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorEndpointGDTCStage> {
        const response = await this.stagesAuthenticatorEndpointGdtcUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/endpoint_gdtc/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorEndpointGdtcUsedByListRaw(
        requestParameters: StagesAuthenticatorEndpointGdtcUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorEndpointGdtcUsedByListRequestOpts(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 stagesAuthenticatorEndpointGdtcUsedByList(
        requestParameters: StagesAuthenticatorEndpointGdtcUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorEndpointGdtcUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/sms/`;

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsCreateRaw(
        requestParameters: StagesAuthenticatorSmsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorSMSStage>> {
        const requestOptions =
            await this.stagesAuthenticatorSmsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsCreate(
        requestParameters: StagesAuthenticatorSmsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorSMSStage> {
        const response = await this.stagesAuthenticatorSmsCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/sms/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsDestroyRaw(
        requestParameters: StagesAuthenticatorSmsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorSmsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsDestroy(
        requestParameters: StagesAuthenticatorSmsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorSmsDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/stages/authenticator/sms/`;

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsListRaw(
        requestParameters: StagesAuthenticatorSmsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorSMSStageList>> {
        const requestOptions = await this.stagesAuthenticatorSmsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsList(
        requestParameters: StagesAuthenticatorSmsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorSMSStageList> {
        const response = await this.stagesAuthenticatorSmsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/authenticator/sms/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsPartialUpdateRaw(
        requestParameters: StagesAuthenticatorSmsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorSMSStage>> {
        const requestOptions =
            await this.stagesAuthenticatorSmsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsPartialUpdate(
        requestParameters: StagesAuthenticatorSmsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorSMSStage> {
        const response = await this.stagesAuthenticatorSmsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/sms/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsRetrieveRaw(
        requestParameters: StagesAuthenticatorSmsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorSMSStage>> {
        const requestOptions =
            await this.stagesAuthenticatorSmsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsRetrieve(
        requestParameters: StagesAuthenticatorSmsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorSMSStage> {
        const response = await this.stagesAuthenticatorSmsRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/sms/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsUpdateRaw(
        requestParameters: StagesAuthenticatorSmsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorSMSStage>> {
        const requestOptions =
            await this.stagesAuthenticatorSmsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorSMSStage Viewset
     */
    async stagesAuthenticatorSmsUpdate(
        requestParameters: StagesAuthenticatorSmsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorSMSStage> {
        const response = await this.stagesAuthenticatorSmsUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/sms/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorSmsUsedByListRaw(
        requestParameters: StagesAuthenticatorSmsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorSmsUsedByListRequestOpts(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 stagesAuthenticatorSmsUsedByList(
        requestParameters: StagesAuthenticatorSmsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorSmsUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/static/`;

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticCreateRaw(
        requestParameters: StagesAuthenticatorStaticCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorStaticStage>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticCreate(
        requestParameters: StagesAuthenticatorStaticCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorStaticStage> {
        const response = await this.stagesAuthenticatorStaticCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/static/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticDestroyRaw(
        requestParameters: StagesAuthenticatorStaticDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticDestroy(
        requestParameters: StagesAuthenticatorStaticDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorStaticDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/stages/authenticator/static/`;

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticListRaw(
        requestParameters: StagesAuthenticatorStaticListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorStaticStageList>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticList(
        requestParameters: StagesAuthenticatorStaticListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorStaticStageList> {
        const response = await this.stagesAuthenticatorStaticListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/static/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticPartialUpdateRaw(
        requestParameters: StagesAuthenticatorStaticPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorStaticStage>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticPartialUpdate(
        requestParameters: StagesAuthenticatorStaticPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorStaticStage> {
        const response = await this.stagesAuthenticatorStaticPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/static/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticRetrieveRaw(
        requestParameters: StagesAuthenticatorStaticRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorStaticStage>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticRetrieve(
        requestParameters: StagesAuthenticatorStaticRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorStaticStage> {
        const response = await this.stagesAuthenticatorStaticRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/static/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticUpdateRaw(
        requestParameters: StagesAuthenticatorStaticUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorStaticStage>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorStaticStage Viewset
     */
    async stagesAuthenticatorStaticUpdate(
        requestParameters: StagesAuthenticatorStaticUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorStaticStage> {
        const response = await this.stagesAuthenticatorStaticUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/static/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorStaticUsedByListRaw(
        requestParameters: StagesAuthenticatorStaticUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorStaticUsedByListRequestOpts(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 stagesAuthenticatorStaticUsedByList(
        requestParameters: StagesAuthenticatorStaticUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorStaticUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/totp/`;

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpCreateRaw(
        requestParameters: StagesAuthenticatorTotpCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorTOTPStage>> {
        const requestOptions =
            await this.stagesAuthenticatorTotpCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpCreate(
        requestParameters: StagesAuthenticatorTotpCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorTOTPStage> {
        const response = await this.stagesAuthenticatorTotpCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/totp/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpDestroyRaw(
        requestParameters: StagesAuthenticatorTotpDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorTotpDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpDestroy(
        requestParameters: StagesAuthenticatorTotpDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorTotpDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

        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 = `/stages/authenticator/totp/`;

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpListRaw(
        requestParameters: StagesAuthenticatorTotpListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorTOTPStageList>> {
        const requestOptions = await this.stagesAuthenticatorTotpListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpList(
        requestParameters: StagesAuthenticatorTotpListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorTOTPStageList> {
        const response = await this.stagesAuthenticatorTotpListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/totp/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpPartialUpdateRaw(
        requestParameters: StagesAuthenticatorTotpPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorTOTPStage>> {
        const requestOptions =
            await this.stagesAuthenticatorTotpPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpPartialUpdate(
        requestParameters: StagesAuthenticatorTotpPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorTOTPStage> {
        const response = await this.stagesAuthenticatorTotpPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/totp/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpRetrieveRaw(
        requestParameters: StagesAuthenticatorTotpRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorTOTPStage>> {
        const requestOptions =
            await this.stagesAuthenticatorTotpRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpRetrieve(
        requestParameters: StagesAuthenticatorTotpRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorTOTPStage> {
        const response = await this.stagesAuthenticatorTotpRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/totp/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpUpdateRaw(
        requestParameters: StagesAuthenticatorTotpUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorTOTPStage>> {
        const requestOptions =
            await this.stagesAuthenticatorTotpUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorTOTPStage Viewset
     */
    async stagesAuthenticatorTotpUpdate(
        requestParameters: StagesAuthenticatorTotpUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorTOTPStage> {
        const response = await this.stagesAuthenticatorTotpUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/totp/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorTotpUsedByListRaw(
        requestParameters: StagesAuthenticatorTotpUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorTotpUsedByListRequestOpts(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 stagesAuthenticatorTotpUsedByList(
        requestParameters: StagesAuthenticatorTotpUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorTotpUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/validate/`;

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateCreateRaw(
        requestParameters: StagesAuthenticatorValidateCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorValidateStage>> {
        const requestOptions =
            await this.stagesAuthenticatorValidateCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateCreate(
        requestParameters: StagesAuthenticatorValidateCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorValidateStage> {
        const response = await this.stagesAuthenticatorValidateCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/validate/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateDestroyRaw(
        requestParameters: StagesAuthenticatorValidateDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorValidateDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateDestroy(
        requestParameters: StagesAuthenticatorValidateDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorValidateDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        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 = `/stages/authenticator/validate/`;

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateListRaw(
        requestParameters: StagesAuthenticatorValidateListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorValidateStageList>> {
        const requestOptions =
            await this.stagesAuthenticatorValidateListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateList(
        requestParameters: StagesAuthenticatorValidateListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorValidateStageList> {
        const response = await this.stagesAuthenticatorValidateListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/validate/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidatePartialUpdateRaw(
        requestParameters: StagesAuthenticatorValidatePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorValidateStage>> {
        const requestOptions =
            await this.stagesAuthenticatorValidatePartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidatePartialUpdate(
        requestParameters: StagesAuthenticatorValidatePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorValidateStage> {
        const response = await this.stagesAuthenticatorValidatePartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/validate/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateRetrieveRaw(
        requestParameters: StagesAuthenticatorValidateRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorValidateStage>> {
        const requestOptions =
            await this.stagesAuthenticatorValidateRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateRetrieve(
        requestParameters: StagesAuthenticatorValidateRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorValidateStage> {
        const response = await this.stagesAuthenticatorValidateRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/validate/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateUpdateRaw(
        requestParameters: StagesAuthenticatorValidateUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorValidateStage>> {
        const requestOptions =
            await this.stagesAuthenticatorValidateUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorValidateStage Viewset
     */
    async stagesAuthenticatorValidateUpdate(
        requestParameters: StagesAuthenticatorValidateUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorValidateStage> {
        const response = await this.stagesAuthenticatorValidateUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/validate/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorValidateUsedByListRaw(
        requestParameters: StagesAuthenticatorValidateUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorValidateUsedByListRequestOpts(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 stagesAuthenticatorValidateUsedByList(
        requestParameters: StagesAuthenticatorValidateUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorValidateUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/webauthn/`;

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnCreateRaw(
        requestParameters: StagesAuthenticatorWebauthnCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorWebAuthnStage>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnCreate(
        requestParameters: StagesAuthenticatorWebauthnCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorWebAuthnStage> {
        const response = await this.stagesAuthenticatorWebauthnCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/webauthn/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnDestroyRaw(
        requestParameters: StagesAuthenticatorWebauthnDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnDestroy(
        requestParameters: StagesAuthenticatorWebauthnDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesAuthenticatorWebauthnDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        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 = `/stages/authenticator/webauthn_device_types/`;

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

    /**
     * WebAuthnDeviceType Viewset
     */
    async stagesAuthenticatorWebauthnDeviceTypesListRaw(
        requestParameters: StagesAuthenticatorWebauthnDeviceTypesListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedWebAuthnDeviceTypeList>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnDeviceTypesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * WebAuthnDeviceType Viewset
     */
    async stagesAuthenticatorWebauthnDeviceTypesList(
        requestParameters: StagesAuthenticatorWebauthnDeviceTypesListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedWebAuthnDeviceTypeList> {
        const response = await this.stagesAuthenticatorWebauthnDeviceTypesListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/webauthn_device_types/{aaguid}/`;
        urlPath = urlPath.replace(
            `{${"aaguid"}}`,
            encodeURIComponent(String(requestParameters["aaguid"])),
        );

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

    /**
     * WebAuthnDeviceType Viewset
     */
    async stagesAuthenticatorWebauthnDeviceTypesRetrieveRaw(
        requestParameters: StagesAuthenticatorWebauthnDeviceTypesRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<WebAuthnDeviceType>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnDeviceTypesRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * WebAuthnDeviceType Viewset
     */
    async stagesAuthenticatorWebauthnDeviceTypesRetrieve(
        requestParameters: StagesAuthenticatorWebauthnDeviceTypesRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<WebAuthnDeviceType> {
        const response = await this.stagesAuthenticatorWebauthnDeviceTypesRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

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

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

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

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

        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 = `/stages/authenticator/webauthn/`;

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnListRaw(
        requestParameters: StagesAuthenticatorWebauthnListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedAuthenticatorWebAuthnStageList>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnList(
        requestParameters: StagesAuthenticatorWebauthnListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedAuthenticatorWebAuthnStageList> {
        const response = await this.stagesAuthenticatorWebauthnListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/webauthn/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnPartialUpdateRaw(
        requestParameters: StagesAuthenticatorWebauthnPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorWebAuthnStage>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnPartialUpdate(
        requestParameters: StagesAuthenticatorWebauthnPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorWebAuthnStage> {
        const response = await this.stagesAuthenticatorWebauthnPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/webauthn/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnRetrieveRaw(
        requestParameters: StagesAuthenticatorWebauthnRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorWebAuthnStage>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnRetrieve(
        requestParameters: StagesAuthenticatorWebauthnRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorWebAuthnStage> {
        const response = await this.stagesAuthenticatorWebauthnRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/authenticator/webauthn/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnUpdateRaw(
        requestParameters: StagesAuthenticatorWebauthnUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<AuthenticatorWebAuthnStage>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * AuthenticatorWebAuthnStage Viewset
     */
    async stagesAuthenticatorWebauthnUpdate(
        requestParameters: StagesAuthenticatorWebauthnUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<AuthenticatorWebAuthnStage> {
        const response = await this.stagesAuthenticatorWebauthnUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/authenticator/webauthn/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesAuthenticatorWebauthnUsedByListRaw(
        requestParameters: StagesAuthenticatorWebauthnUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesAuthenticatorWebauthnUsedByListRequestOpts(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 stagesAuthenticatorWebauthnUsedByList(
        requestParameters: StagesAuthenticatorWebauthnUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesAuthenticatorWebauthnUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/captcha/`;

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaCreateRaw(
        requestParameters: StagesCaptchaCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<CaptchaStage>> {
        const requestOptions = await this.stagesCaptchaCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaCreate(
        requestParameters: StagesCaptchaCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<CaptchaStage> {
        const response = await this.stagesCaptchaCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/captcha/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaDestroyRaw(
        requestParameters: StagesCaptchaDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesCaptchaDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaDestroy(
        requestParameters: StagesCaptchaDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesCaptchaDestroyRaw(requestParameters, initOverrides);
    }

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

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

        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 = `/stages/captcha/`;

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaListRaw(
        requestParameters: StagesCaptchaListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedCaptchaStageList>> {
        const requestOptions = await this.stagesCaptchaListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaList(
        requestParameters: StagesCaptchaListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedCaptchaStageList> {
        const response = await this.stagesCaptchaListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/captcha/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaPartialUpdateRaw(
        requestParameters: StagesCaptchaPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<CaptchaStage>> {
        const requestOptions = await this.stagesCaptchaPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaPartialUpdate(
        requestParameters: StagesCaptchaPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<CaptchaStage> {
        const response = await this.stagesCaptchaPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/captcha/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaRetrieveRaw(
        requestParameters: StagesCaptchaRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<CaptchaStage>> {
        const requestOptions = await this.stagesCaptchaRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaRetrieve(
        requestParameters: StagesCaptchaRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<CaptchaStage> {
        const response = await this.stagesCaptchaRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/captcha/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaUpdateRaw(
        requestParameters: StagesCaptchaUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<CaptchaStage>> {
        const requestOptions = await this.stagesCaptchaUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * CaptchaStage Viewset
     */
    async stagesCaptchaUpdate(
        requestParameters: StagesCaptchaUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<CaptchaStage> {
        const response = await this.stagesCaptchaUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/captcha/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesCaptchaUsedByListRaw(
        requestParameters: StagesCaptchaUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesCaptchaUsedByListRequestOpts(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 stagesCaptchaUsedByList(
        requestParameters: StagesCaptchaUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesCaptchaUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/consent/`;

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentCreateRaw(
        requestParameters: StagesConsentCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConsentStage>> {
        const requestOptions = await this.stagesConsentCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentCreate(
        requestParameters: StagesConsentCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConsentStage> {
        const response = await this.stagesConsentCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/consent/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentDestroyRaw(
        requestParameters: StagesConsentDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesConsentDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * ConsentStage Viewset
     */
    async stagesConsentDestroy(
        requestParameters: StagesConsentDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesConsentDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

        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 = `/stages/consent/`;

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentListRaw(
        requestParameters: StagesConsentListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedConsentStageList>> {
        const requestOptions = await this.stagesConsentListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentList(
        requestParameters: StagesConsentListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedConsentStageList> {
        const response = await this.stagesConsentListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/consent/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentPartialUpdateRaw(
        requestParameters: StagesConsentPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConsentStage>> {
        const requestOptions = await this.stagesConsentPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentPartialUpdate(
        requestParameters: StagesConsentPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConsentStage> {
        const response = await this.stagesConsentPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/consent/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentRetrieveRaw(
        requestParameters: StagesConsentRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConsentStage>> {
        const requestOptions = await this.stagesConsentRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentRetrieve(
        requestParameters: StagesConsentRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConsentStage> {
        const response = await this.stagesConsentRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/consent/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentUpdateRaw(
        requestParameters: StagesConsentUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConsentStage>> {
        const requestOptions = await this.stagesConsentUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConsentStage Viewset
     */
    async stagesConsentUpdate(
        requestParameters: StagesConsentUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConsentStage> {
        const response = await this.stagesConsentUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/consent/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesConsentUsedByListRaw(
        requestParameters: StagesConsentUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesConsentUsedByListRequestOpts(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 stagesConsentUsedByList(
        requestParameters: StagesConsentUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesConsentUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/deny/`;

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyCreateRaw(
        requestParameters: StagesDenyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DenyStage>> {
        const requestOptions = await this.stagesDenyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyCreate(
        requestParameters: StagesDenyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DenyStage> {
        const response = await this.stagesDenyCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/deny/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyDestroyRaw(
        requestParameters: StagesDenyDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesDenyDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * DenyStage Viewset
     */
    async stagesDenyDestroy(
        requestParameters: StagesDenyDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesDenyDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        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 = `/stages/deny/`;

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyListRaw(
        requestParameters: StagesDenyListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedDenyStageList>> {
        const requestOptions = await this.stagesDenyListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyList(
        requestParameters: StagesDenyListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedDenyStageList> {
        const response = await this.stagesDenyListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/deny/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyPartialUpdateRaw(
        requestParameters: StagesDenyPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DenyStage>> {
        const requestOptions = await this.stagesDenyPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyPartialUpdate(
        requestParameters: StagesDenyPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DenyStage> {
        const response = await this.stagesDenyPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/deny/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyRetrieveRaw(
        requestParameters: StagesDenyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DenyStage>> {
        const requestOptions = await this.stagesDenyRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyRetrieve(
        requestParameters: StagesDenyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DenyStage> {
        const response = await this.stagesDenyRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/deny/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyUpdateRaw(
        requestParameters: StagesDenyUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DenyStage>> {
        const requestOptions = await this.stagesDenyUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DenyStage Viewset
     */
    async stagesDenyUpdate(
        requestParameters: StagesDenyUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DenyStage> {
        const response = await this.stagesDenyUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/deny/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesDenyUsedByListRaw(
        requestParameters: StagesDenyUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesDenyUsedByListRequestOpts(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 stagesDenyUsedByList(
        requestParameters: StagesDenyUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesDenyUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/dummy/`;

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyCreateRaw(
        requestParameters: StagesDummyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyStage>> {
        const requestOptions = await this.stagesDummyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyCreate(
        requestParameters: StagesDummyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyStage> {
        const response = await this.stagesDummyCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/dummy/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyDestroyRaw(
        requestParameters: StagesDummyDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesDummyDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * DummyStage Viewset
     */
    async stagesDummyDestroy(
        requestParameters: StagesDummyDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesDummyDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        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 = `/stages/dummy/`;

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyListRaw(
        requestParameters: StagesDummyListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedDummyStageList>> {
        const requestOptions = await this.stagesDummyListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyList(
        requestParameters: StagesDummyListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedDummyStageList> {
        const response = await this.stagesDummyListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/dummy/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyPartialUpdateRaw(
        requestParameters: StagesDummyPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyStage>> {
        const requestOptions = await this.stagesDummyPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyPartialUpdate(
        requestParameters: StagesDummyPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyStage> {
        const response = await this.stagesDummyPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/dummy/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyRetrieveRaw(
        requestParameters: StagesDummyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyStage>> {
        const requestOptions = await this.stagesDummyRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyRetrieve(
        requestParameters: StagesDummyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyStage> {
        const response = await this.stagesDummyRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/dummy/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyUpdateRaw(
        requestParameters: StagesDummyUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyStage>> {
        const requestOptions = await this.stagesDummyUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * DummyStage Viewset
     */
    async stagesDummyUpdate(
        requestParameters: StagesDummyUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyStage> {
        const response = await this.stagesDummyUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/dummy/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesDummyUsedByListRaw(
        requestParameters: StagesDummyUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesDummyUsedByListRequestOpts(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 stagesDummyUsedByList(
        requestParameters: StagesDummyUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesDummyUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/email/`;

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailCreateRaw(
        requestParameters: StagesEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EmailStage>> {
        const requestOptions = await this.stagesEmailCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailCreate(
        requestParameters: StagesEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EmailStage> {
        const response = await this.stagesEmailCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailDestroyRaw(
        requestParameters: StagesEmailDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesEmailDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * EmailStage Viewset
     */
    async stagesEmailDestroy(
        requestParameters: StagesEmailDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesEmailDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/stages/email/`;

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailListRaw(
        requestParameters: StagesEmailListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedEmailStageList>> {
        const requestOptions = await this.stagesEmailListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailList(
        requestParameters: StagesEmailListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedEmailStageList> {
        const response = await this.stagesEmailListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailPartialUpdateRaw(
        requestParameters: StagesEmailPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EmailStage>> {
        const requestOptions = await this.stagesEmailPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailPartialUpdate(
        requestParameters: StagesEmailPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EmailStage> {
        const response = await this.stagesEmailPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailRetrieveRaw(
        requestParameters: StagesEmailRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EmailStage>> {
        const requestOptions = await this.stagesEmailRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailRetrieve(
        requestParameters: StagesEmailRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EmailStage> {
        const response = await this.stagesEmailRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for stagesEmailTemplatesList without sending the request
     */
    async stagesEmailTemplatesListRequestOpts(): 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 = `/stages/email/templates/`;

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

    /**
     * Get all available templates, including custom templates
     */
    async stagesEmailTemplatesListRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<TypeCreate>>> {
        const requestOptions = await this.stagesEmailTemplatesListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all available templates, including custom templates
     */
    async stagesEmailTemplatesList(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<TypeCreate>> {
        const response = await this.stagesEmailTemplatesListRaw(initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/email/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailUpdateRaw(
        requestParameters: StagesEmailUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EmailStage>> {
        const requestOptions = await this.stagesEmailUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EmailStage Viewset
     */
    async stagesEmailUpdate(
        requestParameters: StagesEmailUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EmailStage> {
        const response = await this.stagesEmailUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/email/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesEmailUsedByListRaw(
        requestParameters: StagesEmailUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesEmailUsedByListRequestOpts(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 stagesEmailUsedByList(
        requestParameters: StagesEmailUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesEmailUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/endpoints/`;

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsCreateRaw(
        requestParameters: StagesEndpointsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EndpointStage>> {
        const requestOptions = await this.stagesEndpointsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsCreate(
        requestParameters: StagesEndpointsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EndpointStage> {
        const response = await this.stagesEndpointsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/endpoints/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsDestroyRaw(
        requestParameters: StagesEndpointsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesEndpointsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsDestroy(
        requestParameters: StagesEndpointsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesEndpointsDestroyRaw(requestParameters, initOverrides);
    }

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

        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 = `/stages/endpoints/`;

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsListRaw(
        requestParameters: StagesEndpointsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedEndpointStageList>> {
        const requestOptions = await this.stagesEndpointsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsList(
        requestParameters: StagesEndpointsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedEndpointStageList> {
        const response = await this.stagesEndpointsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/endpoints/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsPartialUpdateRaw(
        requestParameters: StagesEndpointsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EndpointStage>> {
        const requestOptions =
            await this.stagesEndpointsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsPartialUpdate(
        requestParameters: StagesEndpointsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EndpointStage> {
        const response = await this.stagesEndpointsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/endpoints/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsRetrieveRaw(
        requestParameters: StagesEndpointsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EndpointStage>> {
        const requestOptions = await this.stagesEndpointsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsRetrieve(
        requestParameters: StagesEndpointsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EndpointStage> {
        const response = await this.stagesEndpointsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/endpoints/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsUpdateRaw(
        requestParameters: StagesEndpointsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EndpointStage>> {
        const requestOptions = await this.stagesEndpointsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * EndpointStage Viewset
     */
    async stagesEndpointsUpdate(
        requestParameters: StagesEndpointsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EndpointStage> {
        const response = await this.stagesEndpointsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/endpoints/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesEndpointsUsedByListRaw(
        requestParameters: StagesEndpointsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesEndpointsUsedByListRequestOpts(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 stagesEndpointsUsedByList(
        requestParameters: StagesEndpointsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesEndpointsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/identification/`;

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationCreateRaw(
        requestParameters: StagesIdentificationCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<IdentificationStage>> {
        const requestOptions = await this.stagesIdentificationCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationCreate(
        requestParameters: StagesIdentificationCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<IdentificationStage> {
        const response = await this.stagesIdentificationCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/identification/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationDestroyRaw(
        requestParameters: StagesIdentificationDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesIdentificationDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationDestroy(
        requestParameters: StagesIdentificationDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesIdentificationDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

        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 = `/stages/identification/`;

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationListRaw(
        requestParameters: StagesIdentificationListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedIdentificationStageList>> {
        const requestOptions = await this.stagesIdentificationListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationList(
        requestParameters: StagesIdentificationListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedIdentificationStageList> {
        const response = await this.stagesIdentificationListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/identification/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationPartialUpdateRaw(
        requestParameters: StagesIdentificationPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<IdentificationStage>> {
        const requestOptions =
            await this.stagesIdentificationPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationPartialUpdate(
        requestParameters: StagesIdentificationPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<IdentificationStage> {
        const response = await this.stagesIdentificationPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/identification/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationRetrieveRaw(
        requestParameters: StagesIdentificationRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<IdentificationStage>> {
        const requestOptions =
            await this.stagesIdentificationRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationRetrieve(
        requestParameters: StagesIdentificationRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<IdentificationStage> {
        const response = await this.stagesIdentificationRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/identification/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationUpdateRaw(
        requestParameters: StagesIdentificationUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<IdentificationStage>> {
        const requestOptions = await this.stagesIdentificationUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * IdentificationStage Viewset
     */
    async stagesIdentificationUpdate(
        requestParameters: StagesIdentificationUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<IdentificationStage> {
        const response = await this.stagesIdentificationUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/identification/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesIdentificationUsedByListRaw(
        requestParameters: StagesIdentificationUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesIdentificationUsedByListRequestOpts(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 stagesIdentificationUsedByList(
        requestParameters: StagesIdentificationUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesIdentificationUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/invitations/`;

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsCreateRaw(
        requestParameters: StagesInvitationInvitationsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Invitation>> {
        const requestOptions =
            await this.stagesInvitationInvitationsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsCreate(
        requestParameters: StagesInvitationInvitationsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Invitation> {
        const response = await this.stagesInvitationInvitationsCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/invitations/{invite_uuid}/`;
        urlPath = urlPath.replace(
            `{${"invite_uuid"}}`,
            encodeURIComponent(String(requestParameters["inviteUuid"])),
        );

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsDestroyRaw(
        requestParameters: StagesInvitationInvitationsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesInvitationInvitationsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsDestroy(
        requestParameters: StagesInvitationInvitationsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesInvitationInvitationsDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        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 = `/stages/invitation/invitations/`;

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsListRaw(
        requestParameters: StagesInvitationInvitationsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedInvitationList>> {
        const requestOptions =
            await this.stagesInvitationInvitationsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsList(
        requestParameters: StagesInvitationInvitationsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedInvitationList> {
        const response = await this.stagesInvitationInvitationsListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/invitations/{invite_uuid}/`;
        urlPath = urlPath.replace(
            `{${"invite_uuid"}}`,
            encodeURIComponent(String(requestParameters["inviteUuid"])),
        );

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsPartialUpdateRaw(
        requestParameters: StagesInvitationInvitationsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Invitation>> {
        const requestOptions =
            await this.stagesInvitationInvitationsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsPartialUpdate(
        requestParameters: StagesInvitationInvitationsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Invitation> {
        const response = await this.stagesInvitationInvitationsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/invitations/{invite_uuid}/`;
        urlPath = urlPath.replace(
            `{${"invite_uuid"}}`,
            encodeURIComponent(String(requestParameters["inviteUuid"])),
        );

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsRetrieveRaw(
        requestParameters: StagesInvitationInvitationsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Invitation>> {
        const requestOptions =
            await this.stagesInvitationInvitationsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsRetrieve(
        requestParameters: StagesInvitationInvitationsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Invitation> {
        const response = await this.stagesInvitationInvitationsRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/invitation/invitations/{invite_uuid}/send_email/`;
        urlPath = urlPath.replace(
            `{${"invite_uuid"}}`,
            encodeURIComponent(String(requestParameters["inviteUuid"])),
        );

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

    /**
     * Send invitation link via email to one or more addresses
     */
    async stagesInvitationInvitationsSendEmailCreateRaw(
        requestParameters: StagesInvitationInvitationsSendEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesInvitationInvitationsSendEmailCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Send invitation link via email to one or more addresses
     */
    async stagesInvitationInvitationsSendEmailCreate(
        requestParameters: StagesInvitationInvitationsSendEmailCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesInvitationInvitationsSendEmailCreateRaw(requestParameters, initOverrides);
    }

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

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

        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 = `/stages/invitation/invitations/{invite_uuid}/`;
        urlPath = urlPath.replace(
            `{${"invite_uuid"}}`,
            encodeURIComponent(String(requestParameters["inviteUuid"])),
        );

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsUpdateRaw(
        requestParameters: StagesInvitationInvitationsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Invitation>> {
        const requestOptions =
            await this.stagesInvitationInvitationsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Invitation Viewset
     */
    async stagesInvitationInvitationsUpdate(
        requestParameters: StagesInvitationInvitationsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Invitation> {
        const response = await this.stagesInvitationInvitationsUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/invitations/{invite_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"invite_uuid"}}`,
            encodeURIComponent(String(requestParameters["inviteUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesInvitationInvitationsUsedByListRaw(
        requestParameters: StagesInvitationInvitationsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesInvitationInvitationsUsedByListRequestOpts(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 stagesInvitationInvitationsUsedByList(
        requestParameters: StagesInvitationInvitationsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesInvitationInvitationsUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/stages/`;

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesCreateRaw(
        requestParameters: StagesInvitationStagesCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<InvitationStage>> {
        const requestOptions =
            await this.stagesInvitationStagesCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesCreate(
        requestParameters: StagesInvitationStagesCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<InvitationStage> {
        const response = await this.stagesInvitationStagesCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesDestroyRaw(
        requestParameters: StagesInvitationStagesDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.stagesInvitationStagesDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesDestroy(
        requestParameters: StagesInvitationStagesDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesInvitationStagesDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

        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 = `/stages/invitation/stages/`;

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesListRaw(
        requestParameters: StagesInvitationStagesListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedInvitationStageList>> {
        const requestOptions = await this.stagesInvitationStagesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesList(
        requestParameters: StagesInvitationStagesListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedInvitationStageList> {
        const response = await this.stagesInvitationStagesListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/invitation/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesPartialUpdateRaw(
        requestParameters: StagesInvitationStagesPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<InvitationStage>> {
        const requestOptions =
            await this.stagesInvitationStagesPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesPartialUpdate(
        requestParameters: StagesInvitationStagesPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<InvitationStage> {
        const response = await this.stagesInvitationStagesPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesRetrieveRaw(
        requestParameters: StagesInvitationStagesRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<InvitationStage>> {
        const requestOptions =
            await this.stagesInvitationStagesRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesRetrieve(
        requestParameters: StagesInvitationStagesRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<InvitationStage> {
        const response = await this.stagesInvitationStagesRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/invitation/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesUpdateRaw(
        requestParameters: StagesInvitationStagesUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<InvitationStage>> {
        const requestOptions =
            await this.stagesInvitationStagesUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * InvitationStage Viewset
     */
    async stagesInvitationStagesUpdate(
        requestParameters: StagesInvitationStagesUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<InvitationStage> {
        const response = await this.stagesInvitationStagesUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/invitation/stages/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesInvitationStagesUsedByListRaw(
        requestParameters: StagesInvitationStagesUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesInvitationStagesUsedByListRequestOpts(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 stagesInvitationStagesUsedByList(
        requestParameters: StagesInvitationStagesUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesInvitationStagesUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/mtls/`;

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsCreateRaw(
        requestParameters: StagesMtlsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<MutualTLSStage>> {
        const requestOptions = await this.stagesMtlsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsCreate(
        requestParameters: StagesMtlsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<MutualTLSStage> {
        const response = await this.stagesMtlsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/mtls/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsDestroyRaw(
        requestParameters: StagesMtlsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesMtlsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsDestroy(
        requestParameters: StagesMtlsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesMtlsDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/stages/mtls/`;

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsListRaw(
        requestParameters: StagesMtlsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedMutualTLSStageList>> {
        const requestOptions = await this.stagesMtlsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsList(
        requestParameters: StagesMtlsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedMutualTLSStageList> {
        const response = await this.stagesMtlsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/mtls/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsPartialUpdateRaw(
        requestParameters: StagesMtlsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<MutualTLSStage>> {
        const requestOptions = await this.stagesMtlsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsPartialUpdate(
        requestParameters: StagesMtlsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<MutualTLSStage> {
        const response = await this.stagesMtlsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/mtls/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsRetrieveRaw(
        requestParameters: StagesMtlsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<MutualTLSStage>> {
        const requestOptions = await this.stagesMtlsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsRetrieve(
        requestParameters: StagesMtlsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<MutualTLSStage> {
        const response = await this.stagesMtlsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/mtls/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsUpdateRaw(
        requestParameters: StagesMtlsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<MutualTLSStage>> {
        const requestOptions = await this.stagesMtlsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * MutualTLSStage Viewset
     */
    async stagesMtlsUpdate(
        requestParameters: StagesMtlsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<MutualTLSStage> {
        const response = await this.stagesMtlsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/mtls/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesMtlsUsedByListRaw(
        requestParameters: StagesMtlsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesMtlsUsedByListRequestOpts(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 stagesMtlsUsedByList(
        requestParameters: StagesMtlsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesMtlsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/password/`;

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordCreateRaw(
        requestParameters: StagesPasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordStage>> {
        const requestOptions = await this.stagesPasswordCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordCreate(
        requestParameters: StagesPasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordStage> {
        const response = await this.stagesPasswordCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/password/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordDestroyRaw(
        requestParameters: StagesPasswordDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesPasswordDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordDestroy(
        requestParameters: StagesPasswordDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesPasswordDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        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 = `/stages/password/`;

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordListRaw(
        requestParameters: StagesPasswordListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPasswordStageList>> {
        const requestOptions = await this.stagesPasswordListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordList(
        requestParameters: StagesPasswordListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPasswordStageList> {
        const response = await this.stagesPasswordListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/password/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordPartialUpdateRaw(
        requestParameters: StagesPasswordPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordStage>> {
        const requestOptions = await this.stagesPasswordPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordPartialUpdate(
        requestParameters: StagesPasswordPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordStage> {
        const response = await this.stagesPasswordPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/password/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordRetrieveRaw(
        requestParameters: StagesPasswordRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordStage>> {
        const requestOptions = await this.stagesPasswordRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordRetrieve(
        requestParameters: StagesPasswordRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordStage> {
        const response = await this.stagesPasswordRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/password/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordUpdateRaw(
        requestParameters: StagesPasswordUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordStage>> {
        const requestOptions = await this.stagesPasswordUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PasswordStage Viewset
     */
    async stagesPasswordUpdate(
        requestParameters: StagesPasswordUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordStage> {
        const response = await this.stagesPasswordUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/password/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesPasswordUsedByListRaw(
        requestParameters: StagesPasswordUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesPasswordUsedByListRequestOpts(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 stagesPasswordUsedByList(
        requestParameters: StagesPasswordUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesPasswordUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/prompts/`;

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsCreateRaw(
        requestParameters: StagesPromptPromptsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Prompt>> {
        const requestOptions = await this.stagesPromptPromptsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsCreate(
        requestParameters: StagesPromptPromptsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Prompt> {
        const response = await this.stagesPromptPromptsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/prompts/{prompt_uuid}/`;
        urlPath = urlPath.replace(
            `{${"prompt_uuid"}}`,
            encodeURIComponent(String(requestParameters["promptUuid"])),
        );

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsDestroyRaw(
        requestParameters: StagesPromptPromptsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesPromptPromptsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsDestroy(
        requestParameters: StagesPromptPromptsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesPromptPromptsDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

        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 = `/stages/prompt/prompts/`;

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsListRaw(
        requestParameters: StagesPromptPromptsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPromptList>> {
        const requestOptions = await this.stagesPromptPromptsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsList(
        requestParameters: StagesPromptPromptsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPromptList> {
        const response = await this.stagesPromptPromptsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/prompts/{prompt_uuid}/`;
        urlPath = urlPath.replace(
            `{${"prompt_uuid"}}`,
            encodeURIComponent(String(requestParameters["promptUuid"])),
        );

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsPartialUpdateRaw(
        requestParameters: StagesPromptPromptsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Prompt>> {
        const requestOptions =
            await this.stagesPromptPromptsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsPartialUpdate(
        requestParameters: StagesPromptPromptsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Prompt> {
        const response = await this.stagesPromptPromptsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/prompt/prompts/preview/`;

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

    /**
     * Preview a prompt as a challenge, just like a flow would receive
     */
    async stagesPromptPromptsPreviewCreateRaw(
        requestParameters: StagesPromptPromptsPreviewCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PromptChallenge>> {
        const requestOptions =
            await this.stagesPromptPromptsPreviewCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Preview a prompt as a challenge, just like a flow would receive
     */
    async stagesPromptPromptsPreviewCreate(
        requestParameters: StagesPromptPromptsPreviewCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PromptChallenge> {
        const response = await this.stagesPromptPromptsPreviewCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/prompt/prompts/{prompt_uuid}/`;
        urlPath = urlPath.replace(
            `{${"prompt_uuid"}}`,
            encodeURIComponent(String(requestParameters["promptUuid"])),
        );

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsRetrieveRaw(
        requestParameters: StagesPromptPromptsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Prompt>> {
        const requestOptions = await this.stagesPromptPromptsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsRetrieve(
        requestParameters: StagesPromptPromptsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Prompt> {
        const response = await this.stagesPromptPromptsRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/stages/prompt/prompts/{prompt_uuid}/`;
        urlPath = urlPath.replace(
            `{${"prompt_uuid"}}`,
            encodeURIComponent(String(requestParameters["promptUuid"])),
        );

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsUpdateRaw(
        requestParameters: StagesPromptPromptsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Prompt>> {
        const requestOptions = await this.stagesPromptPromptsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Prompt Viewset
     */
    async stagesPromptPromptsUpdate(
        requestParameters: StagesPromptPromptsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Prompt> {
        const response = await this.stagesPromptPromptsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/prompts/{prompt_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"prompt_uuid"}}`,
            encodeURIComponent(String(requestParameters["promptUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesPromptPromptsUsedByListRaw(
        requestParameters: StagesPromptPromptsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesPromptPromptsUsedByListRequestOpts(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 stagesPromptPromptsUsedByList(
        requestParameters: StagesPromptPromptsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesPromptPromptsUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/prompt/stages/`;

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesCreateRaw(
        requestParameters: StagesPromptStagesCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PromptStage>> {
        const requestOptions = await this.stagesPromptStagesCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesCreate(
        requestParameters: StagesPromptStagesCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PromptStage> {
        const response = await this.stagesPromptStagesCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesDestroyRaw(
        requestParameters: StagesPromptStagesDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesPromptStagesDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesDestroy(
        requestParameters: StagesPromptStagesDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesPromptStagesDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

        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 = `/stages/prompt/stages/`;

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesListRaw(
        requestParameters: StagesPromptStagesListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPromptStageList>> {
        const requestOptions = await this.stagesPromptStagesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesList(
        requestParameters: StagesPromptStagesListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPromptStageList> {
        const response = await this.stagesPromptStagesListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesPartialUpdateRaw(
        requestParameters: StagesPromptStagesPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PromptStage>> {
        const requestOptions =
            await this.stagesPromptStagesPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesPartialUpdate(
        requestParameters: StagesPromptStagesPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PromptStage> {
        const response = await this.stagesPromptStagesPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/prompt/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesRetrieveRaw(
        requestParameters: StagesPromptStagesRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PromptStage>> {
        const requestOptions = await this.stagesPromptStagesRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesRetrieve(
        requestParameters: StagesPromptStagesRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PromptStage> {
        const response = await this.stagesPromptStagesRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/prompt/stages/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesUpdateRaw(
        requestParameters: StagesPromptStagesUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PromptStage>> {
        const requestOptions = await this.stagesPromptStagesUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PromptStage Viewset
     */
    async stagesPromptStagesUpdate(
        requestParameters: StagesPromptStagesUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PromptStage> {
        const response = await this.stagesPromptStagesUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/prompt/stages/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesPromptStagesUsedByListRaw(
        requestParameters: StagesPromptStagesUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.stagesPromptStagesUsedByListRequestOpts(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 stagesPromptStagesUsedByList(
        requestParameters: StagesPromptStagesUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesPromptStagesUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/redirect/`;

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectCreateRaw(
        requestParameters: StagesRedirectCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<RedirectStage>> {
        const requestOptions = await this.stagesRedirectCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectCreate(
        requestParameters: StagesRedirectCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<RedirectStage> {
        const response = await this.stagesRedirectCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/redirect/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectDestroyRaw(
        requestParameters: StagesRedirectDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesRedirectDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectDestroy(
        requestParameters: StagesRedirectDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesRedirectDestroyRaw(requestParameters, initOverrides);
    }

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

        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 = `/stages/redirect/`;

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectListRaw(
        requestParameters: StagesRedirectListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedRedirectStageList>> {
        const requestOptions = await this.stagesRedirectListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectList(
        requestParameters: StagesRedirectListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedRedirectStageList> {
        const response = await this.stagesRedirectListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/redirect/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectPartialUpdateRaw(
        requestParameters: StagesRedirectPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<RedirectStage>> {
        const requestOptions = await this.stagesRedirectPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectPartialUpdate(
        requestParameters: StagesRedirectPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<RedirectStage> {
        const response = await this.stagesRedirectPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/redirect/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectRetrieveRaw(
        requestParameters: StagesRedirectRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<RedirectStage>> {
        const requestOptions = await this.stagesRedirectRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectRetrieve(
        requestParameters: StagesRedirectRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<RedirectStage> {
        const response = await this.stagesRedirectRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/redirect/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectUpdateRaw(
        requestParameters: StagesRedirectUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<RedirectStage>> {
        const requestOptions = await this.stagesRedirectUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * RedirectStage Viewset
     */
    async stagesRedirectUpdate(
        requestParameters: StagesRedirectUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<RedirectStage> {
        const response = await this.stagesRedirectUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/redirect/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesRedirectUsedByListRaw(
        requestParameters: StagesRedirectUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesRedirectUsedByListRequestOpts(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 stagesRedirectUsedByList(
        requestParameters: StagesRedirectUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesRedirectUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/source/`;

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceCreateRaw(
        requestParameters: StagesSourceCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SourceStage>> {
        const requestOptions = await this.stagesSourceCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceCreate(
        requestParameters: StagesSourceCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SourceStage> {
        const response = await this.stagesSourceCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/source/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceDestroyRaw(
        requestParameters: StagesSourceDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesSourceDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * SourceStage Viewset
     */
    async stagesSourceDestroy(
        requestParameters: StagesSourceDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesSourceDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

        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 = `/stages/source/`;

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceListRaw(
        requestParameters: StagesSourceListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedSourceStageList>> {
        const requestOptions = await this.stagesSourceListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceList(
        requestParameters: StagesSourceListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedSourceStageList> {
        const response = await this.stagesSourceListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/source/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * SourceStage Viewset
     */
    async stagesSourcePartialUpdateRaw(
        requestParameters: StagesSourcePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SourceStage>> {
        const requestOptions = await this.stagesSourcePartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SourceStage Viewset
     */
    async stagesSourcePartialUpdate(
        requestParameters: StagesSourcePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SourceStage> {
        const response = await this.stagesSourcePartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/source/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceRetrieveRaw(
        requestParameters: StagesSourceRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SourceStage>> {
        const requestOptions = await this.stagesSourceRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceRetrieve(
        requestParameters: StagesSourceRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SourceStage> {
        const response = await this.stagesSourceRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/source/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceUpdateRaw(
        requestParameters: StagesSourceUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SourceStage>> {
        const requestOptions = await this.stagesSourceUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SourceStage Viewset
     */
    async stagesSourceUpdate(
        requestParameters: StagesSourceUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SourceStage> {
        const response = await this.stagesSourceUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/source/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesSourceUsedByListRaw(
        requestParameters: StagesSourceUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesSourceUsedByListRequestOpts(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 stagesSourceUsedByList(
        requestParameters: StagesSourceUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesSourceUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_delete/`;

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteCreateRaw(
        requestParameters: StagesUserDeleteCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserDeleteStage>> {
        const requestOptions = await this.stagesUserDeleteCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteCreate(
        requestParameters: StagesUserDeleteCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserDeleteStage> {
        const response = await this.stagesUserDeleteCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_delete/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteDestroyRaw(
        requestParameters: StagesUserDeleteDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesUserDeleteDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteDestroy(
        requestParameters: StagesUserDeleteDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesUserDeleteDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

        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 = `/stages/user_delete/`;

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteListRaw(
        requestParameters: StagesUserDeleteListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserDeleteStageList>> {
        const requestOptions = await this.stagesUserDeleteListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteList(
        requestParameters: StagesUserDeleteListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserDeleteStageList> {
        const response = await this.stagesUserDeleteListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_delete/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeletePartialUpdateRaw(
        requestParameters: StagesUserDeletePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserDeleteStage>> {
        const requestOptions =
            await this.stagesUserDeletePartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeletePartialUpdate(
        requestParameters: StagesUserDeletePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserDeleteStage> {
        const response = await this.stagesUserDeletePartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/user_delete/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteRetrieveRaw(
        requestParameters: StagesUserDeleteRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserDeleteStage>> {
        const requestOptions = await this.stagesUserDeleteRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteRetrieve(
        requestParameters: StagesUserDeleteRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserDeleteStage> {
        const response = await this.stagesUserDeleteRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/user_delete/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteUpdateRaw(
        requestParameters: StagesUserDeleteUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserDeleteStage>> {
        const requestOptions = await this.stagesUserDeleteUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserDeleteStage Viewset
     */
    async stagesUserDeleteUpdate(
        requestParameters: StagesUserDeleteUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserDeleteStage> {
        const response = await this.stagesUserDeleteUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_delete/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesUserDeleteUsedByListRaw(
        requestParameters: StagesUserDeleteUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesUserDeleteUsedByListRequestOpts(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 stagesUserDeleteUsedByList(
        requestParameters: StagesUserDeleteUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesUserDeleteUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_login/`;

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginCreateRaw(
        requestParameters: StagesUserLoginCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLoginStage>> {
        const requestOptions = await this.stagesUserLoginCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginCreate(
        requestParameters: StagesUserLoginCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLoginStage> {
        const response = await this.stagesUserLoginCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_login/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginDestroyRaw(
        requestParameters: StagesUserLoginDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesUserLoginDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginDestroy(
        requestParameters: StagesUserLoginDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesUserLoginDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

        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 = `/stages/user_login/`;

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginListRaw(
        requestParameters: StagesUserLoginListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserLoginStageList>> {
        const requestOptions = await this.stagesUserLoginListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginList(
        requestParameters: StagesUserLoginListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserLoginStageList> {
        const response = await this.stagesUserLoginListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_login/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginPartialUpdateRaw(
        requestParameters: StagesUserLoginPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLoginStage>> {
        const requestOptions =
            await this.stagesUserLoginPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginPartialUpdate(
        requestParameters: StagesUserLoginPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLoginStage> {
        const response = await this.stagesUserLoginPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/user_login/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginRetrieveRaw(
        requestParameters: StagesUserLoginRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLoginStage>> {
        const requestOptions = await this.stagesUserLoginRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginRetrieve(
        requestParameters: StagesUserLoginRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLoginStage> {
        const response = await this.stagesUserLoginRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/user_login/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginUpdateRaw(
        requestParameters: StagesUserLoginUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLoginStage>> {
        const requestOptions = await this.stagesUserLoginUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLoginStage Viewset
     */
    async stagesUserLoginUpdate(
        requestParameters: StagesUserLoginUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLoginStage> {
        const response = await this.stagesUserLoginUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_login/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesUserLoginUsedByListRaw(
        requestParameters: StagesUserLoginUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesUserLoginUsedByListRequestOpts(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 stagesUserLoginUsedByList(
        requestParameters: StagesUserLoginUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesUserLoginUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_logout/`;

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutCreateRaw(
        requestParameters: StagesUserLogoutCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLogoutStage>> {
        const requestOptions = await this.stagesUserLogoutCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutCreate(
        requestParameters: StagesUserLogoutCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLogoutStage> {
        const response = await this.stagesUserLogoutCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_logout/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutDestroyRaw(
        requestParameters: StagesUserLogoutDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesUserLogoutDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutDestroy(
        requestParameters: StagesUserLogoutDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesUserLogoutDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

        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 = `/stages/user_logout/`;

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutListRaw(
        requestParameters: StagesUserLogoutListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserLogoutStageList>> {
        const requestOptions = await this.stagesUserLogoutListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutList(
        requestParameters: StagesUserLogoutListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserLogoutStageList> {
        const response = await this.stagesUserLogoutListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_logout/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutPartialUpdateRaw(
        requestParameters: StagesUserLogoutPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLogoutStage>> {
        const requestOptions =
            await this.stagesUserLogoutPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutPartialUpdate(
        requestParameters: StagesUserLogoutPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLogoutStage> {
        const response = await this.stagesUserLogoutPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/user_logout/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutRetrieveRaw(
        requestParameters: StagesUserLogoutRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLogoutStage>> {
        const requestOptions = await this.stagesUserLogoutRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutRetrieve(
        requestParameters: StagesUserLogoutRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLogoutStage> {
        const response = await this.stagesUserLogoutRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/user_logout/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutUpdateRaw(
        requestParameters: StagesUserLogoutUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLogoutStage>> {
        const requestOptions = await this.stagesUserLogoutUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserLogoutStage Viewset
     */
    async stagesUserLogoutUpdate(
        requestParameters: StagesUserLogoutUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLogoutStage> {
        const response = await this.stagesUserLogoutUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_logout/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesUserLogoutUsedByListRaw(
        requestParameters: StagesUserLogoutUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesUserLogoutUsedByListRequestOpts(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 stagesUserLogoutUsedByList(
        requestParameters: StagesUserLogoutUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesUserLogoutUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_write/`;

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteCreateRaw(
        requestParameters: StagesUserWriteCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserWriteStage>> {
        const requestOptions = await this.stagesUserWriteCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteCreate(
        requestParameters: StagesUserWriteCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserWriteStage> {
        const response = await this.stagesUserWriteCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_write/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteDestroyRaw(
        requestParameters: StagesUserWriteDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.stagesUserWriteDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteDestroy(
        requestParameters: StagesUserWriteDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.stagesUserWriteDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

        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 = `/stages/user_write/`;

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteListRaw(
        requestParameters: StagesUserWriteListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserWriteStageList>> {
        const requestOptions = await this.stagesUserWriteListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteList(
        requestParameters: StagesUserWriteListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserWriteStageList> {
        const response = await this.stagesUserWriteListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_write/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWritePartialUpdateRaw(
        requestParameters: StagesUserWritePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserWriteStage>> {
        const requestOptions =
            await this.stagesUserWritePartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWritePartialUpdate(
        requestParameters: StagesUserWritePartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserWriteStage> {
        const response = await this.stagesUserWritePartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/stages/user_write/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteRetrieveRaw(
        requestParameters: StagesUserWriteRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserWriteStage>> {
        const requestOptions = await this.stagesUserWriteRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteRetrieve(
        requestParameters: StagesUserWriteRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserWriteStage> {
        const response = await this.stagesUserWriteRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/stages/user_write/{stage_uuid}/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteUpdateRaw(
        requestParameters: StagesUserWriteUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserWriteStage>> {
        const requestOptions = await this.stagesUserWriteUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * UserWriteStage Viewset
     */
    async stagesUserWriteUpdate(
        requestParameters: StagesUserWriteUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserWriteStage> {
        const response = await this.stagesUserWriteUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/stages/user_write/{stage_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"stage_uuid"}}`,
            encodeURIComponent(String(requestParameters["stageUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async stagesUserWriteUsedByListRaw(
        requestParameters: StagesUserWriteUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.stagesUserWriteUsedByListRequestOpts(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 stagesUserWriteUsedByList(
        requestParameters: StagesUserWriteUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.stagesUserWriteUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
