// This file is auto-generated by @hey-api/openapi-ts

import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';
import { client } from './client.gen';
import type { CfgAccountsApiKeyRegenerateCreateData, CfgAccountsApiKeyRegenerateCreateErrors, CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRetrieveData, CfgAccountsApiKeyRetrieveErrors, CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRevealCreateData, CfgAccountsApiKeyRevealCreateErrors, CfgAccountsApiKeyRevealCreateResponses, CfgAccountsApiKeyTestCreateData, CfgAccountsApiKeyTestCreateResponses, CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenBlacklistCreateData, CfgAccountsTokenBlacklistCreateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses, CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveErrors, CfgCentrifugoAuthTokenRetrieveResponses, CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateErrors, CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses, CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses, CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses, CfgTotpDisableCreateData, CfgTotpDisableCreateErrors, CfgTotpDisableCreateResponses, CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateErrors, CfgTotpSetupConfirmCreateResponses, CfgTotpSetupCreateData, CfgTotpSetupCreateErrors, CfgTotpSetupCreateResponses, CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateErrors, CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyCreateData, CfgTotpVerifyCreateErrors, CfgTotpVerifyCreateResponses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
};

export class CfgAccountsApiKey {
    /**
     * Get API key details
     *
     * Retrieve the current user's API key (masked) and metadata.
     */
    public static cfgAccountsApiKeyRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsApiKeyRetrieveData, ThrowOnError>): RequestResult<CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRetrieveErrors, ThrowOnError> {
        return (options?.client ?? client).get<CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRetrieveErrors, ThrowOnError>({
            security: [
                { scheme: 'bearer', type: 'http' },
                {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                },
                { name: 'X-API-Key', type: 'apiKey' }
            ],
            url: '/cfg/accounts/api-key/',
            ...options
        });
    }
    
    /**
     * Regenerate API key
     *
     * Generate a new API key. The full key is returned only once.
     */
    public static cfgAccountsApiKeyRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyRegenerateCreateData, ThrowOnError>): RequestResult<CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRegenerateCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRegenerateCreateErrors, ThrowOnError>({
            security: [
                { scheme: 'bearer', type: 'http' },
                {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                },
                { name: 'X-API-Key', type: 'apiKey' }
            ],
            url: '/cfg/accounts/api-key/regenerate/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * Reveal API key
     *
     * Return the current full API key WITHOUT rotating it. The same durable value every one of the user's agents uses — for the signed-in user to copy and paste into agent onboarding. Default GET stays masked; this is the explicit reveal action.
     */
    public static cfgAccountsApiKeyRevealCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyRevealCreateData, ThrowOnError>): RequestResult<CfgAccountsApiKeyRevealCreateResponses, CfgAccountsApiKeyRevealCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsApiKeyRevealCreateResponses, CfgAccountsApiKeyRevealCreateErrors, ThrowOnError>({
            security: [
                { scheme: 'bearer', type: 'http' },
                {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                },
                { name: 'X-API-Key', type: 'apiKey' }
            ],
            url: '/cfg/accounts/api-key/reveal/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * Test API key
     *
     * Test whether an API key is valid without consuming it.
     */
    public static cfgAccountsApiKeyTestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyTestCreateData, ThrowOnError>): RequestResult<CfgAccountsApiKeyTestCreateResponses, unknown, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsApiKeyTestCreateResponses, unknown, ThrowOnError>({
            security: [
                { scheme: 'bearer', type: 'http' },
                {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                },
                { name: 'X-API-Key', type: 'apiKey' }
            ],
            url: '/cfg/accounts/api-key/test/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}

export class CfgAccountsOauth {
    /**
     * List OAuth connections
     *
     * Get all OAuth connections for the current user.
     */
    public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>): RequestResult<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError> {
        return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/accounts/oauth/connections/',
            ...options
        });
    }
    
    /**
     * Disconnect OAuth provider
     *
     * Remove OAuth connection for the specified provider.
     */
    public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>): RequestResult<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/accounts/oauth/disconnect/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * Start GitHub OAuth
     *
     * Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
     */
    public static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>): RequestResult<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError> {
        return (options?.client ?? client).post<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError>({
            url: '/cfg/accounts/oauth/github/authorize/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options?.headers
            }
        });
    }
    
    /**
     * Complete GitHub OAuth
     *
     * Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
     */
    public static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>): RequestResult<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError>({
            url: '/cfg/accounts/oauth/github/callback/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * List OAuth providers
     *
     * Get list of available OAuth providers for authentication.
     */
    public static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>): RequestResult<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError> {
        return (options?.client ?? client).get<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>({ url: '/cfg/accounts/oauth/providers/', ...options });
    }
}

export class CfgAccounts {
    /**
     * Request OTP code to email.
     */
    public static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>): RequestResult<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/accounts/otp/request/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * Verify OTP code and return JWT tokens or 2FA session.
     *
     * If user has 2FA enabled:
     * - Returns requires_2fa=True with session_id
     * - Client must complete 2FA verification at /cfg/totp/verify/
     *
     * If user has no 2FA:
     * - Returns JWT tokens and user data directly
     */
    public static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>): RequestResult<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/accounts/otp/verify/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}

