2024-12-02 21:12:55 +03:00
|
|
|
from typing import List, Optional, Union
|
2024-09-24 16:05:30 +03:00
|
|
|
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
2025-07-07 17:03:57 +03:00
|
|
|
from frigate.config.classification import TriggerType
|
|
|
|
|
|
2024-09-24 16:05:30 +03:00
|
|
|
|
|
|
|
|
class EventsSubLabelBody(BaseModel):
|
|
|
|
|
subLabel: str = Field(title="Sub label", max_length=100)
|
|
|
|
|
subLabelScore: Optional[float] = Field(
|
|
|
|
|
title="Score for sub label", default=None, gt=0.0, le=1.0
|
|
|
|
|
)
|
2024-10-23 22:50:58 +03:00
|
|
|
camera: Optional[str] = Field(
|
|
|
|
|
title="Camera this object is detected on.", default=None
|
|
|
|
|
)
|
2024-09-24 16:05:30 +03:00
|
|
|
|
|
|
|
|
|
2025-04-10 17:27:01 +03:00
|
|
|
class EventsLPRBody(BaseModel):
|
|
|
|
|
recognizedLicensePlate: str = Field(
|
|
|
|
|
title="Recognized License Plate", max_length=100
|
|
|
|
|
)
|
|
|
|
|
recognizedLicensePlateScore: Optional[float] = Field(
|
|
|
|
|
title="Score for recognized license plate", default=None, gt=0.0, le=1.0
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2025-12-18 17:35:47 +03:00
|
|
|
class EventsAttributesBody(BaseModel):
|
|
|
|
|
attributes: List[str] = Field(
|
|
|
|
|
title="Selected classification attributes for the event",
|
|
|
|
|
default_factory=list,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2024-09-24 16:05:30 +03:00
|
|
|
class EventsDescriptionBody(BaseModel):
|
2024-10-11 02:12:05 +03:00
|
|
|
description: Union[str, None] = Field(title="The description of the event")
|
2024-09-24 16:05:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class EventsCreateBody(BaseModel):
|
|
|
|
|
sub_label: Optional[str] = None
|
2024-12-01 17:47:37 +03:00
|
|
|
score: Optional[float] = 0
|
2024-09-24 16:05:30 +03:00
|
|
|
duration: Optional[int] = 30
|
|
|
|
|
include_recording: Optional[bool] = True
|
|
|
|
|
draw: Optional[dict] = {}
|
2026-02-27 07:16:10 +03:00
|
|
|
pre_capture: Optional[int] = None
|
2024-09-24 16:05:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class EventsEndBody(BaseModel):
|
2024-12-01 17:47:37 +03:00
|
|
|
end_time: Optional[float] = None
|
2024-09-24 20:22:11 +03:00
|
|
|
|
|
|
|
|
|
2024-12-02 21:12:55 +03:00
|
|
|
class EventsDeleteBody(BaseModel):
|
|
|
|
|
event_ids: List[str] = Field(title="The event IDs to delete")
|
|
|
|
|
|
|
|
|
|
|
2024-09-24 20:22:11 +03:00
|
|
|
class SubmitPlusBody(BaseModel):
|
|
|
|
|
include_annotation: int = Field(default=1)
|
2025-07-07 17:03:57 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TriggerEmbeddingBody(BaseModel):
|
|
|
|
|
type: TriggerType
|
|
|
|
|
data: str
|
|
|
|
|
threshold: float = Field(default=0.5, ge=0.0, le=1.0)
|