pdstools.infinity.internal._pagination ====================================== .. py:module:: pdstools.infinity.internal._pagination Attributes ---------- .. autoapisummary:: pdstools.infinity.internal._pagination.T Classes ------- .. autoapisummary:: pdstools.infinity.internal._pagination.PaginatedList Module Contents --------------- .. py:data:: T .. py:class:: PaginatedList(content_class, client, request_method, url, extra_attribs=None, _root=None, **kwargs) Bases: :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Abstracts pagination of Pega API Currently supports format where a 'nextToken' is supplied and the next page is retrieved by supplying that token as the 'pageToken' of the next call to the same URL. Can be iterated, indexed or sliced. .. py:attribute:: _elements :value: [] .. py:attribute:: _client .. py:attribute:: _content_class .. py:attribute:: _url .. py:attribute:: _first_params .. py:attribute:: _next_token :value: True .. py:attribute:: _next_params .. py:attribute:: _extra_attribs .. py:attribute:: _request_method .. py:attribute:: _root :value: None .. py:method:: __getitem__(key: Union[str, int]) -> T __getitem__(index: slice) -> _Slice[T] .. py:method:: get(__key: Union[int, str], __default: Union[str, None]) -> T get(__key: slice, __default: Union[str, None]) -> _Slice[T] Returns the specified key or default. If string type provided as key, the content_class needs to be a Pydantic class, with an attribute called 'id'. :param __key: Can be a int (index), slice (start:end), or string (id attribute) :type __key: int | slice | str :param __default: The value to return if none found, by default None :type __default: str | None, optional :returns: The element, or slice of elements. If not found, returns default :rtype: Any .. py:method:: __iter__() -> Iterator[T] .. py:method:: __repr__() .. py:method:: _get_next_page() .. py:method:: _get_up_to_index(index) .. py:method:: _grow() .. py:method:: _has_next() .. py:method:: _is_larger_than(index) .. py:class:: _Slice(the_list: PaginatedList, the_slice: slice) Bases: :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: _list .. py:attribute:: _start .. py:attribute:: _stop .. py:attribute:: _step .. py:method:: __iter__() -> Iterator[T] .. py:method:: __getitem__(index: int) .. py:method:: _finished(index) .. py:method:: as_df()