feat(api): Add named events totals endpoint and deprecate raw version

This commit is contained in:
Adam Outler
2026-02-03 18:32:35 +01:00
parent a1a6c7e1cf
commit 7caa6a1949
2 changed files with 50 additions and 0 deletions

View File

@@ -318,6 +318,24 @@ class DeviceTotalsNamedResponse(BaseResponse):
)
class EventsTotalsNamedResponse(BaseResponse):
"""Response with named event/session statistics."""
totals: Dict[str, int] = Field(
...,
description="Dictionary of counts: total, sessions, missing, voided, new, down",
json_schema_extra={
"examples": [{
"total": 100,
"sessions": 50,
"missing": 0,
"voided": 0,
"new": 5,
"down": 2
}]
}
)
class DeviceExportRequest(BaseModel):
"""Request for exporting devices."""
format: Literal["csv", "json"] = Field(