init commit
This commit is contained in:
17
app/api/schemas/template.py
Normal file
17
app/api/schemas/template.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
from typing import Optional, Literal
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
|
||||
class TemplateIn(BaseModel):
|
||||
name: str = Field(min_length=1, max_length=64)
|
||||
title: Optional[str] = None
|
||||
type: Literal["text","photo","video","animation"] = "text"
|
||||
content: str
|
||||
keyboard_tpl: Optional[list[dict]] = None
|
||||
parse_mode: Optional[str] = "HTML"
|
||||
visibility: Literal["private","org","public"] = "private"
|
||||
|
||||
class TemplateOut(TemplateIn):
|
||||
id: int
|
||||
is_archived: bool
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user