Initialize docker stack repo
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""Base class for API response schemas."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pydantic.v1 import BaseModel
|
||||
from pydantic.v1.generics import GenericModel
|
||||
|
||||
|
||||
class APIModel(BaseModel):
|
||||
"""Base API response model."""
|
||||
|
||||
def as_json(self) -> str:
|
||||
"""Generate a JSON representation of the model."""
|
||||
return super().json(exclude_none=True, ensure_ascii=False)
|
||||
|
||||
def as_dict(self) -> dict[str, Any]:
|
||||
"""Generate a dictionary representation of the model."""
|
||||
return super().dict(exclude_none=True)
|
||||
|
||||
|
||||
class GenericAPIModel(GenericModel, APIModel):
|
||||
"""Base generic API response model."""
|
||||
Reference in New Issue
Block a user