Files
labFusion/services/service-adapters/models/schemas.py
glenn schrooyen 8d1755fd52
Some checks failed
API Docs (Node.js Express) / test (16) (push) Failing after 5m29s
API Docs (Node.js Express) / test (18) (push) Failing after 5m25s
API Docs (Node.js Express) / test (20) (push) Failing after 1m4s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 4m52s
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 5m1s
LabFusion CI/CD Pipeline / api-docs (push) Failing after 5m12s
LabFusion CI/CD Pipeline / frontend (push) Failing after 6m39s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 34s
Docker Build and Push / security-scan (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 1m33s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 35s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 5m20s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 5m27s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 5m50s
Docker Build and Push / deploy-staging (push) Has been skipped
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
Refactor API Docs CI workflow to correct ESLint command syntax and enhance Python formatting in CI pipelines; update progress tracking documentation
2025-09-12 17:44:23 +02:00

81 lines
2.8 KiB
Python

from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class ServiceStatus(BaseModel):
enabled: bool = Field(..., description="Whether the service is enabled")
url: str = Field(..., description="Service URL")
status: str = Field(..., description="Service status")
class HAAttributes(BaseModel):
unit_of_measurement: Optional[str] = Field(None, description="Unit of measurement")
friendly_name: Optional[str] = Field(None, description="Friendly name")
class HAEntity(BaseModel):
entity_id: str = Field(..., description="Entity ID")
state: str = Field(..., description="Current state")
attributes: HAAttributes = Field(..., description="Entity attributes")
class HAEntitiesResponse(BaseModel):
entities: List[HAEntity] = Field(..., description="List of Home Assistant entities")
class FrigateEvent(BaseModel):
id: str = Field(..., description="Event ID")
timestamp: str = Field(..., description="Event timestamp")
camera: str = Field(..., description="Camera name")
label: str = Field(..., description="Detection label")
confidence: float = Field(..., ge=0, le=1, description="Detection confidence")
class FrigateEventsResponse(BaseModel):
events: List[FrigateEvent] = Field(..., description="List of Frigate events")
class ImmichAsset(BaseModel):
id: str = Field(..., description="Asset ID")
filename: str = Field(..., description="Filename")
created_at: str = Field(..., description="Creation timestamp")
tags: List[str] = Field(..., description="Asset tags")
faces: List[str] = Field(..., description="Detected faces")
class ImmichAssetsResponse(BaseModel):
assets: List[ImmichAsset] = Field(..., description="List of Immich assets")
class EventData(BaseModel):
service: str = Field(..., description="Service name")
event_type: str = Field(..., description="Event type")
metadata: Dict[str, Any] = Field(default_factory=dict, description="Event metadata")
class EventResponse(BaseModel):
status: str = Field(..., description="Publication status")
event: Dict[str, Any] = Field(..., description="Published event")
class Event(BaseModel):
timestamp: str = Field(..., description="Event timestamp")
service: str = Field(..., description="Service name")
event_type: str = Field(..., description="Event type")
metadata: str = Field(..., description="Event metadata as JSON string")
class EventsResponse(BaseModel):
events: List[Event] = Field(..., description="List of events")
class HealthResponse(BaseModel):
status: str = Field(..., description="Service health status")
timestamp: str = Field(..., description="Health check timestamp")
class RootResponse(BaseModel):
message: str = Field(..., description="API message")
version: str = Field(..., description="API version")