Initial monorepo structure
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
"""Settings schemas."""
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SettingResponse(BaseModel):
|
||||
"""Setting response schema."""
|
||||
id: int
|
||||
category: str
|
||||
key: str
|
||||
value: Optional[str]
|
||||
description: Optional[str]
|
||||
is_secret: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class SettingUpdate(BaseModel):
|
||||
"""Setting update schema."""
|
||||
value: str = Field(..., min_length=1)
|
||||
|
||||
|
||||
class SettingListResponse(BaseModel):
|
||||
"""Settings list response by category."""
|
||||
category: str
|
||||
settings: List[SettingResponse]
|
||||
|
||||
|
||||
class EmailSettings(BaseModel):
|
||||
"""Email settings schema."""
|
||||
smtp_server: str
|
||||
smtp_port: int
|
||||
smtp_username: str
|
||||
smtp_password: str
|
||||
email_from: str
|
||||
imap_server: Optional[str] = None
|
||||
imap_port: Optional[int] = None
|
||||
use_tls: bool = True
|
||||
email_fetch_interval: Optional[int] = 300
|
||||
email_delete_after_fetch: Optional[bool] = False
|
||||
|
||||
|
||||
class SMSSettings(BaseModel):
|
||||
"""SMS settings schema."""
|
||||
twilio_account_sid: str
|
||||
twilio_auth_token: str
|
||||
twilio_from_number: str
|
||||
Reference in New Issue
Block a user