2024-09-24 15:05:30 +02:00
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
DEFAULT_TIME_RANGE = "00:00,24:00"
|
|
|
|
|
|
|
|
|
|
|
|
class EventsQueryParams(BaseModel):
|
|
|
|
camera: Optional[str] = "all"
|
|
|
|
cameras: Optional[str] = "all"
|
|
|
|
label: Optional[str] = "all"
|
|
|
|
labels: Optional[str] = "all"
|
|
|
|
sub_label: Optional[str] = "all"
|
|
|
|
sub_labels: Optional[str] = "all"
|
|
|
|
zone: Optional[str] = "all"
|
|
|
|
zones: Optional[str] = "all"
|
|
|
|
limit: Optional[int] = 100
|
|
|
|
after: Optional[float] = None
|
|
|
|
before: Optional[float] = None
|
|
|
|
time_range: Optional[str] = DEFAULT_TIME_RANGE
|
|
|
|
has_clip: Optional[int] = None
|
|
|
|
has_snapshot: Optional[int] = None
|
|
|
|
in_progress: Optional[int] = None
|
|
|
|
include_thumbnails: Optional[int] = 1
|
|
|
|
favorites: Optional[int] = None
|
|
|
|
min_score: Optional[float] = None
|
|
|
|
max_score: Optional[float] = None
|
|
|
|
is_submitted: Optional[int] = None
|
|
|
|
min_length: Optional[float] = None
|
|
|
|
max_length: Optional[float] = None
|
2024-11-03 00:16:07 +01:00
|
|
|
event_id: Optional[str] = None
|
2024-09-24 15:05:30 +02:00
|
|
|
sort: Optional[str] = None
|
|
|
|
timezone: Optional[str] = "utc"
|
|
|
|
|
|
|
|
|
|
|
|
class EventsSearchQueryParams(BaseModel):
|
|
|
|
query: Optional[str] = None
|
|
|
|
event_id: Optional[str] = None
|
2024-10-17 18:02:27 +02:00
|
|
|
search_type: Optional[str] = "thumbnail"
|
2024-09-24 15:05:30 +02:00
|
|
|
include_thumbnails: Optional[int] = 1
|
|
|
|
limit: Optional[int] = 50
|
|
|
|
cameras: Optional[str] = "all"
|
|
|
|
labels: Optional[str] = "all"
|
|
|
|
zones: Optional[str] = "all"
|
|
|
|
after: Optional[float] = None
|
|
|
|
before: Optional[float] = None
|
2024-09-26 22:30:56 +02:00
|
|
|
time_range: Optional[str] = DEFAULT_TIME_RANGE
|
2024-10-18 23:16:43 +02:00
|
|
|
has_clip: Optional[bool] = None
|
|
|
|
has_snapshot: Optional[bool] = None
|
2024-09-24 15:05:30 +02:00
|
|
|
timezone: Optional[str] = "utc"
|
2024-10-17 13:30:52 +02:00
|
|
|
min_score: Optional[float] = None
|
|
|
|
max_score: Optional[float] = None
|
|
|
|
sort: Optional[str] = None
|
2024-09-24 15:05:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
class EventsSummaryQueryParams(BaseModel):
|
|
|
|
timezone: Optional[str] = "utc"
|
|
|
|
has_clip: Optional[int] = None
|
|
|
|
has_snapshot: Optional[int] = None
|