# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
from typing import Any

from pydantic import BaseModel, ConfigDict, Field

from ..enums import SystemHealthOverallStatus


class SystemHealthItem(BaseModel):
    """
    Serializer for system health status items. Maps to SystemHealthItem Pydantic
    model.

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

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

    component: str = Field(description='Component name')
    status: SystemHealthOverallStatus = Field(description='Health status  * `healthy` - hea...')
    description: str = Field(description='Status description')
    last_check: str = Field(description='Last check time (ISO format)')
    health_percentage: int | None = Field(
    None,
    description='Health percentage (0-100)',
    ge=0,
    le=100,
)



class SystemHealth(BaseModel):
    """
    Serializer for overall system health status.

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

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

    overall_status: SystemHealthOverallStatus = Field(
    description='Overall system health status  * ...',
)
    overall_health_percentage: int = Field(description='Overall health percentage', ge=0, le=100)
    components: list[SystemHealthItem] = Field(description='Health status of individual comp...')
    timestamp: str = Field(description='Check timestamp (ISO format)')



class SystemMetrics(BaseModel):
    """
    Serializer for system performance metrics.

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

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

    cpu_usage: float = Field(description='CPU usage percentage')
    memory_usage: float = Field(description='Memory usage percentage')
    disk_usage: float = Field(description='Disk usage percentage')
    network_in: str = Field(description='Network incoming bandwidth')
    network_out: str = Field(description='Network outgoing bandwidth')
    response_time: str = Field(description='Average response time')
    uptime: str = Field(description='System uptime')



