diff options
author | Kostas Karmas <konskarm@gmail.com> | 2021-04-20 12:30:49 +0300 |
---|---|---|
committer | Kostas Karmas <konskarm@gmail.com> | 2021-04-20 12:30:49 +0300 |
commit | d972c505d012fc83499c395123641c1aa0fb5863 (patch) | |
tree | 5ba2619bb3835d5bff45e4d4a8b2346160e14067 /plugins/DigitalLibrary/src/PaginationMetadata.py | |
parent | e19d5545bc36b21152f41de2ba7e153ac1933e8d (diff) |
Initial commit for the DL
Diffstat (limited to 'plugins/DigitalLibrary/src/PaginationMetadata.py')
-rw-r--r-- | plugins/DigitalLibrary/src/PaginationMetadata.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/DigitalLibrary/src/PaginationMetadata.py b/plugins/DigitalLibrary/src/PaginationMetadata.py new file mode 100644 index 0000000000..7f11e43d30 --- /dev/null +++ b/plugins/DigitalLibrary/src/PaginationMetadata.py @@ -0,0 +1,25 @@ +# Copyright (c) 2021 Ultimaker B.V. + +from typing import Optional + + +class PaginationMetadata: + """Class representing the metadata related to pagination.""" + + def __init__(self, + total_count: Optional[int] = None, + total_pages: Optional[int] = None, + **kwargs) -> None: + """ + Creates a new digital factory project response object + :param total_count: The total count of items. + :param total_pages: The total number of pages when pagination is applied. + :param kwargs: + """ + + self.total_count = total_count + self.total_pages = total_pages + self.__dict__.update(kwargs) + + def __str__(self) -> str: + return "PaginationMetadata | Total Count: {}, Total Pages: {}".format(self.total_count, self.total_pages) |