# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
from typing import Any

from pydantic import BaseModel, ConfigDict, Field


class Command(BaseModel):
    """
    Django management command serializer. Includes security metadata from base
    classes (SafeCommand, InteractiveCommand, etc.): - web_executable: Can be
    executed via web interface - requires_input: Requires interactive user input
    - is_destructive: Modifies or deletes data

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

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

    name: str = ...
    app: str = ...
    help: str = ...
    is_core: bool = ...
    is_custom: bool = ...
    is_allowed: bool | None = None
    risk_level: str | None = None
    web_executable: bool | None = Field(None, description='Can be executed via web interface')
    requires_input: bool | None = Field(None, description='Requires interactive user input')
    is_destructive: bool | None = Field(None, description='Modifies or deletes data')



class CommandHelpResponse(BaseModel):
    """
    Response serializer for command help.

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

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

    status: str = ...
    command: str = ...
    app: str | None = None
    help_text: str | None = None
    is_allowed: bool | None = None
    risk_level: str | None = None
    error: str | None = None



class CommandExecuteRequestRequest(BaseModel):
    """
    Request serializer for command execution.

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

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

    command: str = Field(description='Name of the Django management co...', min_length=1)
    args: list[str] | None = Field(None, description='Positional arguments for the com...')
    options: dict[str, Any] | None = Field(None, description='Named options for the command (e...')



class CommandCategory(BaseModel):
    """
    Category with commands.

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

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

    category: str = Field(description='Category name')
    commands: list[Command] = Field(description='Commands in this category')



class CommandsSummary(BaseModel):
    """
    Commands summary serializer.

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

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

    total_commands: int = ...
    core_commands: int = ...
    custom_commands: int = ...
    categories: list[str] = ...
    commands: list[Command] = ...
    categorized: list[CommandCategory] = Field(description='Commands grouped by category')



