PaginationLinks.py 981 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (c) 2021 Ultimaker B.V.
  2. from typing import Optional
  3. class PaginationLinks:
  4. """Model containing pagination links."""
  5. def __init__(self,
  6. first: Optional[str] = None,
  7. last: Optional[str] = None,
  8. next: Optional[str] = None,
  9. prev: Optional[str] = None,
  10. **kwargs) -> None:
  11. """
  12. Creates a new digital factory project response object
  13. :param first: The URL for the first page.
  14. :param last: The URL for the last page.
  15. :param next: The URL for the next page.
  16. :param prev: The URL for the prev page.
  17. :param kwargs:
  18. """
  19. self.first_page = first
  20. self.last_page = last
  21. self.next_page = next
  22. self.prev_page = prev
  23. def __str__(self) -> str:
  24. return "Pagination Links | First: {}, Last: {}, Next: {}, Prev: {}".format(self.first_page, self.last_page, self.next_page, self.prev_page)