@@ -21,7 +21,7 @@ def __init__(self, client, path):
2121 self ._path = path
2222
2323 @property
24- def path (self ):
24+ def path (self ) -> str :
2525 return self ._path
2626
2727 def __getattr__ (self , name ):
@@ -35,7 +35,7 @@ def __iter__(self):
3535 def __call__ (self , name ):
3636 return self .ns (name )
3737
38- def collection (self , name ):
38+ def collection (self , name : str ):
3939 """
4040 Returns a `[Async]Collection` object nested under this namespace object
4141 identified by its name.
@@ -55,6 +55,10 @@ def collection(self, name):
5555
5656 Args:
5757 name (str): The name of the collection to access.
58+
59+ Returns:
60+ (Union[Collection, AsyncCollection]): Returns an object nested under this namespace
61+ object identified by its name.
5862 """
5963
6064 if not isinstance (name , str ):
@@ -68,7 +72,7 @@ def collection(self, name):
6872 f'{ self ._path } /{ name } ' ,
6973 )
7074
71- def ns (self , name ):
75+ def ns (self , name : str ):
7276 """
7377 Returns a `[Async]Namespace` object nested under this namespace
7478 identified by its name.
@@ -88,6 +92,10 @@ def ns(self, name):
8892
8993 Args:
9094 name (str): The name of the namespace to access.
95+
96+ Returns:
97+ (Union[NS, AsyncNS]): Returns an object nested under this namespace
98+ identified by its name.
9199 """
92100 if not isinstance (name , str ):
93101 raise TypeError ('`name` must be a string.' )
@@ -149,6 +157,10 @@ def all(self):
149157 """
150158 Returns a `[Async]ResourceSet` object that that allow to access all the resources that
151159 belong to this collection.
160+
161+ Returns:
162+ (Union[ResourceSet, AsyncResourceSet]): Returns an object that that allow to access
163+ all the resources that belong to this collection.
152164 """
153165 return self ._get_resourceset_class ()(
154166 self ._client ,
@@ -188,6 +200,10 @@ def filter(self, *args, **kwargs):
188200 ```
189201
190202 Also keyword arguments will be combined with logical **and**.
203+
204+ Returns:
205+ (Union[ResourceSet, AsyncResourceSet]): The returned ResourceSet object will be
206+ filtered based on the arguments and keyword arguments.
191207 """
192208 query = R ()
193209 for arg in args :
@@ -208,7 +224,7 @@ def filter(self, *args, **kwargs):
208224 query = query ,
209225 )
210226
211- def resource (self , resource_id ):
227+ def resource (self , resource_id : str ):
212228 """
213229 Returns a `[Async]Resource` object that represent a resource that belong to
214230 this collection identified by its unique identifier.
@@ -227,6 +243,10 @@ def resource(self, resource_id):
227243
228244 Args:
229245 resource_id (str): The unique identifier of the resource.
246+
247+ Returns:
248+ (Union[Resource, AsyncResource]): Returns an object that represent a resource that
249+ belong to this collection identified by its unique identifier.
230250 """
231251 if not isinstance (resource_id , (str , int )):
232252 raise TypeError ('`resource_id` must be a string or int.' )
@@ -239,13 +259,17 @@ def resource(self, resource_id):
239259 f'{ self ._path } /{ resource_id } ' ,
240260 )
241261
242- def action (self , name ):
262+ def action (self , name : str ):
243263 """
244264 Returns an `[Async]Action` object that represent an action to perform
245265 on this collection identified by its name.
246266
247267 Args:
248268 name (str): The name of the action to perform.
269+
270+ Returns:
271+ (Union[Action, AsyncAction]): Returns an object that represent an action to perform
272+ on this collection identified by its name.
249273 """
250274 if not isinstance (name , str ):
251275 raise TypeError ('`name` must be a string.' )
@@ -311,7 +335,7 @@ def __getattr__(self, name):
311335 def __call__ (self , name ):
312336 return self .action (name )
313337
314- def collection (self , name ):
338+ def collection (self , name : str ):
315339 """
316340 Returns a `[Async]Collection` object nested under this resource object
317341 identified by its name.
@@ -335,6 +359,10 @@ def collection(self, name):
335359
336360 Args:
337361 name (str): The name of the collection to access.
362+
363+ Returns:
364+ (Union[Collection, AsyncCollection]): Returns an object nested under this resource
365+ object identified by its name.
338366 """ # noqa: E501
339367 if not isinstance (name , str ):
340368 raise TypeError ('`name` must be a string.' )
@@ -347,7 +375,7 @@ def collection(self, name):
347375 f'{ self ._path } /{ name } ' ,
348376 )
349377
350- def action (self , name ):
378+ def action (self , name : str ):
351379 """
352380 Returns an `[Async]Action` object that can be performed on this this resource object
353381 identified by its name.
@@ -370,6 +398,10 @@ def action(self, name):
370398
371399 Args:
372400 name (str): The name of the action to perform.
401+
402+ Returns:
403+ (Union[Action, AsyncAction]): Returns an object that can be performed on this this
404+ resource object identified by its name.
373405 """
374406 if not isinstance (name , str ):
375407 raise TypeError ('`name` must be a string.' )
0 commit comments