@@ -15,8 +15,8 @@ class Paginator:
1515
1616 def __init__ (
1717 self ,
18+ client : SeamHttpClient ,
1819 request : Callable ,
19- http_client : SeamHttpClient ,
2020 params : Dict [str , Any ] = None ,
2121 ):
2222 """
@@ -28,17 +28,17 @@ def __init__(
2828 params: Initial parameters to pass to the callable function.
2929 """
3030 self ._request = request
31- self ._http_client = http_client
31+ self .client = client
3232 self ._params = params or {}
3333 self ._pagination_cache : Dict [str , Pagination ] = {}
3434
3535 def first_page (self ) -> Tuple [List [Any ], Pagination | None ]:
3636 """Fetches the first page of results."""
37- self ._http_client .hooks ["response" ].append (
37+ self .client .hooks ["response" ].append (
3838 lambda response : self ._cache_pagination (response , self ._FIRST_PAGE )
3939 )
4040 data = self ._request (** self ._params )
41- self ._http_client .hooks ["response" ].pop ()
41+ self .client .hooks ["response" ].pop ()
4242
4343 pagination = self ._pagination_cache .get (self ._FIRST_PAGE )
4444
@@ -54,11 +54,11 @@ def next_page(self, next_page_cursor: str) -> Tuple[List[Any], Pagination | None
5454 "page_cursor" : next_page_cursor ,
5555 }
5656
57- self ._http_client .hooks ["response" ].append (
57+ self .client .hooks ["response" ].append (
5858 lambda response : self ._cache_pagination (response , next_page_cursor )
5959 )
6060 data = self ._request (** params )
61- self ._http_client .hooks ["response" ].pop ()
61+ self .client .hooks ["response" ].pop ()
6262
6363 pagination = self ._pagination_cache .get (next_page_cursor )
6464
0 commit comments