Source code for worldline.acquiring.sdk.v1.domain.pagination_response

# -*- coding: utf-8 -*-
#
# This file was automatically generated.
#
from typing import Optional

from worldline.acquiring.sdk.domain.data_object import DataObject


[docs] class PaginationResponse(DataObject): __last_index: Optional[int] = None __search_id: Optional[str] = None __total_count: Optional[int] = None @property def last_index(self) -> Optional[int]: """ | The index of the last item in the current page of search results. Type: int """ return self.__last_index @last_index.setter def last_index(self, value: Optional[int]) -> None: self.__last_index = value @property def search_id(self) -> Optional[str]: """ | A unique identifier for a search results. | It's used for pagination of search results and is generated by us. Type: str """ return self.__search_id @search_id.setter def search_id(self, value: Optional[str]) -> None: self.__search_id = value @property def total_count(self) -> Optional[int]: """ | The total number of items matching the search criteria. Type: int """ return self.__total_count @total_count.setter def total_count(self, value: Optional[int]) -> None: self.__total_count = value
[docs] def to_dictionary(self) -> dict: dictionary = super(PaginationResponse, self).to_dictionary() if self.last_index is not None: dictionary['lastIndex'] = self.last_index if self.search_id is not None: dictionary['searchId'] = self.search_id if self.total_count is not None: dictionary['totalCount'] = self.total_count return dictionary
[docs] def from_dictionary(self, dictionary: dict) -> 'PaginationResponse': super(PaginationResponse, self).from_dictionary(dictionary) if 'lastIndex' in dictionary: self.last_index = dictionary['lastIndex'] if 'searchId' in dictionary: self.search_id = dictionary['searchId'] if 'totalCount' in dictionary: self.total_count = dictionary['totalCount'] return self