2026-07-06 09:28:02 -08:00
|
|
|
from typing import Any
|
2025-03-08 10:01:08 -06:00
|
|
|
|
2026-01-04 12:21:55 -06:00
|
|
|
from pydantic import BaseModel, Field
|
2024-09-24 14:05:30 +01:00
|
|
|
|
2026-05-20 09:36:49 -05:00
|
|
|
from frigate.config import GenAIProviderEnum
|
|
|
|
|
|
2024-09-24 14:05:30 +01:00
|
|
|
|
|
|
|
|
class AppConfigSetBody(BaseModel):
|
|
|
|
|
requires_restart: int = 1
|
2025-05-22 20:51:23 -06:00
|
|
|
update_topic: str | None = None
|
2026-07-06 09:28:02 -08:00
|
|
|
config_data: dict[str, Any] | None = None
|
2026-03-04 10:07:34 -06:00
|
|
|
skip_save: bool = False
|
2024-09-24 14:05:30 +01:00
|
|
|
|
|
|
|
|
|
2026-05-20 09:36:49 -05:00
|
|
|
class GenAIProbeBody(BaseModel):
|
|
|
|
|
provider: GenAIProviderEnum
|
2026-07-18 12:19:37 -05:00
|
|
|
name: str | None = None
|
2026-07-06 09:28:02 -08:00
|
|
|
api_key: str | None = None
|
|
|
|
|
base_url: str | None = None
|
|
|
|
|
provider_options: dict[str, Any] = Field(default_factory=dict)
|
2026-05-20 09:36:49 -05:00
|
|
|
|
|
|
|
|
|
2024-09-24 14:05:30 +01:00
|
|
|
class AppPutPasswordBody(BaseModel):
|
|
|
|
|
password: str
|
2026-07-06 09:28:02 -08:00
|
|
|
old_password: str | None = None
|
2024-09-24 14:05:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppPostUsersBody(BaseModel):
|
|
|
|
|
username: str
|
|
|
|
|
password: str
|
2026-07-06 09:28:02 -08:00
|
|
|
role: str | None = "viewer"
|
2024-09-24 14:05:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppPostLoginBody(BaseModel):
|
|
|
|
|
user: str
|
|
|
|
|
password: str
|
2025-03-08 10:01:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppPutRoleBody(BaseModel):
|
|
|
|
|
role: str
|
2026-01-04 12:21:55 -06:00
|
|
|
|
|
|
|
|
|
2026-03-19 16:39:28 -06:00
|
|
|
class CameraSetBody(BaseModel):
|
|
|
|
|
value: str = Field(..., description="The value to set for the feature")
|
2026-03-19 09:47:57 -05:00
|
|
|
|
|
|
|
|
|
2026-01-04 12:21:55 -06:00
|
|
|
class MediaSyncBody(BaseModel):
|
|
|
|
|
dry_run: bool = Field(
|
|
|
|
|
default=True, description="If True, only report orphans without deleting them"
|
|
|
|
|
)
|
2026-07-06 09:28:02 -08:00
|
|
|
media_types: list[str] = Field(
|
2026-01-04 12:21:55 -06:00
|
|
|
default=["all"],
|
|
|
|
|
description="Types of media to sync: 'all', 'event_snapshots', 'event_thumbnails', 'review_thumbnails', 'previews', 'exports', 'recordings'",
|
|
|
|
|
)
|
|
|
|
|
force: bool = Field(
|
|
|
|
|
default=False, description="If True, bypass safety threshold checks"
|
|
|
|
|
)
|
2026-03-23 11:05:38 -05:00
|
|
|
verbose: bool = Field(
|
|
|
|
|
default=False,
|
|
|
|
|
description="If True, write full orphan file list to disk",
|
|
|
|
|
)
|