32 lines
533 B
Python
32 lines
533 B
Python
from __future__ import annotations
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class Envelope(BaseModel):
|
|
data: object
|
|
|
|
|
|
class PaginatedEnvelope(BaseModel):
|
|
items: list
|
|
total: int
|
|
limit: int
|
|
offset: int
|
|
|
|
|
|
class PaginationEnvelope(BaseModel):
|
|
items: list
|
|
total: int
|
|
limit: int = Field(default=50)
|
|
offset: int = Field(default=0)
|
|
|
|
|
|
class ApiErrorItem(BaseModel):
|
|
code: str
|
|
message: str
|
|
details: dict = Field(default_factory=dict)
|
|
|
|
|
|
class ApiErrorEnvelope(BaseModel):
|
|
error: ApiErrorItem
|