[docs]classMarkerPaginator(Paginator[PageT]):""" A paginator which uses `has_next_page` and `marker` from payloads, sets the `marker` query param to page. This is the default method for GCS pagination, so it's very simple. """_REQUIRES_METHOD_KWARGS=("marker",)def__init__(self,method:t.Callable[...,t.Any],*,items_key:str|None=None,marker_key:str="marker",client_args:tuple[t.Any,...],client_kwargs:dict[str,t.Any],):super().__init__(method,items_key=items_key,client_args=client_args,client_kwargs=client_kwargs,)self.marker:str|None=Noneself.marker_key=marker_keydef_check_has_next_page(self,page:dict[str,t.Any])->bool:returnbool(page.get("has_next_page",False))
classNullableMarkerPaginator(MarkerPaginator[PageT]):""" A paginator which uses a ``marker`` from payloads and sets the ``marker`` query param to page. Unlike the base MarkerPaginator, it checks for a null marker to indicate an end to pagination. (vs an explicit has_next_page key) """def_check_has_next_page(self,page:dict[str,t.Any])->bool:returnpage.get(self.marker_key)isnotNone