blakeblackshear.frigate/frigate/api/defs/events_body.py
Nicolas Mowen 4c24b70d47
Do not use a default value of datetime for params (#13957)
* Do not use a default value of datetime for params

* Formatting

* Remove unused

* Undo
2024-09-25 10:49:54 -05:00

34 lines
840 B
Python

from typing import Optional, Union
from pydantic import BaseModel, Field
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
)
class EventsDescriptionBody(BaseModel):
description: Union[str, None] = Field(
title="The description of the event", min_length=1
)
class EventsCreateBody(BaseModel):
source_type: Optional[str] = "api"
sub_label: Optional[str] = None
score: Optional[int] = 0
duration: Optional[int] = 30
include_recording: Optional[bool] = True
draw: Optional[dict] = {}
class EventsEndBody(BaseModel):
end_time: Optional[int] = None
class SubmitPlusBody(BaseModel):
include_annotation: int = Field(default=1)