20 lines
382 B
Python
20 lines
382 B
Python
from typing import Any
|
|||
|
|
|
||
|
|
from pydantic import BaseModel, ConfigDict, Field
|
||
|
|
|
||
|
|
|
||
|
|
class SuccessEnvelope(BaseModel):
|
||
|
|
model_config = ConfigDict(frozen=True)
|
||
|
|
|
||
|
|
data: Any
|
||
|
|
trace_id: str
|
||
|
|
|
||
|
|
|
||
|
|
class ErrorEnvelope(BaseModel):
|
||
|
|
model_config = ConfigDict(frozen=True)
|
||
|
|
|
||
|
|
code: str
|
||
|
|
message: str
|
||
|
|
trace_id: str
|
||
|
|
field_errors: list[dict[str, str]] = Field(default_factory=list)
|