44 lines
927 B
Python
44 lines
927 B
Python
|
|
# generated by datamodel-codegen:
|
||
|
|
# filename: situation_report.json
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from enum import StrEnum
|
||
|
|
|
||
|
|
from pydantic import AwareDatetime, BaseModel, ConfigDict, constr
|
||
|
|
|
||
|
|
|
||
|
|
class RiskLevel(StrEnum):
|
||
|
|
LOW = 'LOW'
|
||
|
|
MEDIUM = 'MEDIUM'
|
||
|
|
HIGH = 'HIGH'
|
||
|
|
EXTREME = 'EXTREME'
|
||
|
|
|
||
|
|
|
||
|
|
class Kind(StrEnum):
|
||
|
|
TREND = 'TREND'
|
||
|
|
ANOMALY = 'ANOMALY'
|
||
|
|
RISK = 'RISK'
|
||
|
|
ATTRIBUTION = 'ATTRIBUTION'
|
||
|
|
|
||
|
|
|
||
|
|
class Finding(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
kind: Kind
|
||
|
|
summary: constr(min_length=1)
|
||
|
|
refs: list[constr(pattern=r'^[0-9a-f]{64}$')]
|
||
|
|
|
||
|
|
|
||
|
|
class SituationReport(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
id: constr(min_length=1)
|
||
|
|
market_date: constr(pattern=r'^\d{4}-\d{2}-\d{2}$')
|
||
|
|
risk_level: RiskLevel
|
||
|
|
findings: list[Finding]
|
||
|
|
forecast_refs: list[constr(min_length=1)]
|
||
|
|
generated_at: AwareDatetime
|