# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
from typing import Any

from pydantic import BaseModel, ConfigDict, Field


class SetupRequest(BaseModel):
    """
    Serializer for starting 2FA setup.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    device_name: str | None = Field(
    None,
    description='Device name for identification (...',
    min_length=1,
    max_length=100,
)



class SetupResponse(BaseModel):
    """
    Response serializer for setup initiation.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    device_id: str = Field(description='Device ID to use for confirmation')
    secret: str = Field(description='Base32-encoded TOTP secret (for ...')
    provisioning_uri: str = Field(description='otpauth:// URI for QR code gener...')
    qr_code_base64: str = Field(description='Base64-encoded QR code image (da...')
    expires_in: int = Field(description='Seconds until setup expires (typ...')



class ConfirmSetupRequest(BaseModel):
    """
    Serializer for confirming 2FA setup with first code.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    device_id: str = Field(description='Device ID from setup response')
    code: str = Field(
    description='6-digit TOTP code from authentic...',
    min_length=6,
    max_length=6,
)



class ConfirmSetupResponse(BaseModel):
    """
    Response serializer for setup confirmation.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    message: str = ...
    backup_codes: list[str] = Field(description='List of backup recovery codes (s...')
    backup_codes_warning: str = Field(description='Warning message about backup codes')



