11from abc import ABC , abstractmethod
2- from typing import TYPE_CHECKING , Type
2+ from typing import TYPE_CHECKING , Any , Optional , Type
3+
34from .base import ObjectBase
45
56if TYPE_CHECKING :
7+ from mollie .api .client import Client
68 from mollie .api .resources .base import ResourceBase
79
810
@@ -87,11 +89,10 @@ def new(self, result):
8789 ...
8890
8991
90-
9192class PaginationList (ListBase ):
9293 _parent : "ResourceBase"
9394
94- def __init__ (self , result , parent : "ResourceBase" , client = None ):
95+ def __init__ (self , result : Any , parent : "ResourceBase" , client : "Client" ):
9596 # If an empty dataset was injected, we mock the structure that the remainder of the clas expects.
9697 # TODO: it would be better if the ObjectList was initiated with a list of results, rather than with
9798 # the full datastructure as it is now, so we can remove all this mucking around with fake data,
@@ -130,7 +131,7 @@ def new(self, result):
130131class ObjectList (ListBase ):
131132 _object_type : Type [ObjectBase ]
132133
133- def __init__ (self , result , object_type : Type [ObjectBase ], client = None ):
134+ def __init__ (self , result : Any , object_type : Type [ObjectBase ], client : Optional [ "Client" ] = None ):
134135 # If an empty dataset was injected, we mock the structure that the remainder of the clas expects.
135136 # TODO: it would be better if the ObjectList was initiated with a list of results, rather than with
136137 # the full datastructure as it is now, so we can remove all this mucking around with fake data,
@@ -148,10 +149,10 @@ def get_next(self):
148149
149150 def get_previous (self ):
150151 return None
151-
152+
152153 @property
153154 def object_type (self ):
154155 return self ._object_type
155-
156+
156157 def new (self , result ):
157158 return ObjectList (result , self ._object_type , self .client )
0 commit comments