// Auto-generated by DjangoCFG - see CLAUDE.md
'use client';

/**
 * SWR Hooks for TOTP Verification
 *
 * React hooks powered by SWR for data fetching with automatic caching,
 * revalidation, and optimistic updates.
 *
 * Usage:
 * ```typescript
 * // Query hooks (GET)
 * const { data, error, isLoading } = useUsers({ page: 1 })
 *
 * // Mutation hooks (POST/PUT/PATCH/DELETE)
 * const createUser = useCreateUser()
 * await createUser({ name: 'John', email: 'john@example.com' })
 * ```
 */
import { useSWRConfig } from 'swr'
import * as Fetchers from '../fetchers/totp__totp_verification'
import type { API } from '../../index'
import type { VerifyBackupRequest } from '../schemas/VerifyBackupRequest.schema'
import type { VerifyRequest } from '../schemas/VerifyRequest.schema'
import type { VerifyResponse } from '../schemas/VerifyResponse.schema'

/**
 * API operation
 *
 * @method POST
 * @path /cfg/totp/verify/
 */
export function useCreateTotpVerifyCreate() {
  const { mutate } = useSWRConfig()

  return async (data: VerifyRequest, client?: API): Promise<VerifyResponse> => {
    const result = await Fetchers.createTotpVerifyCreate(data, client)
    // Revalidate related queries
    mutate('cfg-totp-verify')
    return result
  }
}


/**
 * API operation
 *
 * @method POST
 * @path /cfg/totp/verify/backup/
 */
export function useCreateTotpVerifyBackupCreate() {
  const { mutate } = useSWRConfig()

  return async (data: VerifyBackupRequest, client?: API): Promise<VerifyResponse> => {
    const result = await Fetchers.createTotpVerifyBackupCreate(data, client)
    // Revalidate related queries
    mutate('cfg-totp-verify-backup')
    return result
  }
}


