mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
refactor response model
This commit is contained in:
@@ -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] = []
|
||||
|
Reference in New Issue
Block a user