Source code for julee.api.responses

"""
Pydantic models for API responses.
These define the contract between the API and external clients.

Following clean architecture principles, most endpoints return domain models
directly rather than creating wrapper response models. This file contains
only response models that are specific to API concerns and not represented
by existing domain models.
"""

from pydantic import BaseModel
from enum import Enum


[docs] class ServiceStatus(str, Enum): """Service status enumeration."""
[docs] UP = "up"
[docs] DOWN = "down"
[docs] class SystemStatus(str, Enum): """Overall system status enumeration."""
[docs] HEALTHY = "healthy"
[docs] DEGRADED = "degraded"
[docs] UNHEALTHY = "unhealthy"
[docs] class ServiceHealthStatus(BaseModel): """Health status for individual services."""
[docs] api: ServiceStatus
[docs] temporal: ServiceStatus
[docs] storage: ServiceStatus
[docs] class HealthCheckResponse(BaseModel): """Response for health check endpoint."""
[docs] status: SystemStatus
[docs] timestamp: str
[docs] services: ServiceHealthStatus