1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

refactor response model

This commit is contained in:
checktheroads
2020-01-21 17:30:14 -07:00
parent 252d2d4bb2
commit 9ca90cc2ae
6 changed files with 50 additions and 31 deletions

View File

@@ -8,9 +8,17 @@ from pydantic import StrictStr
from pydantic import constr
class QueryError(BaseModel):
"""Query response model."""
output: StrictStr
level: constr(regex=r"(success|warning|error|danger)")
keywords: List[StrictStr]
class QueryResponse(BaseModel):
"""Query response model."""
output: StrictStr
alert: constr(regex=r"(warning|error|danger)")
keywords: List[StrictStr]
level: constr(regex=r"(success|warning|error|danger)")
keywords: List[StrictStr] = []