11from typing import Dict , Optional , Union
22
33from ._http_client import _HTTPClient , _HTTPClientAsync
4- from ._utils import _make_async_docs
54from .clients import (
65 ActorClient ,
76 ActorClientAsync ,
@@ -272,7 +271,6 @@ class ApifyClientAsync(_BaseApifyClient):
272271
273272 http_client : _HTTPClientAsync
274273
275- @_make_async_docs (src = ApifyClient .__init__ )
276274 def __init__ (
277275 self ,
278276 token : Optional [str ] = None ,
@@ -282,6 +280,16 @@ def __init__(
282280 min_delay_between_retries_millis : Optional [int ] = 500 ,
283281 timeout_secs : Optional [int ] = 360 ,
284282 ):
283+ """Initialize the ApifyClientAsync.
284+
285+ Args:
286+ token (str, optional): The Apify API token
287+ api_url (str, optional): The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com
288+ max_retries (int, optional): How many times to retry a failed request at most
289+ min_delay_between_retries_millis (int, optional): How long will the client wait between retrying requests
290+ (increases exponentially from this value)
291+ timeout_secs (int, optional): The socket timeout of the HTTP requests sent to the Apify API
292+ """
285293 super ().__init__ (
286294 token ,
287295 api_url = api_url ,
@@ -297,90 +305,139 @@ def __init__(
297305 timeout_secs = self .timeout_secs ,
298306 )
299307
300- @_make_async_docs (src = ApifyClient .actor )
301308 def actor (self , actor_id : str ) -> ActorClientAsync :
309+ """Retrieve the sub-client for manipulating a single actor.
310+
311+ Args:
312+ actor_id (str): ID of the actor to be manipulated
313+ """
302314 return ActorClientAsync (resource_id = actor_id , ** self ._options ())
303315
304- @_make_async_docs (src = ApifyClient .actors )
305316 def actors (self ) -> ActorCollectionClientAsync :
317+ """Retrieve the sub-client for manipulating actors."""
306318 return ActorCollectionClientAsync (** self ._options ())
307319
308- @_make_async_docs (src = ApifyClient .build )
309320 def build (self , build_id : str ) -> BuildClientAsync :
321+ """Retrieve the sub-client for manipulating a single actor build.
322+
323+ Args:
324+ build_id (str): ID of the actor build to be manipulated
325+ """
310326 return BuildClientAsync (resource_id = build_id , ** self ._options ())
311327
312- @_make_async_docs (src = ApifyClient .builds )
313328 def builds (self ) -> BuildCollectionClientAsync :
329+ """Retrieve the sub-client for querying multiple builds of a user."""
314330 return BuildCollectionClientAsync (** self ._options ())
315331
316- @_make_async_docs (src = ApifyClient .run )
317332 def run (self , run_id : str ) -> RunClientAsync :
333+ """Retrieve the sub-client for manipulating a single actor run.
334+
335+ Args:
336+ run_id (str): ID of the actor run to be manipulated
337+ """
318338 return RunClientAsync (resource_id = run_id , ** self ._options ())
319339
320- @_make_async_docs (src = ApifyClient .runs )
321340 def runs (self ) -> RunCollectionClientAsync :
341+ """Retrieve the sub-client for querying multiple actor runs of a user."""
322342 return RunCollectionClientAsync (** self ._options ())
323343
324- @_make_async_docs (src = ApifyClient .dataset )
325344 def dataset (self , dataset_id : str ) -> DatasetClientAsync :
345+ """Retrieve the sub-client for manipulating a single dataset.
346+
347+ Args:
348+ dataset_id (str): ID of the dataset to be manipulated
349+ """
326350 return DatasetClientAsync (resource_id = dataset_id , ** self ._options ())
327351
328- @_make_async_docs (src = ApifyClient .datasets )
329352 def datasets (self ) -> DatasetCollectionClientAsync :
353+ """Retrieve the sub-client for manipulating datasets."""
330354 return DatasetCollectionClientAsync (** self ._options ())
331355
332- @_make_async_docs (src = ApifyClient .key_value_store )
333356 def key_value_store (self , key_value_store_id : str ) -> KeyValueStoreClientAsync :
357+ """Retrieve the sub-client for manipulating a single key-value store.
358+
359+ Args:
360+ key_value_store_id (str): ID of the key-value store to be manipulated
361+ """
334362 return KeyValueStoreClientAsync (resource_id = key_value_store_id , ** self ._options ())
335363
336- @_make_async_docs (src = ApifyClient .key_value_stores )
337364 def key_value_stores (self ) -> KeyValueStoreCollectionClientAsync :
365+ """Retrieve the sub-client for manipulating key-value stores."""
338366 return KeyValueStoreCollectionClientAsync (** self ._options ())
339367
340- @_make_async_docs (src = ApifyClient .request_queue )
341368 def request_queue (self , request_queue_id : str , * , client_key : Optional [str ] = None ) -> RequestQueueClientAsync :
369+ """Retrieve the sub-client for manipulating a single request queue.
370+
371+ Args:
372+ request_queue_id (str): ID of the request queue to be manipulated
373+ client_key (str): A unique identifier of the client accessing the request queue
374+ """
342375 return RequestQueueClientAsync (resource_id = request_queue_id , client_key = client_key , ** self ._options ())
343376
344- @_make_async_docs (src = ApifyClient .request_queues )
345377 def request_queues (self ) -> RequestQueueCollectionClientAsync :
378+ """Retrieve the sub-client for manipulating request queues."""
346379 return RequestQueueCollectionClientAsync (** self ._options ())
347380
348- @_make_async_docs (src = ApifyClient .webhook )
349381 def webhook (self , webhook_id : str ) -> WebhookClientAsync :
382+ """Retrieve the sub-client for manipulating a single webhook.
383+
384+ Args:
385+ webhook_id (str): ID of the webhook to be manipulated
386+ """
350387 return WebhookClientAsync (resource_id = webhook_id , ** self ._options ())
351388
352- @_make_async_docs (src = ApifyClient .webhooks )
353389 def webhooks (self ) -> WebhookCollectionClientAsync :
390+ """Retrieve the sub-client for querying multiple webhooks of a user."""
354391 return WebhookCollectionClientAsync (** self ._options ())
355392
356- @_make_async_docs (src = ApifyClient .webhook_dispatch )
357393 def webhook_dispatch (self , webhook_dispatch_id : str ) -> WebhookDispatchClientAsync :
394+ """Retrieve the sub-client for accessing a single webhook dispatch.
395+
396+ Args:
397+ webhook_dispatch_id (str): ID of the webhook dispatch to access
398+ """
358399 return WebhookDispatchClientAsync (resource_id = webhook_dispatch_id , ** self ._options ())
359400
360- @_make_async_docs (src = ApifyClient .webhook_dispatches )
361401 def webhook_dispatches (self ) -> WebhookDispatchCollectionClientAsync :
402+ """Retrieve the sub-client for querying multiple webhook dispatches of a user."""
362403 return WebhookDispatchCollectionClientAsync (** self ._options ())
363404
364- @_make_async_docs (src = ApifyClient .schedule )
365405 def schedule (self , schedule_id : str ) -> ScheduleClientAsync :
406+ """Retrieve the sub-client for manipulating a single schedule.
407+
408+ Args:
409+ schedule_id (str): ID of the schedule to be manipulated
410+ """
366411 return ScheduleClientAsync (resource_id = schedule_id , ** self ._options ())
367412
368- @_make_async_docs (src = ApifyClient .schedules )
369413 def schedules (self ) -> ScheduleCollectionClientAsync :
414+ """Retrieve the sub-client for manipulating schedules."""
370415 return ScheduleCollectionClientAsync (** self ._options ())
371416
372- @_make_async_docs (src = ApifyClient .log )
373417 def log (self , build_or_run_id : str ) -> LogClientAsync :
418+ """Retrieve the sub-client for retrieving logs.
419+
420+ Args:
421+ build_or_run_id (str): ID of the actor build or run for which to access the log
422+ """
374423 return LogClientAsync (resource_id = build_or_run_id , ** self ._options ())
375424
376- @_make_async_docs (src = ApifyClient .task )
377425 def task (self , task_id : str ) -> TaskClientAsync :
426+ """Retrieve the sub-client for manipulating a single task.
427+
428+ Args:
429+ task_id (str): ID of the task to be manipulated
430+ """
378431 return TaskClientAsync (resource_id = task_id , ** self ._options ())
379432
380- @_make_async_docs (src = ApifyClient .tasks )
381433 def tasks (self ) -> TaskCollectionClientAsync :
434+ """Retrieve the sub-client for manipulating tasks."""
382435 return TaskCollectionClientAsync (** self ._options ())
383436
384- @_make_async_docs (src = ApifyClient .user )
385437 def user (self , user_id : Optional [str ] = None ) -> UserClientAsync :
438+ """Retrieve the sub-client for querying users.
439+
440+ Args:
441+ user_id (str, optional): ID of user to be queried. If None, queries the user belonging to the token supplied to the client
442+ """
386443 return UserClientAsync (resource_id = user_id , ** self ._options ())
0 commit comments