Source code for worldline.acquiring.sdk.v1.domain.pagination_request
# -*- coding: utf-8 -*-
#
# This file was automatically generated.
#
from typing import Optional
from worldline.acquiring.sdk.domain.data_object import DataObject
[docs]
class PaginationRequest(DataObject):
__from_index: Optional[int] = None
__page_size: Optional[int] = None
__search_id: Optional[str] = None
@property
def from_index(self) -> Optional[int]:
"""
| The index of the first item in the current page of search results.
Type: int
"""
return self.__from_index
@from_index.setter
def from_index(self, value: Optional[int]) -> None:
self.__from_index = value
@property
def page_size(self) -> Optional[int]:
"""
| The number of items to be included in a page of search results.
Type: int
"""
return self.__page_size
@page_size.setter
def page_size(self, value: Optional[int]) -> None:
self.__page_size = 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
[docs]
def to_dictionary(self) -> dict:
dictionary = super(PaginationRequest, self).to_dictionary()
if self.from_index is not None:
dictionary['fromIndex'] = self.from_index
if self.page_size is not None:
dictionary['pageSize'] = self.page_size
if self.search_id is not None:
dictionary['searchId'] = self.search_id
return dictionary
[docs]
def from_dictionary(self, dictionary: dict) -> 'PaginationRequest':
super(PaginationRequest, self).from_dictionary(dictionary)
if 'fromIndex' in dictionary:
self.from_index = dictionary['fromIndex']
if 'pageSize' in dictionary:
self.page_size = dictionary['pageSize']
if 'searchId' in dictionary:
self.search_id = dictionary['searchId']
return self