data-api / models /index.py
camphong24032002
feat: get vn100 symbols
be1eeae
raw
history blame
281 Bytes
from pydantic import BaseModel, validator
class IndexPayload(BaseModel):
source: str = "database"
@validator("source")
def valid_source(cls, v):
if v not in ["database", "hsx"]:
raise ValueError('source must be database or hsx')
return v