export class CfgAccountsProfile {
    /**
     * Get current user profile
     *
     * Retrieve the current authenticated user's profile information.
     */
    public static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>): RequestResult<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError> {
        return (options?.client ?? client).get<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError>({
            security: [{ scheme: 'bearer', type: 'http' }, {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                }],
            url: '/cfg/accounts/profile/',
            ...options
        });
    }
    
    /**
     * Upload user avatar
     *
     * Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
     */
    public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>): RequestResult<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError> {
        return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
            ...formDataBodySerializer,
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/accounts/profile/avatar/',
            ...options,
            headers: {
                'Content-Type': null,
                ...options?.headers
            }
        });
    }
    
    /**
     * Delete user account
     *
     *
     * Permanently delete the current user's account.
     *
     * This operation:
     * - Deactivates the account (user cannot log in)
     * - Anonymizes personal data (GDPR compliance)
     * - Frees up the email address for re-registration
     * - Preserves audit trail
     *
     * The account can be restored by an administrator if needed.
     *
     */
    public static cfgAccountsProfileDeleteCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileDeleteCreateData, ThrowOnError>): RequestResult<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError> {
        return (options?.client ?? client).post<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError>({
            security: [{ scheme: 'bearer', type: 'http' }, {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                }],
            url: '/cfg/accounts/profile/delete/',
            ...options
        });
    }
    
    /**
     * Partial update user profile
     *
     * Partially update the current authenticated user's profile information. Supports avatar upload.
     */
    public static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError> {
        return (options?.client ?? client).patch<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError>({
            security: [{ scheme: 'bearer', type: 'http' }, {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                }],
            url: '/cfg/accounts/profile/partial/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options?.headers
            }
        });
    }
    
    /**
     * Partial update user profile
     *
     * Partially update the current authenticated user's profile information. Supports avatar upload.
     */
    public static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError> {
        return (options?.client ?? client).put<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError>({
            security: [{ scheme: 'bearer', type: 'http' }, {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                }],
            url: '/cfg/accounts/profile/partial/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options?.headers
            }
        });
    }
    
    /**
     * Update user profile
     *
     * Update the current authenticated user's profile information.
     */
    public static cfgAccountsProfileUpdatePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdatePartialUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError> {
        return (options?.client ?? client).patch<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError>({
            security: [{ scheme: 'bearer', type: 'http' }, {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                }],
            url: '/cfg/accounts/profile/update/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options?.headers
            }
        });
    }
    
    /**
     * Update user profile
     *
     * Update the current authenticated user's profile information.
     */
    public static cfgAccountsProfileUpdateUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdateUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError> {
        return (options?.client ?? client).put<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError>({
            security: [{ scheme: 'bearer', type: 'http' }, {
                    in: 'cookie',
                    name: 'sessionid',
                    type: 'apiKey'
                }],
            url: '/cfg/accounts/profile/update/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options?.headers
            }
        });
    }
}

export class CfgAccountsAuth {
    /**
     * Revoke a refresh token (logout).
     *
     * Blacklists the posted refresh token so it can never mint another access
     * token. Called best-effort by the client's logout — without it, "logout"
     * is purely client-side and a stolen refresh token survives until expiry.
     */
    public static cfgAccountsTokenBlacklistCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenBlacklistCreateData, ThrowOnError>): RequestResult<CfgAccountsTokenBlacklistCreateResponses, unknown, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsTokenBlacklistCreateResponses, unknown, ThrowOnError>({
            url: '/cfg/accounts/token/blacklist/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * Refresh JWT token.
     *
     * DPoP-aware: when the incoming refresh token is key-bound (`cnf.jkt`), the
     * rotated access/refresh in the response are re-stamped with the same `cnf`
     * (stock SimpleJWT drops it from the derived access), and a matching DPoP
     * proof is required on the refresh request — so a stolen refresh token can't
     * be used to mint fresh tokens.
     */
    public static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>): RequestResult<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError> {
        return (options.client ?? client).post<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError>({
            url: '/cfg/accounts/token/refresh/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}

export class CfgCentrifugo {
    /**
     * Get Centrifugo connection token
     *
     * Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
     */
    public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>): RequestResult<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError> {
        return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/centrifugo/auth/token/',
            ...options
        });
    }
}

export class CfgTotpBackupCodes {
    /**
     * Get backup codes status for user.
     */
    public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>): RequestResult<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError> {
        return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/backup-codes/',
            ...options
        });
    }
    
    /**
     * Regenerate backup codes.
     *
     * Requires TOTP code for verification.
     * Invalidates all existing codes.
     */
    public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>): RequestResult<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/backup-codes/regenerate/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}

export class CfgTotp {
    /**
     * List all TOTP devices for user.
     */
    public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>): RequestResult<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError> {
        return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/devices/',
            ...options
        });
    }
    
    /**
     * Delete a TOTP device.
     *
     * Requires verification code if removing the last/primary device.
     */
    public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>): RequestResult<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError> {
        return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/devices/{id}/',
            ...options
        });
    }
    
    /**
     * Completely disable 2FA for account.
     *
     * Requires verification code.
     */
    public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>): RequestResult<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/disable/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}

export class CfgTotpSetup {
    /**
     * Start 2FA setup process.
     *
     * Creates a new TOTP device and returns QR code for scanning.
     */
    public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>): RequestResult<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError> {
        return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/setup/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options?.headers
            }
        });
    }
    
    /**
     * Confirm 2FA setup with first valid code.
     *
     * Activates the device and generates backup codes.
     */
    public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>): RequestResult<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/setup/confirm/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}

export class CfgTotpVerify {
    /**
     * Verify TOTP code for 2FA session.
     *
     * Completes authentication and returns JWT tokens on success.
     */
    public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>): RequestResult<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/verify/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
    
    /**
     * Verify backup recovery code for 2FA session.
     *
     * Alternative verification method when TOTP device unavailable.
     */
    public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>): RequestResult<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError> {
        return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
            security: [
                { name: 'X-API-Key', type: 'apiKey' },
                { scheme: 'bearer', type: 'http' },
                { name: 'Authorization', type: 'apiKey' }
            ],
            url: '/cfg/totp/verify/backup/',
            ...options,
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            }
        });
    }
}
