15 lines
313 B
Python
15 lines
313 B
Python
from typing import Generic, TypeVar
|
|
|
|
from pydantic import BaseModel
|
|
|
|
RecordT = TypeVar("RecordT", bound=BaseModel)
|
|
|
|
|
|
class PaginatedResponse(BaseModel, Generic[RecordT]):
|
|
"""Generic paginated response wrapper."""
|
|
|
|
records: list[RecordT]
|
|
total: int
|
|
page: int
|
|
per_page: int
|
|
total_pages: int
|