wrolpi/wrolpi/schema.py
Roland 287edad9e6
Adding Download.settings column in alembic migration.
Reformatting.

Switching excluded_urls to a generic Download.settings json.

Download workers filter excluded urls.
2022-10-14 13:08:39 -06:00

61 lines
1.2 KiB
Python

from dataclasses import dataclass
from typing import Optional
@dataclass
class SettingsObject:
media_directory: str
@dataclass
class SettingsResponse:
config: SettingsObject
@dataclass
class SettingsRequest:
download_on_startup: Optional[bool] = None
download_timeout: Optional[int] = None
hotspot_device: Optional[str] = None
hotspot_on_startup: Optional[bool] = None
hotspot_password: Optional[str] = None
hotspot_ssid: Optional[str] = None
hotspot_status: Optional[bool] = None
media_directory: Optional[str] = None
throttle_on: Optional[bool] = None
throttle_on_startup: Optional[bool] = None
timezone: Optional[str] = None
wrol_mode: Optional[bool] = None
@dataclass
class RegexRequest:
regex: str
@dataclass
class RegexResponse:
regex: str
valid: bool
@dataclass
class EchoResponse:
form: dict
headers: dict
json: str
method: str
@dataclass
class DownloadRequest:
urls: str
downloader: Optional[str] = None
frequency: Optional[int] = None
sub_downloader: Optional[str] = None
excluded_urls: Optional[str] = None
@dataclass
class JSONErrorResponse:
error: str