from dataclasses import dataclass


@dataclass(frozen=True)
class PaginationParams:
    q: str | None
    offset: int
    limit: int
    order: str | None

    @property
    def as_dict(self) -> dict[str, str | int | None]:
        return dict(q=self.q, offset=self.offset, limit=self.limit, order=self.order)
