diff --git a/src/apify_client/_errors.py b/src/apify_client/_errors.py index d5b2f528..e6d1fce5 100644 --- a/src/apify_client/_errors.py +++ b/src/apify_client/_errors.py @@ -18,7 +18,7 @@ class ApifyApiError(ApifyClientError): """ @ignore_docs - def __init__(self: ApifyApiError, response: httpx.Response, attempt: int) -> None: + def __init__(self, response: httpx.Response, attempt: int) -> None: """Create the ApifyApiError instance. Args: @@ -59,7 +59,7 @@ class InvalidResponseBodyError(ApifyClientError): """ @ignore_docs - def __init__(self: InvalidResponseBodyError, response: httpx.Response) -> None: + def __init__(self, response: httpx.Response) -> None: """Create the InvalidResponseBodyError instance. Args: diff --git a/src/apify_client/_http_client.py b/src/apify_client/_http_client.py index 10df566f..78896580 100644 --- a/src/apify_client/_http_client.py +++ b/src/apify_client/_http_client.py @@ -29,7 +29,7 @@ class _BaseHTTPClient: @ignore_docs def __init__( - self: _BaseHTTPClient, + self, *, token: str | None = None, max_retries: int = 8, @@ -97,7 +97,7 @@ def _parse_params(params: dict | None) -> dict | None: return parsed_params def _prepare_request_call( - self: _BaseHTTPClient, + self, headers: dict | None = None, params: dict | None = None, data: Any = None, @@ -129,7 +129,7 @@ def _prepare_request_call( class HTTPClient(_BaseHTTPClient): def call( - self: HTTPClient, + self, *, method: str, url: str, @@ -201,7 +201,7 @@ def _make_request(stop_retrying: Callable, attempt: int) -> httpx.Response: class HTTPClientAsync(_BaseHTTPClient): async def call( - self: HTTPClientAsync, + self, *, method: str, url: str, diff --git a/src/apify_client/_logging.py b/src/apify_client/_logging.py index 3fbefb2f..86a8528f 100644 --- a/src/apify_client/_logging.py +++ b/src/apify_client/_logging.py @@ -5,7 +5,7 @@ import json import logging from contextvars import ContextVar -from typing import TYPE_CHECKING, Any, Callable, NamedTuple, cast +from typing import TYPE_CHECKING, Any, Callable, NamedTuple # Conditional import only executed when type checking, otherwise we'd get circular dependency issues if TYPE_CHECKING: @@ -39,12 +39,12 @@ class LogContext(NamedTuple): # Metaclass for resource clients which wraps all their public methods # With injection of their details to the log context vars class WithLogDetailsClient(type): - def __new__(cls: type[type], name: str, bases: tuple, attrs: dict) -> WithLogDetailsClient: + def __new__(cls, name: str, bases: tuple, attrs: dict) -> WithLogDetailsClient: for attr_name, attr_value in attrs.items(): if not attr_name.startswith('_') and inspect.isfunction(attr_value): attrs[attr_name] = _injects_client_details_to_log_context(attr_value) - return cast(WithLogDetailsClient, type.__new__(cls, name, bases, attrs)) + return type.__new__(cls, name, bases, attrs) # Wraps an unbound method so that its call will inject the details @@ -87,7 +87,7 @@ def wrapper(resource_client: _BaseBaseClient, *args: Any, **kwargs: Any) -> Any: # A filter which lets every log record through, # but adds the current logging context to the record class _ContextInjectingFilter(logging.Filter): - def filter(self: _ContextInjectingFilter, record: logging.LogRecord) -> bool: + def filter(self, record: logging.LogRecord) -> bool: record.client_method = log_context.client_method.get() record.resource_id = log_context.resource_id.get() record.method = log_context.method.get() @@ -105,7 +105,7 @@ class _DebugLogFormatter(logging.Formatter): empty_record = logging.LogRecord('dummy', 0, 'dummy', 0, 'dummy', None, None) # Gets the extra fields from the log record which are not present on an empty record - def _get_extra_fields(self: _DebugLogFormatter, record: logging.LogRecord) -> dict: + def _get_extra_fields(self, record: logging.LogRecord) -> dict: extra_fields: dict = {} for key, value in record.__dict__.items(): if key not in self.empty_record.__dict__: @@ -113,7 +113,7 @@ def _get_extra_fields(self: _DebugLogFormatter, record: logging.LogRecord) -> di return extra_fields - def format(self: _DebugLogFormatter, record: logging.LogRecord) -> str: + def format(self, record: logging.LogRecord) -> str: extra = self._get_extra_fields(record) log_string = super().format(record) diff --git a/src/apify_client/client.py b/src/apify_client/client.py index 9d25ee73..a734dadf 100644 --- a/src/apify_client/client.py +++ b/src/apify_client/client.py @@ -61,7 +61,7 @@ class _BaseApifyClient: @ignore_docs def __init__( - self: _BaseApifyClient, + self, token: str | None = None, *, api_url: str | None = None, @@ -86,7 +86,7 @@ def __init__( self.min_delay_between_retries_millis = min_delay_between_retries_millis or 500 self.timeout_secs = timeout_secs or 360 - def _options(self: _BaseApifyClient) -> dict: + def _options(self) -> dict: return { 'root_client': self, 'base_url': self.base_url, @@ -100,7 +100,7 @@ class ApifyClient(_BaseApifyClient): http_client: HTTPClient def __init__( - self: ApifyClient, + self, token: str | None = None, *, api_url: str | None = None, @@ -133,7 +133,7 @@ def __init__( timeout_secs=self.timeout_secs, ) - def actor(self: ApifyClient, actor_id: str) -> ActorClient: + def actor(self, actor_id: str) -> ActorClient: """Retrieve the sub-client for manipulating a single Actor. Args: @@ -141,11 +141,11 @@ def actor(self: ApifyClient, actor_id: str) -> ActorClient: """ return ActorClient(resource_id=actor_id, **self._options()) - def actors(self: ApifyClient) -> ActorCollectionClient: + def actors(self) -> ActorCollectionClient: """Retrieve the sub-client for manipulating Actors.""" return ActorCollectionClient(**self._options()) - def build(self: ApifyClient, build_id: str) -> BuildClient: + def build(self, build_id: str) -> BuildClient: """Retrieve the sub-client for manipulating a single Actor build. Args: @@ -153,11 +153,11 @@ def build(self: ApifyClient, build_id: str) -> BuildClient: """ return BuildClient(resource_id=build_id, **self._options()) - def builds(self: ApifyClient) -> BuildCollectionClient: + def builds(self) -> BuildCollectionClient: """Retrieve the sub-client for querying multiple builds of a user.""" return BuildCollectionClient(**self._options()) - def run(self: ApifyClient, run_id: str) -> RunClient: + def run(self, run_id: str) -> RunClient: """Retrieve the sub-client for manipulating a single Actor run. Args: @@ -165,11 +165,11 @@ def run(self: ApifyClient, run_id: str) -> RunClient: """ return RunClient(resource_id=run_id, **self._options()) - def runs(self: ApifyClient) -> RunCollectionClient: + def runs(self) -> RunCollectionClient: """Retrieve the sub-client for querying multiple Actor runs of a user.""" return RunCollectionClient(**self._options()) - def dataset(self: ApifyClient, dataset_id: str) -> DatasetClient: + def dataset(self, dataset_id: str) -> DatasetClient: """Retrieve the sub-client for manipulating a single dataset. Args: @@ -177,11 +177,11 @@ def dataset(self: ApifyClient, dataset_id: str) -> DatasetClient: """ return DatasetClient(resource_id=dataset_id, **self._options()) - def datasets(self: ApifyClient) -> DatasetCollectionClient: + def datasets(self) -> DatasetCollectionClient: """Retrieve the sub-client for manipulating datasets.""" return DatasetCollectionClient(**self._options()) - def key_value_store(self: ApifyClient, key_value_store_id: str) -> KeyValueStoreClient: + def key_value_store(self, key_value_store_id: str) -> KeyValueStoreClient: """Retrieve the sub-client for manipulating a single key-value store. Args: @@ -189,11 +189,11 @@ def key_value_store(self: ApifyClient, key_value_store_id: str) -> KeyValueStore """ return KeyValueStoreClient(resource_id=key_value_store_id, **self._options()) - def key_value_stores(self: ApifyClient) -> KeyValueStoreCollectionClient: + def key_value_stores(self) -> KeyValueStoreCollectionClient: """Retrieve the sub-client for manipulating key-value stores.""" return KeyValueStoreCollectionClient(**self._options()) - def request_queue(self: ApifyClient, request_queue_id: str, *, client_key: str | None = None) -> RequestQueueClient: + def request_queue(self, request_queue_id: str, *, client_key: str | None = None) -> RequestQueueClient: """Retrieve the sub-client for manipulating a single request queue. Args: @@ -202,11 +202,11 @@ def request_queue(self: ApifyClient, request_queue_id: str, *, client_key: str | """ return RequestQueueClient(resource_id=request_queue_id, client_key=client_key, **self._options()) - def request_queues(self: ApifyClient) -> RequestQueueCollectionClient: + def request_queues(self) -> RequestQueueCollectionClient: """Retrieve the sub-client for manipulating request queues.""" return RequestQueueCollectionClient(**self._options()) - def webhook(self: ApifyClient, webhook_id: str) -> WebhookClient: + def webhook(self, webhook_id: str) -> WebhookClient: """Retrieve the sub-client for manipulating a single webhook. Args: @@ -214,11 +214,11 @@ def webhook(self: ApifyClient, webhook_id: str) -> WebhookClient: """ return WebhookClient(resource_id=webhook_id, **self._options()) - def webhooks(self: ApifyClient) -> WebhookCollectionClient: + def webhooks(self) -> WebhookCollectionClient: """Retrieve the sub-client for querying multiple webhooks of a user.""" return WebhookCollectionClient(**self._options()) - def webhook_dispatch(self: ApifyClient, webhook_dispatch_id: str) -> WebhookDispatchClient: + def webhook_dispatch(self, webhook_dispatch_id: str) -> WebhookDispatchClient: """Retrieve the sub-client for accessing a single webhook dispatch. Args: @@ -226,11 +226,11 @@ def webhook_dispatch(self: ApifyClient, webhook_dispatch_id: str) -> WebhookDisp """ return WebhookDispatchClient(resource_id=webhook_dispatch_id, **self._options()) - def webhook_dispatches(self: ApifyClient) -> WebhookDispatchCollectionClient: + def webhook_dispatches(self) -> WebhookDispatchCollectionClient: """Retrieve the sub-client for querying multiple webhook dispatches of a user.""" return WebhookDispatchCollectionClient(**self._options()) - def schedule(self: ApifyClient, schedule_id: str) -> ScheduleClient: + def schedule(self, schedule_id: str) -> ScheduleClient: """Retrieve the sub-client for manipulating a single schedule. Args: @@ -238,11 +238,11 @@ def schedule(self: ApifyClient, schedule_id: str) -> ScheduleClient: """ return ScheduleClient(resource_id=schedule_id, **self._options()) - def schedules(self: ApifyClient) -> ScheduleCollectionClient: + def schedules(self) -> ScheduleCollectionClient: """Retrieve the sub-client for manipulating schedules.""" return ScheduleCollectionClient(**self._options()) - def log(self: ApifyClient, build_or_run_id: str) -> LogClient: + def log(self, build_or_run_id: str) -> LogClient: """Retrieve the sub-client for retrieving logs. Args: @@ -250,7 +250,7 @@ def log(self: ApifyClient, build_or_run_id: str) -> LogClient: """ return LogClient(resource_id=build_or_run_id, **self._options()) - def task(self: ApifyClient, task_id: str) -> TaskClient: + def task(self, task_id: str) -> TaskClient: """Retrieve the sub-client for manipulating a single task. Args: @@ -258,11 +258,11 @@ def task(self: ApifyClient, task_id: str) -> TaskClient: """ return TaskClient(resource_id=task_id, **self._options()) - def tasks(self: ApifyClient) -> TaskCollectionClient: + def tasks(self) -> TaskCollectionClient: """Retrieve the sub-client for manipulating tasks.""" return TaskCollectionClient(**self._options()) - def user(self: ApifyClient, user_id: str | None = None) -> UserClient: + def user(self, user_id: str | None = None) -> UserClient: """Retrieve the sub-client for querying users. Args: @@ -270,7 +270,7 @@ def user(self: ApifyClient, user_id: str | None = None) -> UserClient: """ return UserClient(resource_id=user_id, **self._options()) - def store(self: ApifyClient) -> StoreCollectionClient: + def store(self) -> StoreCollectionClient: """Retrieve the sub-client for Apify store.""" return StoreCollectionClient(**self._options()) @@ -281,7 +281,7 @@ class ApifyClientAsync(_BaseApifyClient): http_client: HTTPClientAsync def __init__( - self: ApifyClientAsync, + self, token: str | None = None, *, api_url: str | None = None, @@ -314,7 +314,7 @@ def __init__( timeout_secs=self.timeout_secs, ) - def actor(self: ApifyClientAsync, actor_id: str) -> ActorClientAsync: + def actor(self, actor_id: str) -> ActorClientAsync: """Retrieve the sub-client for manipulating a single Actor. Args: @@ -322,11 +322,11 @@ def actor(self: ApifyClientAsync, actor_id: str) -> ActorClientAsync: """ return ActorClientAsync(resource_id=actor_id, **self._options()) - def actors(self: ApifyClientAsync) -> ActorCollectionClientAsync: + def actors(self) -> ActorCollectionClientAsync: """Retrieve the sub-client for manipulating Actors.""" return ActorCollectionClientAsync(**self._options()) - def build(self: ApifyClientAsync, build_id: str) -> BuildClientAsync: + def build(self, build_id: str) -> BuildClientAsync: """Retrieve the sub-client for manipulating a single Actor build. Args: @@ -334,11 +334,11 @@ def build(self: ApifyClientAsync, build_id: str) -> BuildClientAsync: """ return BuildClientAsync(resource_id=build_id, **self._options()) - def builds(self: ApifyClientAsync) -> BuildCollectionClientAsync: + def builds(self) -> BuildCollectionClientAsync: """Retrieve the sub-client for querying multiple builds of a user.""" return BuildCollectionClientAsync(**self._options()) - def run(self: ApifyClientAsync, run_id: str) -> RunClientAsync: + def run(self, run_id: str) -> RunClientAsync: """Retrieve the sub-client for manipulating a single Actor run. Args: @@ -346,11 +346,11 @@ def run(self: ApifyClientAsync, run_id: str) -> RunClientAsync: """ return RunClientAsync(resource_id=run_id, **self._options()) - def runs(self: ApifyClientAsync) -> RunCollectionClientAsync: + def runs(self) -> RunCollectionClientAsync: """Retrieve the sub-client for querying multiple Actor runs of a user.""" return RunCollectionClientAsync(**self._options()) - def dataset(self: ApifyClientAsync, dataset_id: str) -> DatasetClientAsync: + def dataset(self, dataset_id: str) -> DatasetClientAsync: """Retrieve the sub-client for manipulating a single dataset. Args: @@ -358,11 +358,11 @@ def dataset(self: ApifyClientAsync, dataset_id: str) -> DatasetClientAsync: """ return DatasetClientAsync(resource_id=dataset_id, **self._options()) - def datasets(self: ApifyClientAsync) -> DatasetCollectionClientAsync: + def datasets(self) -> DatasetCollectionClientAsync: """Retrieve the sub-client for manipulating datasets.""" return DatasetCollectionClientAsync(**self._options()) - def key_value_store(self: ApifyClientAsync, key_value_store_id: str) -> KeyValueStoreClientAsync: + def key_value_store(self, key_value_store_id: str) -> KeyValueStoreClientAsync: """Retrieve the sub-client for manipulating a single key-value store. Args: @@ -370,11 +370,11 @@ def key_value_store(self: ApifyClientAsync, key_value_store_id: str) -> KeyValue """ return KeyValueStoreClientAsync(resource_id=key_value_store_id, **self._options()) - def key_value_stores(self: ApifyClientAsync) -> KeyValueStoreCollectionClientAsync: + def key_value_stores(self) -> KeyValueStoreCollectionClientAsync: """Retrieve the sub-client for manipulating key-value stores.""" return KeyValueStoreCollectionClientAsync(**self._options()) - def request_queue(self: ApifyClientAsync, request_queue_id: str, *, client_key: str | None = None) -> RequestQueueClientAsync: + def request_queue(self, request_queue_id: str, *, client_key: str | None = None) -> RequestQueueClientAsync: """Retrieve the sub-client for manipulating a single request queue. Args: @@ -383,11 +383,11 @@ def request_queue(self: ApifyClientAsync, request_queue_id: str, *, client_key: """ return RequestQueueClientAsync(resource_id=request_queue_id, client_key=client_key, **self._options()) - def request_queues(self: ApifyClientAsync) -> RequestQueueCollectionClientAsync: + def request_queues(self) -> RequestQueueCollectionClientAsync: """Retrieve the sub-client for manipulating request queues.""" return RequestQueueCollectionClientAsync(**self._options()) - def webhook(self: ApifyClientAsync, webhook_id: str) -> WebhookClientAsync: + def webhook(self, webhook_id: str) -> WebhookClientAsync: """Retrieve the sub-client for manipulating a single webhook. Args: @@ -395,11 +395,11 @@ def webhook(self: ApifyClientAsync, webhook_id: str) -> WebhookClientAsync: """ return WebhookClientAsync(resource_id=webhook_id, **self._options()) - def webhooks(self: ApifyClientAsync) -> WebhookCollectionClientAsync: + def webhooks(self) -> WebhookCollectionClientAsync: """Retrieve the sub-client for querying multiple webhooks of a user.""" return WebhookCollectionClientAsync(**self._options()) - def webhook_dispatch(self: ApifyClientAsync, webhook_dispatch_id: str) -> WebhookDispatchClientAsync: + def webhook_dispatch(self, webhook_dispatch_id: str) -> WebhookDispatchClientAsync: """Retrieve the sub-client for accessing a single webhook dispatch. Args: @@ -407,11 +407,11 @@ def webhook_dispatch(self: ApifyClientAsync, webhook_dispatch_id: str) -> Webhoo """ return WebhookDispatchClientAsync(resource_id=webhook_dispatch_id, **self._options()) - def webhook_dispatches(self: ApifyClientAsync) -> WebhookDispatchCollectionClientAsync: + def webhook_dispatches(self) -> WebhookDispatchCollectionClientAsync: """Retrieve the sub-client for querying multiple webhook dispatches of a user.""" return WebhookDispatchCollectionClientAsync(**self._options()) - def schedule(self: ApifyClientAsync, schedule_id: str) -> ScheduleClientAsync: + def schedule(self, schedule_id: str) -> ScheduleClientAsync: """Retrieve the sub-client for manipulating a single schedule. Args: @@ -419,11 +419,11 @@ def schedule(self: ApifyClientAsync, schedule_id: str) -> ScheduleClientAsync: """ return ScheduleClientAsync(resource_id=schedule_id, **self._options()) - def schedules(self: ApifyClientAsync) -> ScheduleCollectionClientAsync: + def schedules(self) -> ScheduleCollectionClientAsync: """Retrieve the sub-client for manipulating schedules.""" return ScheduleCollectionClientAsync(**self._options()) - def log(self: ApifyClientAsync, build_or_run_id: str) -> LogClientAsync: + def log(self, build_or_run_id: str) -> LogClientAsync: """Retrieve the sub-client for retrieving logs. Args: @@ -431,7 +431,7 @@ def log(self: ApifyClientAsync, build_or_run_id: str) -> LogClientAsync: """ return LogClientAsync(resource_id=build_or_run_id, **self._options()) - def task(self: ApifyClientAsync, task_id: str) -> TaskClientAsync: + def task(self, task_id: str) -> TaskClientAsync: """Retrieve the sub-client for manipulating a single task. Args: @@ -439,11 +439,11 @@ def task(self: ApifyClientAsync, task_id: str) -> TaskClientAsync: """ return TaskClientAsync(resource_id=task_id, **self._options()) - def tasks(self: ApifyClientAsync) -> TaskCollectionClientAsync: + def tasks(self) -> TaskCollectionClientAsync: """Retrieve the sub-client for manipulating tasks.""" return TaskCollectionClientAsync(**self._options()) - def user(self: ApifyClientAsync, user_id: str | None = None) -> UserClientAsync: + def user(self, user_id: str | None = None) -> UserClientAsync: """Retrieve the sub-client for querying users. Args: @@ -451,6 +451,6 @@ def user(self: ApifyClientAsync, user_id: str | None = None) -> UserClientAsync: """ return UserClientAsync(resource_id=user_id, **self._options()) - def store(self: ApifyClientAsync) -> StoreCollectionClientAsync: + def store(self) -> StoreCollectionClientAsync: """Retrieve the sub-client for Apify store.""" return StoreCollectionClientAsync(**self._options()) diff --git a/src/apify_client/clients/base/actor_job_base_client.py b/src/apify_client/clients/base/actor_job_base_client.py index 55fd1f12..68718529 100644 --- a/src/apify_client/clients/base/actor_job_base_client.py +++ b/src/apify_client/clients/base/actor_job_base_client.py @@ -22,7 +22,7 @@ class ActorJobBaseClient(ResourceClient): """Base sub-client class for Actor runs and Actor builds.""" - def _wait_for_finish(self: ActorJobBaseClient, wait_secs: int | None = None) -> dict | None: + def _wait_for_finish(self, wait_secs: int | None = None) -> dict | None: started_at = datetime.now(timezone.utc) should_repeat = True job: dict | None = None @@ -62,7 +62,7 @@ def _wait_for_finish(self: ActorJobBaseClient, wait_secs: int | None = None) -> return job - def _abort(self: ActorJobBaseClient, gracefully: bool | None = None) -> dict: + def _abort(self, gracefully: bool | None = None) -> dict: response = self.http_client.call( url=self._url('abort'), method='POST', @@ -75,7 +75,7 @@ def _abort(self: ActorJobBaseClient, gracefully: bool | None = None) -> dict: class ActorJobBaseClientAsync(ResourceClientAsync): """Base async sub-client class for Actor runs and Actor builds.""" - async def _wait_for_finish(self: ActorJobBaseClientAsync, wait_secs: int | None = None) -> dict | None: + async def _wait_for_finish(self, wait_secs: int | None = None) -> dict | None: started_at = datetime.now(timezone.utc) should_repeat = True job: dict | None = None @@ -115,7 +115,7 @@ async def _wait_for_finish(self: ActorJobBaseClientAsync, wait_secs: int | None return job - async def _abort(self: ActorJobBaseClientAsync, gracefully: bool | None = None) -> dict: + async def _abort(self, gracefully: bool | None = None) -> dict: response = await self.http_client.call( url=self._url('abort'), method='POST', diff --git a/src/apify_client/clients/base/base_client.py b/src/apify_client/clients/base/base_client.py index 83e432e0..04957b30 100644 --- a/src/apify_client/clients/base/base_client.py +++ b/src/apify_client/clients/base/base_client.py @@ -20,18 +20,18 @@ class _BaseBaseClient(metaclass=WithLogDetailsClient): http_client: HTTPClient | HTTPClientAsync root_client: ApifyClient | ApifyClientAsync - def _url(self: _BaseBaseClient, path: str | None = None) -> str: + def _url(self, path: str | None = None) -> str: if path is not None: return f'{self.url}/{path}' return self.url - def _params(self: _BaseBaseClient, **kwargs: Any) -> dict: + def _params(self, **kwargs: Any) -> dict: return { **self.params, **kwargs, } - def _sub_resource_init_options(self: _BaseBaseClient, **kwargs: Any) -> dict: + def _sub_resource_init_options(self, **kwargs: Any) -> dict: options = { 'base_url': self.url, 'http_client': self.http_client, @@ -54,7 +54,7 @@ class BaseClient(_BaseBaseClient): @ignore_docs def __init__( - self: BaseClient, + self, *, base_url: str, root_client: ApifyClient, @@ -97,7 +97,7 @@ class BaseClientAsync(_BaseBaseClient): @ignore_docs def __init__( - self: BaseClientAsync, + self, *, base_url: str, root_client: ApifyClientAsync, diff --git a/src/apify_client/clients/base/resource_client.py b/src/apify_client/clients/base/resource_client.py index bae1971b..f0d39401 100644 --- a/src/apify_client/clients/base/resource_client.py +++ b/src/apify_client/clients/base/resource_client.py @@ -11,7 +11,7 @@ class ResourceClient(BaseClient): """Base class for sub-clients manipulating a single resource.""" - def _get(self: ResourceClient) -> dict | None: + def _get(self) -> dict | None: try: response = self.http_client.call( url=self.url, @@ -26,7 +26,7 @@ def _get(self: ResourceClient) -> dict | None: return None - def _update(self: ResourceClient, updated_fields: dict) -> dict: + def _update(self, updated_fields: dict) -> dict: response = self.http_client.call( url=self._url(), method='PUT', @@ -36,7 +36,7 @@ def _update(self: ResourceClient, updated_fields: dict) -> dict: return parse_date_fields(pluck_data(response.json())) - def _delete(self: ResourceClient) -> None: + def _delete(self) -> None: try: self.http_client.call( url=self._url(), @@ -52,7 +52,7 @@ def _delete(self: ResourceClient) -> None: class ResourceClientAsync(BaseClientAsync): """Base class for async sub-clients manipulating a single resource.""" - async def _get(self: ResourceClientAsync) -> dict | None: + async def _get(self) -> dict | None: try: response = await self.http_client.call( url=self.url, @@ -67,7 +67,7 @@ async def _get(self: ResourceClientAsync) -> dict | None: return None - async def _update(self: ResourceClientAsync, updated_fields: dict) -> dict: + async def _update(self, updated_fields: dict) -> dict: response = await self.http_client.call( url=self._url(), method='PUT', @@ -77,7 +77,7 @@ async def _update(self: ResourceClientAsync, updated_fields: dict) -> dict: return parse_date_fields(pluck_data(response.json())) - async def _delete(self: ResourceClientAsync) -> None: + async def _delete(self) -> None: try: await self.http_client.call( url=self._url(), diff --git a/src/apify_client/clients/base/resource_collection_client.py b/src/apify_client/clients/base/resource_collection_client.py index 1c33285e..a91b1ed7 100644 --- a/src/apify_client/clients/base/resource_collection_client.py +++ b/src/apify_client/clients/base/resource_collection_client.py @@ -13,7 +13,7 @@ class ResourceCollectionClient(BaseClient): """Base class for sub-clients manipulating a resource collection.""" - def _list(self: ResourceCollectionClient, **kwargs: Any) -> ListPage: + def _list(self, **kwargs: Any) -> ListPage: response = self.http_client.call( url=self._url(), method='GET', @@ -22,7 +22,7 @@ def _list(self: ResourceCollectionClient, **kwargs: Any) -> ListPage: return ListPage(parse_date_fields(pluck_data(response.json()))) - def _create(self: ResourceCollectionClient, resource: dict) -> dict: + def _create(self, resource: dict) -> dict: response = self.http_client.call( url=self._url(), method='POST', @@ -32,11 +32,7 @@ def _create(self: ResourceCollectionClient, resource: dict) -> dict: return parse_date_fields(pluck_data(response.json())) - def _get_or_create( - self: ResourceCollectionClient, - name: str | None = None, - resource: dict | None = None, - ) -> dict: + def _get_or_create(self, name: str | None = None, resource: dict | None = None) -> dict: response = self.http_client.call( url=self._url(), method='POST', @@ -51,7 +47,7 @@ def _get_or_create( class ResourceCollectionClientAsync(BaseClientAsync): """Base class for async sub-clients manipulating a resource collection.""" - async def _list(self: ResourceCollectionClientAsync, **kwargs: Any) -> ListPage: + async def _list(self, **kwargs: Any) -> ListPage: response = await self.http_client.call( url=self._url(), method='GET', @@ -60,7 +56,7 @@ async def _list(self: ResourceCollectionClientAsync, **kwargs: Any) -> ListPage: return ListPage(parse_date_fields(pluck_data(response.json()))) - async def _create(self: ResourceCollectionClientAsync, resource: dict) -> dict: + async def _create(self, resource: dict) -> dict: response = await self.http_client.call( url=self._url(), method='POST', @@ -71,7 +67,7 @@ async def _create(self: ResourceCollectionClientAsync, resource: dict) -> dict: return parse_date_fields(pluck_data(response.json())) async def _get_or_create( - self: ResourceCollectionClientAsync, + self, name: str | None = None, resource: dict | None = None, ) -> dict: diff --git a/src/apify_client/clients/resource_clients/actor.py b/src/apify_client/clients/resource_clients/actor.py index e65659eb..0cce4f6f 100644 --- a/src/apify_client/clients/resource_clients/actor.py +++ b/src/apify_client/clients/resource_clients/actor.py @@ -86,12 +86,12 @@ class ActorClient(ResourceClient): """Sub-client for manipulating a single Actor.""" @ignore_docs - def __init__(self: ActorClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorClient.""" resource_path = kwargs.pop('resource_path', 'acts') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: ActorClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor @@ -102,7 +102,7 @@ def get(self: ActorClient) -> dict | None: return self._get() def update( - self: ActorClient, + self, *, name: str | None = None, title: str | None = None, @@ -190,7 +190,7 @@ def update( return self._update(filter_out_none_values_recursively(actor_representation)) - def delete(self: ActorClient) -> None: + def delete(self) -> None: """Delete the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor @@ -198,7 +198,7 @@ def delete(self: ActorClient) -> None: return self._delete() def start( - self: ActorClient, + self, *, run_input: Any = None, content_type: str | None = None, @@ -260,7 +260,7 @@ def start( return parse_date_fields(pluck_data(response.json())) def call( - self: ActorClient, + self, *, run_input: Any = None, content_type: str | None = None, @@ -309,7 +309,7 @@ def call( return self.root_client.run(started_run['id']).wait_for_finish(wait_secs=wait_secs) def build( - self: ActorClient, + self, *, version_number: str, beta_packages: bool | None = None, @@ -352,16 +352,16 @@ def build( return parse_date_fields(pluck_data(response.json())) - def builds(self: ActorClient) -> BuildCollectionClient: + def builds(self) -> BuildCollectionClient: """Retrieve a client for the builds of this Actor.""" return BuildCollectionClient(**self._sub_resource_init_options(resource_path='builds')) - def runs(self: ActorClient) -> RunCollectionClient: + def runs(self) -> RunCollectionClient: """Retrieve a client for the runs of this Actor.""" return RunCollectionClient(**self._sub_resource_init_options(resource_path='runs')) def last_run( - self: ActorClient, + self, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None, @@ -388,11 +388,11 @@ def last_run( ) ) - def versions(self: ActorClient) -> ActorVersionCollectionClient: + def versions(self) -> ActorVersionCollectionClient: """Retrieve a client for the versions of this Actor.""" return ActorVersionCollectionClient(**self._sub_resource_init_options()) - def version(self: ActorClient, version_number: str) -> ActorVersionClient: + def version(self, version_number: str) -> ActorVersionClient: """Retrieve the client for the specified version of this Actor. Args: @@ -403,7 +403,7 @@ def version(self: ActorClient, version_number: str) -> ActorVersionClient: """ return ActorVersionClient(**self._sub_resource_init_options(resource_id=version_number)) - def webhooks(self: ActorClient) -> WebhookCollectionClient: + def webhooks(self) -> WebhookCollectionClient: """Retrieve a client for webhooks associated with this Actor.""" return WebhookCollectionClient(**self._sub_resource_init_options()) @@ -412,12 +412,12 @@ class ActorClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single Actor.""" @ignore_docs - def __init__(self: ActorClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorClientAsync.""" resource_path = kwargs.pop('resource_path', 'acts') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: ActorClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor @@ -428,7 +428,7 @@ async def get(self: ActorClientAsync) -> dict | None: return await self._get() async def update( - self: ActorClientAsync, + self, *, name: str | None = None, title: str | None = None, @@ -516,7 +516,7 @@ async def update( return await self._update(filter_out_none_values_recursively(actor_representation)) - async def delete(self: ActorClientAsync) -> None: + async def delete(self) -> None: """Delete the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor @@ -524,7 +524,7 @@ async def delete(self: ActorClientAsync) -> None: return await self._delete() async def start( - self: ActorClientAsync, + self, *, run_input: Any = None, content_type: str | None = None, @@ -586,7 +586,7 @@ async def start( return parse_date_fields(pluck_data(response.json())) async def call( - self: ActorClientAsync, + self, *, run_input: Any = None, content_type: str | None = None, @@ -635,7 +635,7 @@ async def call( return await self.root_client.run(started_run['id']).wait_for_finish(wait_secs=wait_secs) async def build( - self: ActorClientAsync, + self, *, version_number: str, beta_packages: bool | None = None, @@ -678,15 +678,15 @@ async def build( return parse_date_fields(pluck_data(response.json())) - def builds(self: ActorClientAsync) -> BuildCollectionClientAsync: + def builds(self) -> BuildCollectionClientAsync: """Retrieve a client for the builds of this Actor.""" return BuildCollectionClientAsync(**self._sub_resource_init_options(resource_path='builds')) - def runs(self: ActorClientAsync) -> RunCollectionClientAsync: + def runs(self) -> RunCollectionClientAsync: """Retrieve a client for the runs of this Actor.""" return RunCollectionClientAsync(**self._sub_resource_init_options(resource_path='runs')) - def last_run(self: ActorClientAsync, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClientAsync: + def last_run(self, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClientAsync: """Retrieve the client for the last run of this Actor. Last run is retrieved based on the start time of the runs. @@ -709,11 +709,11 @@ def last_run(self: ActorClientAsync, *, status: ActorJobStatus | None = None, or ) ) - def versions(self: ActorClientAsync) -> ActorVersionCollectionClientAsync: + def versions(self) -> ActorVersionCollectionClientAsync: """Retrieve a client for the versions of this Actor.""" return ActorVersionCollectionClientAsync(**self._sub_resource_init_options()) - def version(self: ActorClientAsync, version_number: str) -> ActorVersionClientAsync: + def version(self, version_number: str) -> ActorVersionClientAsync: """Retrieve the client for the specified version of this Actor. Args: @@ -724,6 +724,6 @@ def version(self: ActorClientAsync, version_number: str) -> ActorVersionClientAs """ return ActorVersionClientAsync(**self._sub_resource_init_options(resource_id=version_number)) - def webhooks(self: ActorClientAsync) -> WebhookCollectionClientAsync: + def webhooks(self) -> WebhookCollectionClientAsync: """Retrieve a client for webhooks associated with this Actor.""" return WebhookCollectionClientAsync(**self._sub_resource_init_options()) diff --git a/src/apify_client/clients/resource_clients/actor_collection.py b/src/apify_client/clients/resource_clients/actor_collection.py index f3660989..008cabf8 100644 --- a/src/apify_client/clients/resource_clients/actor_collection.py +++ b/src/apify_client/clients/resource_clients/actor_collection.py @@ -15,13 +15,13 @@ class ActorCollectionClient(ResourceCollectionClient): """Sub-client for manipulating Actors.""" @ignore_docs - def __init__(self: ActorCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorCollectionClient.""" resource_path = kwargs.pop('resource_path', 'acts') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: ActorCollectionClient, + self, *, my: bool | None = None, limit: int | None = None, @@ -44,7 +44,7 @@ def list( return self._list(my=my, limit=limit, offset=offset, desc=desc) def create( - self: ActorCollectionClient, + self, *, name: str, title: str | None = None, @@ -137,13 +137,13 @@ class ActorCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating Actors.""" @ignore_docs - def __init__(self: ActorCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'acts') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: ActorCollectionClientAsync, + self, *, my: bool | None = None, limit: int | None = None, @@ -166,7 +166,7 @@ async def list( return await self._list(my=my, limit=limit, offset=offset, desc=desc) async def create( - self: ActorCollectionClientAsync, + self, *, name: str, title: str | None = None, diff --git a/src/apify_client/clients/resource_clients/actor_env_var.py b/src/apify_client/clients/resource_clients/actor_env_var.py index b9428a36..34e6ca3b 100644 --- a/src/apify_client/clients/resource_clients/actor_env_var.py +++ b/src/apify_client/clients/resource_clients/actor_env_var.py @@ -25,12 +25,12 @@ class ActorEnvVarClient(ResourceClient): """Sub-client for manipulating a single Actor environment variable.""" @ignore_docs - def __init__(self: ActorEnvVarClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorEnvVarClient.""" resource_path = kwargs.pop('resource_path', 'env-vars') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: ActorEnvVarClient) -> dict | None: + def get(self) -> dict | None: """Return information about the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable @@ -41,7 +41,7 @@ def get(self: ActorEnvVarClient) -> dict | None: return self._get() def update( - self: ActorEnvVarClient, + self, *, is_secret: bool | None = None, name: str, @@ -67,7 +67,7 @@ def update( return self._update(filter_out_none_values_recursively(actor_env_var_representation)) - def delete(self: ActorEnvVarClient) -> None: + def delete(self) -> None: """Delete the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable @@ -79,12 +79,12 @@ class ActorEnvVarClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single Actor environment variable.""" @ignore_docs - def __init__(self: ActorEnvVarClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorEnvVarClientAsync.""" resource_path = kwargs.pop('resource_path', 'env-vars') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: ActorEnvVarClientAsync) -> dict | None: + async def get(self) -> dict | None: """Return information about the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable @@ -95,7 +95,7 @@ async def get(self: ActorEnvVarClientAsync) -> dict | None: return await self._get() async def update( - self: ActorEnvVarClientAsync, + self, *, is_secret: bool | None = None, name: str, @@ -121,7 +121,7 @@ async def update( return await self._update(filter_out_none_values_recursively(actor_env_var_representation)) - async def delete(self: ActorEnvVarClientAsync) -> None: + async def delete(self) -> None: """Delete the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable diff --git a/src/apify_client/clients/resource_clients/actor_env_var_collection.py b/src/apify_client/clients/resource_clients/actor_env_var_collection.py index 27f182cd..9b8ae55b 100644 --- a/src/apify_client/clients/resource_clients/actor_env_var_collection.py +++ b/src/apify_client/clients/resource_clients/actor_env_var_collection.py @@ -15,12 +15,12 @@ class ActorEnvVarCollectionClient(ResourceCollectionClient): """Sub-client for manipulating actor env vars.""" @ignore_docs - def __init__(self: ActorEnvVarCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorEnvVarCollectionClient with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'env-vars') super().__init__(*args, resource_path=resource_path, **kwargs) - def list(self: ActorEnvVarCollectionClient) -> ListPage[dict]: + def list(self) -> ListPage[dict]: """List the available actor environment variables. https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables @@ -31,7 +31,7 @@ def list(self: ActorEnvVarCollectionClient) -> ListPage[dict]: return self._list() def create( - self: ActorEnvVarCollectionClient, + self, *, is_secret: bool | None = None, name: str, @@ -62,12 +62,12 @@ class ActorEnvVarCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating actor env vars.""" @ignore_docs - def __init__(self: ActorEnvVarCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorEnvVarCollectionClientAsync with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'env-vars') super().__init__(*args, resource_path=resource_path, **kwargs) - async def list(self: ActorEnvVarCollectionClientAsync) -> ListPage[dict]: + async def list(self) -> ListPage[dict]: """List the available actor environment variables. https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables @@ -78,7 +78,7 @@ async def list(self: ActorEnvVarCollectionClientAsync) -> ListPage[dict]: return await self._list() async def create( - self: ActorEnvVarCollectionClientAsync, + self, *, is_secret: bool | None = None, name: str, diff --git a/src/apify_client/clients/resource_clients/actor_version.py b/src/apify_client/clients/resource_clients/actor_version.py index de3ae219..286db68b 100644 --- a/src/apify_client/clients/resource_clients/actor_version.py +++ b/src/apify_client/clients/resource_clients/actor_version.py @@ -41,12 +41,12 @@ class ActorVersionClient(ResourceClient): """Sub-client for manipulating a single Actor version.""" @ignore_docs - def __init__(self: ActorVersionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorVersionClient.""" resource_path = kwargs.pop('resource_path', 'versions') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: ActorVersionClient) -> dict | None: + def get(self) -> dict | None: """Return information about the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/get-version @@ -57,7 +57,7 @@ def get(self: ActorVersionClient) -> dict | None: return self._get() def update( - self: ActorVersionClient, + self, *, build_tag: str | None = None, env_vars: list[dict] | None = None, @@ -104,18 +104,18 @@ def update( return self._update(filter_out_none_values_recursively(actor_version_representation)) - def delete(self: ActorVersionClient) -> None: + def delete(self) -> None: """Delete the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version """ return self._delete() - def env_vars(self: ActorVersionClient) -> ActorEnvVarCollectionClient: + def env_vars(self) -> ActorEnvVarCollectionClient: """Retrieve a client for the environment variables of this Actor version.""" return ActorEnvVarCollectionClient(**self._sub_resource_init_options()) - def env_var(self: ActorVersionClient, env_var_name: str) -> ActorEnvVarClient: + def env_var(self, env_var_name: str) -> ActorEnvVarClient: """Retrieve the client for the specified environment variable of this Actor version. Args: @@ -131,12 +131,12 @@ class ActorVersionClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single Actor version.""" @ignore_docs - def __init__(self: ActorVersionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorVersionClientAsync.""" resource_path = kwargs.pop('resource_path', 'versions') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: ActorVersionClientAsync) -> dict | None: + async def get(self) -> dict | None: """Return information about the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/get-version @@ -147,7 +147,7 @@ async def get(self: ActorVersionClientAsync) -> dict | None: return await self._get() async def update( - self: ActorVersionClientAsync, + self, *, build_tag: str | None = None, env_vars: list[dict] | None = None, @@ -194,18 +194,18 @@ async def update( return await self._update(filter_out_none_values_recursively(actor_version_representation)) - async def delete(self: ActorVersionClientAsync) -> None: + async def delete(self) -> None: """Delete the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version """ return await self._delete() - def env_vars(self: ActorVersionClientAsync) -> ActorEnvVarCollectionClientAsync: + def env_vars(self) -> ActorEnvVarCollectionClientAsync: """Retrieve a client for the environment variables of this Actor version.""" return ActorEnvVarCollectionClientAsync(**self._sub_resource_init_options()) - def env_var(self: ActorVersionClientAsync, env_var_name: str) -> ActorEnvVarClientAsync: + def env_var(self, env_var_name: str) -> ActorEnvVarClientAsync: """Retrieve the client for the specified environment variable of this Actor version. Args: diff --git a/src/apify_client/clients/resource_clients/actor_version_collection.py b/src/apify_client/clients/resource_clients/actor_version_collection.py index 52f353af..5ef047be 100644 --- a/src/apify_client/clients/resource_clients/actor_version_collection.py +++ b/src/apify_client/clients/resource_clients/actor_version_collection.py @@ -16,12 +16,12 @@ class ActorVersionCollectionClient(ResourceCollectionClient): """Sub-client for manipulating Actor versions.""" @ignore_docs - def __init__(self: ActorVersionCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorVersionCollectionClient with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'versions') super().__init__(*args, resource_path=resource_path, **kwargs) - def list(self: ActorVersionCollectionClient) -> ListPage[dict]: + def list(self) -> ListPage[dict]: """List the available Actor versions. https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions @@ -32,7 +32,7 @@ def list(self: ActorVersionCollectionClient) -> ListPage[dict]: return self._list() def create( - self: ActorVersionCollectionClient, + self, *, version_number: str, build_tag: str | None = None, @@ -87,12 +87,12 @@ class ActorVersionCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating Actor versions.""" @ignore_docs - def __init__(self: ActorVersionCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ActorVersionCollectionClientAsync with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'versions') super().__init__(*args, resource_path=resource_path, **kwargs) - async def list(self: ActorVersionCollectionClientAsync) -> ListPage[dict]: + async def list(self) -> ListPage[dict]: """List the available Actor versions. https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions @@ -103,7 +103,7 @@ async def list(self: ActorVersionCollectionClientAsync) -> ListPage[dict]: return await self._list() async def create( - self: ActorVersionCollectionClientAsync, + self, *, version_number: str, build_tag: str | None = None, diff --git a/src/apify_client/clients/resource_clients/build.py b/src/apify_client/clients/resource_clients/build.py index 84a8ce70..38fd5ae4 100644 --- a/src/apify_client/clients/resource_clients/build.py +++ b/src/apify_client/clients/resource_clients/build.py @@ -12,12 +12,12 @@ class BuildClient(ActorJobBaseClient): """Sub-client for manipulating a single Actor build.""" @ignore_docs - def __init__(self: BuildClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the BuildClient.""" resource_path = kwargs.pop('resource_path', 'actor-builds') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: BuildClient) -> dict | None: + def get(self) -> dict | None: """Return information about the Actor build. https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build @@ -27,14 +27,14 @@ def get(self: BuildClient) -> dict | None: """ return self._get() - def delete(self: BuildClient) -> None: + def delete(self) -> None: """Delete the build. https://docs.apify.com/api/v2#/reference/actor-builds/delete-build/delete-build """ return self._delete() - def abort(self: BuildClient) -> dict: + def abort(self) -> dict: """Abort the Actor build which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-builds/abort-build/abort-build @@ -44,7 +44,7 @@ def abort(self: BuildClient) -> dict: """ return self._abort() - def wait_for_finish(self: BuildClient, *, wait_secs: int | None = None) -> dict | None: + def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None: """Wait synchronously until the build finishes or the server times out. Args: @@ -56,7 +56,7 @@ def wait_for_finish(self: BuildClient, *, wait_secs: int | None = None) -> dict """ return self._wait_for_finish(wait_secs=wait_secs) - def log(self: BuildClient) -> LogClient: + def log(self) -> LogClient: """Get the client for the log of the Actor build. https://docs.apify.com/api/v2/#/reference/actor-builds/build-log/get-log @@ -73,12 +73,12 @@ class BuildClientAsync(ActorJobBaseClientAsync): """Async sub-client for manipulating a single Actor build.""" @ignore_docs - def __init__(self: BuildClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the BuildClientAsync.""" resource_path = kwargs.pop('resource_path', 'actor-builds') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: BuildClientAsync) -> dict | None: + async def get(self) -> dict | None: """Return information about the Actor build. https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build @@ -88,7 +88,7 @@ async def get(self: BuildClientAsync) -> dict | None: """ return await self._get() - async def abort(self: BuildClientAsync) -> dict: + async def abort(self) -> dict: """Abort the Actor build which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-builds/abort-build/abort-build @@ -98,14 +98,14 @@ async def abort(self: BuildClientAsync) -> dict: """ return await self._abort() - async def delete(self: BuildClientAsync) -> None: + async def delete(self) -> None: """Delete the build. https://docs.apify.com/api/v2#/reference/actor-builds/delete-build/delete-build """ return await self._delete() - async def wait_for_finish(self: BuildClientAsync, *, wait_secs: int | None = None) -> dict | None: + async def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None: """Wait synchronously until the build finishes or the server times out. Args: @@ -117,7 +117,7 @@ async def wait_for_finish(self: BuildClientAsync, *, wait_secs: int | None = Non """ return await self._wait_for_finish(wait_secs=wait_secs) - def log(self: BuildClientAsync) -> LogClientAsync: + def log(self) -> LogClientAsync: """Get the client for the log of the Actor build. https://docs.apify.com/api/v2/#/reference/actor-builds/build-log/get-log diff --git a/src/apify_client/clients/resource_clients/build_collection.py b/src/apify_client/clients/resource_clients/build_collection.py index 0f36c912..fd78ceb5 100644 --- a/src/apify_client/clients/resource_clients/build_collection.py +++ b/src/apify_client/clients/resource_clients/build_collection.py @@ -14,13 +14,13 @@ class BuildCollectionClient(ResourceCollectionClient): """Sub-client for listing Actor builds.""" @ignore_docs - def __init__(self: BuildCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the BuildCollectionClient.""" resource_path = kwargs.pop('resource_path', 'actor-builds') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: BuildCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -46,13 +46,13 @@ class BuildCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for listing Actor builds.""" @ignore_docs - def __init__(self: BuildCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the BuildCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'actor-builds') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: BuildCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, diff --git a/src/apify_client/clients/resource_clients/dataset.py b/src/apify_client/clients/resource_clients/dataset.py index efdc3bf9..3a41d32c 100644 --- a/src/apify_client/clients/resource_clients/dataset.py +++ b/src/apify_client/clients/resource_clients/dataset.py @@ -20,12 +20,12 @@ class DatasetClient(ResourceClient): """Sub-client for manipulating a single dataset.""" @ignore_docs - def __init__(self: DatasetClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the DatasetClient.""" resource_path = kwargs.pop('resource_path', 'datasets') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: DatasetClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the dataset. https://docs.apify.com/api/v2#/reference/datasets/dataset/get-dataset @@ -35,7 +35,7 @@ def get(self: DatasetClient) -> dict | None: """ return self._get() - def update(self: DatasetClient, *, name: str | None = None) -> dict: + def update(self, *, name: str | None = None) -> dict: """Update the dataset with specified fields. https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset @@ -52,7 +52,7 @@ def update(self: DatasetClient, *, name: str | None = None) -> dict: return self._update(filter_out_none_values_recursively(updated_fields)) - def delete(self: DatasetClient) -> None: + def delete(self) -> None: """Delete the dataset. https://docs.apify.com/api/v2#/reference/datasets/dataset/delete-dataset @@ -60,7 +60,7 @@ def delete(self: DatasetClient) -> None: return self._delete() def list_items( - self: DatasetClient, + self, *, offset: int | None = None, limit: int | None = None, @@ -142,7 +142,7 @@ def list_items( ) def iterate_items( - self: DatasetClient, + self, *, offset: int = 0, limit: int | None = None, @@ -222,7 +222,7 @@ def iterate_items( should_finish = True def download_items( - self: DatasetClient, + self, *, item_format: str = 'json', offset: int | None = None, @@ -312,7 +312,7 @@ def download_items( ) def get_items_as_bytes( - self: DatasetClient, + self, *, item_format: str = 'json', offset: int | None = None, @@ -404,7 +404,7 @@ def get_items_as_bytes( @contextmanager def stream_items( - self: DatasetClient, + self, *, item_format: str = 'json', offset: int | None = None, @@ -496,7 +496,7 @@ def stream_items( if response: response.close() - def push_items(self: DatasetClient, items: JSONSerializable) -> None: + def push_items(self, items: JSONSerializable) -> None: """Push items to the dataset. https://docs.apify.com/api/v2#/reference/datasets/item-collection/put-items @@ -526,12 +526,12 @@ class DatasetClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single dataset.""" @ignore_docs - def __init__(self: DatasetClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the DatasetClientAsync.""" resource_path = kwargs.pop('resource_path', 'datasets') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: DatasetClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the dataset. https://docs.apify.com/api/v2#/reference/datasets/dataset/get-dataset @@ -541,7 +541,7 @@ async def get(self: DatasetClientAsync) -> dict | None: """ return await self._get() - async def update(self: DatasetClientAsync, *, name: str | None = None) -> dict: + async def update(self, *, name: str | None = None) -> dict: """Update the dataset with specified fields. https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset @@ -558,7 +558,7 @@ async def update(self: DatasetClientAsync, *, name: str | None = None) -> dict: return await self._update(filter_out_none_values_recursively(updated_fields)) - async def delete(self: DatasetClientAsync) -> None: + async def delete(self) -> None: """Delete the dataset. https://docs.apify.com/api/v2#/reference/datasets/dataset/delete-dataset @@ -566,7 +566,7 @@ async def delete(self: DatasetClientAsync) -> None: return await self._delete() async def list_items( - self: DatasetClientAsync, + self, *, offset: int | None = None, limit: int | None = None, @@ -648,7 +648,7 @@ async def list_items( ) async def iterate_items( - self: DatasetClientAsync, + self, *, offset: int = 0, limit: int | None = None, @@ -729,7 +729,7 @@ async def iterate_items( should_finish = True async def get_items_as_bytes( - self: DatasetClientAsync, + self, *, item_format: str = 'json', offset: int | None = None, @@ -821,7 +821,7 @@ async def get_items_as_bytes( @asynccontextmanager async def stream_items( - self: DatasetClientAsync, + self, *, item_format: str = 'json', offset: int | None = None, @@ -913,7 +913,7 @@ async def stream_items( if response: await response.aclose() - async def push_items(self: DatasetClientAsync, items: JSONSerializable) -> None: + async def push_items(self, items: JSONSerializable) -> None: """Push items to the dataset. https://docs.apify.com/api/v2#/reference/datasets/item-collection/put-items diff --git a/src/apify_client/clients/resource_clients/dataset_collection.py b/src/apify_client/clients/resource_clients/dataset_collection.py index eb651441..c1de6c39 100644 --- a/src/apify_client/clients/resource_clients/dataset_collection.py +++ b/src/apify_client/clients/resource_clients/dataset_collection.py @@ -14,13 +14,13 @@ class DatasetCollectionClient(ResourceCollectionClient): """Sub-client for manipulating datasets.""" @ignore_docs - def __init__(self: DatasetCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the DatasetCollectionClient with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'datasets') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: DatasetCollectionClient, + self, *, unnamed: bool | None = None, limit: int | None = None, @@ -42,7 +42,7 @@ def list( """ return self._list(unnamed=unnamed, limit=limit, offset=offset, desc=desc) - def get_or_create(self: DatasetCollectionClient, *, name: str | None = None, schema: dict | None = None) -> dict: + def get_or_create(self, *, name: str | None = None, schema: dict | None = None) -> dict: """Retrieve a named dataset, or create a new one when it doesn't exist. https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/create-dataset @@ -61,13 +61,13 @@ class DatasetCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating datasets.""" @ignore_docs - def __init__(self: DatasetCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the DatasetCollectionClientAsync with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'datasets') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: DatasetCollectionClientAsync, + self, *, unnamed: bool | None = None, limit: int | None = None, @@ -90,7 +90,7 @@ async def list( return await self._list(unnamed=unnamed, limit=limit, offset=offset, desc=desc) async def get_or_create( - self: DatasetCollectionClientAsync, + self, *, name: str | None = None, schema: dict | None = None, diff --git a/src/apify_client/clients/resource_clients/key_value_store.py b/src/apify_client/clients/resource_clients/key_value_store.py index 4b85b8eb..f8c7473a 100644 --- a/src/apify_client/clients/resource_clients/key_value_store.py +++ b/src/apify_client/clients/resource_clients/key_value_store.py @@ -18,12 +18,12 @@ class KeyValueStoreClient(ResourceClient): """Sub-client for manipulating a single key-value store.""" @ignore_docs - def __init__(self: KeyValueStoreClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the KeyValueStoreClient.""" resource_path = kwargs.pop('resource_path', 'key-value-stores') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: KeyValueStoreClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/get-store @@ -33,7 +33,7 @@ def get(self: KeyValueStoreClient) -> dict | None: """ return self._get() - def update(self: KeyValueStoreClient, *, name: str | None = None) -> dict: + def update(self, *, name: str | None = None) -> dict: """Update the key-value store with specified fields. https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-store @@ -50,14 +50,14 @@ def update(self: KeyValueStoreClient, *, name: str | None = None) -> dict: return self._update(filter_out_none_values_recursively(updated_fields)) - def delete(self: KeyValueStoreClient) -> None: + def delete(self) -> None: """Delete the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/delete-store """ return self._delete() - def list_keys(self: KeyValueStoreClient, *, limit: int | None = None, exclusive_start_key: str | None = None) -> dict: + def list_keys(self, *, limit: int | None = None, exclusive_start_key: str | None = None) -> dict: """List the keys in the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys @@ -79,7 +79,7 @@ def list_keys(self: KeyValueStoreClient, *, limit: int | None = None, exclusive_ return parse_date_fields(pluck_data(response.json())) - def get_record(self: KeyValueStoreClient, key: str, *, as_bytes: bool = False, as_file: bool = False) -> dict | None: + def get_record(self, key: str, *, as_bytes: bool = False, as_file: bool = False) -> dict | None: """Retrieve the given record from the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record @@ -129,7 +129,7 @@ def get_record(self: KeyValueStoreClient, key: str, *, as_bytes: bool = False, a return None - def get_record_as_bytes(self: KeyValueStoreClient, key: str) -> dict | None: + def get_record_as_bytes(self, key: str) -> dict | None: """Retrieve the given record from the key-value store, without parsing it. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record @@ -160,7 +160,7 @@ def get_record_as_bytes(self: KeyValueStoreClient, key: str) -> dict | None: return None @contextmanager - def stream_record(self: KeyValueStoreClient, key: str) -> Iterator[dict | None]: + def stream_record(self, key: str) -> Iterator[dict | None]: """Retrieve the given record from the key-value store, as a stream. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record @@ -195,7 +195,7 @@ def stream_record(self: KeyValueStoreClient, key: str) -> Iterator[dict | None]: response.close() def set_record( - self: KeyValueStoreClient, + self, key: str, value: Any, content_type: str | None = None, @@ -221,7 +221,7 @@ def set_record( headers=headers, ) - def delete_record(self: KeyValueStoreClient, key: str) -> None: + def delete_record(self, key: str) -> None: """Delete the specified record from the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/record/delete-record @@ -240,12 +240,12 @@ class KeyValueStoreClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single key-value store.""" @ignore_docs - def __init__(self: KeyValueStoreClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the KeyValueStoreClientAsync.""" resource_path = kwargs.pop('resource_path', 'key-value-stores') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: KeyValueStoreClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/get-store @@ -255,7 +255,7 @@ async def get(self: KeyValueStoreClientAsync) -> dict | None: """ return await self._get() - async def update(self: KeyValueStoreClientAsync, *, name: str | None = None) -> dict: + async def update(self, *, name: str | None = None) -> dict: """Update the key-value store with specified fields. https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-store @@ -272,14 +272,14 @@ async def update(self: KeyValueStoreClientAsync, *, name: str | None = None) -> return await self._update(filter_out_none_values_recursively(updated_fields)) - async def delete(self: KeyValueStoreClientAsync) -> None: + async def delete(self) -> None: """Delete the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/delete-store """ return await self._delete() - async def list_keys(self: KeyValueStoreClientAsync, *, limit: int | None = None, exclusive_start_key: str | None = None) -> dict: + async def list_keys(self, *, limit: int | None = None, exclusive_start_key: str | None = None) -> dict: """List the keys in the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys @@ -301,7 +301,7 @@ async def list_keys(self: KeyValueStoreClientAsync, *, limit: int | None = None, return parse_date_fields(pluck_data(response.json())) - async def get_record(self: KeyValueStoreClientAsync, key: str) -> dict | None: + async def get_record(self, key: str) -> dict | None: """Retrieve the given record from the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record @@ -332,7 +332,7 @@ async def get_record(self: KeyValueStoreClientAsync, key: str) -> dict | None: return None - async def get_record_as_bytes(self: KeyValueStoreClientAsync, key: str) -> dict | None: + async def get_record_as_bytes(self, key: str) -> dict | None: """Retrieve the given record from the key-value store, without parsing it. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record @@ -363,7 +363,7 @@ async def get_record_as_bytes(self: KeyValueStoreClientAsync, key: str) -> dict return None @asynccontextmanager - async def stream_record(self: KeyValueStoreClientAsync, key: str) -> AsyncIterator[dict | None]: + async def stream_record(self, key: str) -> AsyncIterator[dict | None]: """Retrieve the given record from the key-value store, as a stream. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record @@ -398,7 +398,7 @@ async def stream_record(self: KeyValueStoreClientAsync, key: str) -> AsyncIterat await response.aclose() async def set_record( - self: KeyValueStoreClientAsync, + self, key: str, value: Any, content_type: str | None = None, @@ -424,7 +424,7 @@ async def set_record( headers=headers, ) - async def delete_record(self: KeyValueStoreClientAsync, key: str) -> None: + async def delete_record(self, key: str) -> None: """Delete the specified record from the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/record/delete-record diff --git a/src/apify_client/clients/resource_clients/key_value_store_collection.py b/src/apify_client/clients/resource_clients/key_value_store_collection.py index 638ddde9..29190980 100644 --- a/src/apify_client/clients/resource_clients/key_value_store_collection.py +++ b/src/apify_client/clients/resource_clients/key_value_store_collection.py @@ -14,13 +14,13 @@ class KeyValueStoreCollectionClient(ResourceCollectionClient): """Sub-client for manipulating key-value stores.""" @ignore_docs - def __init__(self: KeyValueStoreCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the KeyValueStoreCollectionClient with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'key-value-stores') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: KeyValueStoreCollectionClient, + self, *, unnamed: bool | None = None, limit: int | None = None, @@ -43,7 +43,7 @@ def list( return self._list(unnamed=unnamed, limit=limit, offset=offset, desc=desc) def get_or_create( - self: KeyValueStoreCollectionClient, + self, *, name: str | None = None, schema: dict | None = None, @@ -66,13 +66,13 @@ class KeyValueStoreCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating key-value stores.""" @ignore_docs - def __init__(self: KeyValueStoreCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the KeyValueStoreCollectionClientAsync with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'key-value-stores') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: KeyValueStoreCollectionClientAsync, + self, *, unnamed: bool | None = None, limit: int | None = None, @@ -95,7 +95,7 @@ async def list( return await self._list(unnamed=unnamed, limit=limit, offset=offset, desc=desc) async def get_or_create( - self: KeyValueStoreCollectionClientAsync, + self, *, name: str | None = None, schema: dict | None = None, diff --git a/src/apify_client/clients/resource_clients/log.py b/src/apify_client/clients/resource_clients/log.py index 52189e38..96034bf2 100644 --- a/src/apify_client/clients/resource_clients/log.py +++ b/src/apify_client/clients/resource_clients/log.py @@ -19,12 +19,12 @@ class LogClient(ResourceClient): """Sub-client for manipulating logs.""" @ignore_docs - def __init__(self: LogClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the LogClient.""" resource_path = kwargs.pop('resource_path', 'logs') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: LogClient) -> str | None: + def get(self) -> str | None: """Retrieve the log as text. https://docs.apify.com/api/v2#/reference/logs/log/get-log @@ -46,7 +46,7 @@ def get(self: LogClient) -> str | None: return None - def get_as_bytes(self: LogClient) -> bytes | None: + def get_as_bytes(self) -> bytes | None: """Retrieve the log as raw bytes. https://docs.apify.com/api/v2#/reference/logs/log/get-log @@ -70,7 +70,7 @@ def get_as_bytes(self: LogClient) -> bytes | None: return None @contextmanager - def stream(self: LogClient) -> Iterator[httpx.Response | None]: + def stream(self) -> Iterator[httpx.Response | None]: """Retrieve the log as a stream. https://docs.apify.com/api/v2#/reference/logs/log/get-log @@ -101,12 +101,12 @@ class LogClientAsync(ResourceClientAsync): """Async sub-client for manipulating logs.""" @ignore_docs - def __init__(self: LogClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the LogClientAsync.""" resource_path = kwargs.pop('resource_path', 'logs') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: LogClientAsync) -> str | None: + async def get(self) -> str | None: """Retrieve the log as text. https://docs.apify.com/api/v2#/reference/logs/log/get-log @@ -128,7 +128,7 @@ async def get(self: LogClientAsync) -> str | None: return None - async def get_as_bytes(self: LogClientAsync) -> bytes | None: + async def get_as_bytes(self) -> bytes | None: """Retrieve the log as raw bytes. https://docs.apify.com/api/v2#/reference/logs/log/get-log @@ -152,7 +152,7 @@ async def get_as_bytes(self: LogClientAsync) -> bytes | None: return None @asynccontextmanager - async def stream(self: LogClientAsync) -> AsyncIterator[httpx.Response | None]: + async def stream(self) -> AsyncIterator[httpx.Response | None]: """Retrieve the log as a stream. https://docs.apify.com/api/v2#/reference/logs/log/get-log diff --git a/src/apify_client/clients/resource_clients/request_queue.py b/src/apify_client/clients/resource_clients/request_queue.py index d17e725a..98311cf4 100644 --- a/src/apify_client/clients/resource_clients/request_queue.py +++ b/src/apify_client/clients/resource_clients/request_queue.py @@ -56,7 +56,7 @@ class RequestQueueClient(ResourceClient): @ignore_docs def __init__( # noqa: D417 - self: RequestQueueClient, + self, *args: Any, client_key: str | None = None, **kwargs: Any, @@ -70,7 +70,7 @@ def __init__( # noqa: D417 super().__init__(*args, resource_path=resource_path, **kwargs) self.client_key = client_key - def get(self: RequestQueueClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the request queue. https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request-queue @@ -80,7 +80,7 @@ def get(self: RequestQueueClient) -> dict | None: """ return self._get() - def update(self: RequestQueueClient, *, name: str | None = None) -> dict: + def update(self, *, name: str | None = None) -> dict: """Update the request queue with specified fields. https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request-queue @@ -97,14 +97,14 @@ def update(self: RequestQueueClient, *, name: str | None = None) -> dict: return self._update(filter_out_none_values_recursively(updated_fields)) - def delete(self: RequestQueueClient) -> None: + def delete(self) -> None: """Delete the request queue. https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request-queue """ return self._delete() - def list_head(self: RequestQueueClient, *, limit: int | None = None) -> dict: + def list_head(self, *, limit: int | None = None) -> dict: """Retrieve a given number of requests from the beginning of the queue. https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head @@ -125,7 +125,7 @@ def list_head(self: RequestQueueClient, *, limit: int | None = None) -> dict: return parse_date_fields(pluck_data(response.json())) - def list_and_lock_head(self: RequestQueueClient, *, lock_secs: int, limit: int | None = None) -> dict: + def list_and_lock_head(self, *, lock_secs: int, limit: int | None = None) -> dict: """Retrieve a given number of unlocked requests from the beginning of the queue and lock them for a given time. https://docs.apify.com/api/v2#/reference/request-queues/queue-head-with-locks/get-head-and-lock @@ -148,7 +148,7 @@ def list_and_lock_head(self: RequestQueueClient, *, lock_secs: int, limit: int | return parse_date_fields(pluck_data(response.json())) - def add_request(self: RequestQueueClient, request: dict, *, forefront: bool | None = None) -> dict: + def add_request(self, request: dict, *, forefront: bool | None = None) -> dict: """Add a request to the queue. https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request @@ -171,7 +171,7 @@ def add_request(self: RequestQueueClient, request: dict, *, forefront: bool | No return parse_date_fields(pluck_data(response.json())) - def get_request(self: RequestQueueClient, request_id: str) -> dict | None: + def get_request(self, request_id: str) -> dict | None: """Retrieve a request from the queue. https://docs.apify.com/api/v2#/reference/request-queues/request/get-request @@ -195,7 +195,7 @@ def get_request(self: RequestQueueClient, request_id: str) -> dict | None: return None - def update_request(self: RequestQueueClient, request: dict, *, forefront: bool | None = None) -> dict: + def update_request(self, request: dict, *, forefront: bool | None = None) -> dict: """Update a request in the queue. https://docs.apify.com/api/v2#/reference/request-queues/request/update-request @@ -220,7 +220,7 @@ def update_request(self: RequestQueueClient, request: dict, *, forefront: bool | return parse_date_fields(pluck_data(response.json())) - def delete_request(self: RequestQueueClient, request_id: str) -> None: + def delete_request(self, request_id: str) -> None: """Delete a request from the queue. https://docs.apify.com/api/v2#/reference/request-queues/request/delete-request @@ -239,7 +239,7 @@ def delete_request(self: RequestQueueClient, request_id: str) -> None: ) def prolong_request_lock( - self: RequestQueueClient, + self, request_id: str, *, forefront: bool | None = None, @@ -264,7 +264,7 @@ def prolong_request_lock( return parse_date_fields(pluck_data(response.json())) - def delete_request_lock(self: RequestQueueClient, request_id: str, *, forefront: bool | None = None) -> None: + def delete_request_lock(self, request_id: str, *, forefront: bool | None = None) -> None: """Delete the lock on a request. https://docs.apify.com/api/v2#/reference/request-queues/request-lock/delete-request-lock @@ -361,7 +361,7 @@ def batch_add_requests( 'unprocessedRequests': unprocessed_requests, } - def batch_delete_requests(self: RequestQueueClient, requests: list[dict]) -> dict: + def batch_delete_requests(self, requests: list[dict]) -> dict: """Delete given requests from the queue. https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests @@ -381,7 +381,7 @@ def batch_delete_requests(self: RequestQueueClient, requests: list[dict]) -> dic return parse_date_fields(pluck_data(response.json())) def list_requests( - self: RequestQueueClient, + self, *, limit: int | None = None, exclusive_start_id: str | None = None, @@ -410,7 +410,7 @@ class RequestQueueClientAsync(ResourceClientAsync): @ignore_docs def __init__( # noqa: D417 - self: RequestQueueClientAsync, + self, *args: Any, client_key: str | None = None, **kwargs: Any, @@ -424,7 +424,7 @@ def __init__( # noqa: D417 super().__init__(*args, resource_path=resource_path, **kwargs) self.client_key = client_key - async def get(self: RequestQueueClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the request queue. https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request-queue @@ -434,7 +434,7 @@ async def get(self: RequestQueueClientAsync) -> dict | None: """ return await self._get() - async def update(self: RequestQueueClientAsync, *, name: str | None = None) -> dict: + async def update(self, *, name: str | None = None) -> dict: """Update the request queue with specified fields. https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request-queue @@ -451,14 +451,14 @@ async def update(self: RequestQueueClientAsync, *, name: str | None = None) -> d return await self._update(filter_out_none_values_recursively(updated_fields)) - async def delete(self: RequestQueueClientAsync) -> None: + async def delete(self) -> None: """Delete the request queue. https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request-queue """ return await self._delete() - async def list_head(self: RequestQueueClientAsync, *, limit: int | None = None) -> dict: + async def list_head(self, *, limit: int | None = None) -> dict: """Retrieve a given number of requests from the beginning of the queue. https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head @@ -479,7 +479,7 @@ async def list_head(self: RequestQueueClientAsync, *, limit: int | None = None) return parse_date_fields(pluck_data(response.json())) - async def list_and_lock_head(self: RequestQueueClientAsync, *, lock_secs: int, limit: int | None = None) -> dict: + async def list_and_lock_head(self, *, lock_secs: int, limit: int | None = None) -> dict: """Retrieve a given number of unlocked requests from the beginning of the queue and lock them for a given time. https://docs.apify.com/api/v2#/reference/request-queues/queue-head-with-locks/get-head-and-lock @@ -502,7 +502,7 @@ async def list_and_lock_head(self: RequestQueueClientAsync, *, lock_secs: int, l return parse_date_fields(pluck_data(response.json())) - async def add_request(self: RequestQueueClientAsync, request: dict, *, forefront: bool | None = None) -> dict: + async def add_request(self, request: dict, *, forefront: bool | None = None) -> dict: """Add a request to the queue. https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request @@ -525,7 +525,7 @@ async def add_request(self: RequestQueueClientAsync, request: dict, *, forefront return parse_date_fields(pluck_data(response.json())) - async def get_request(self: RequestQueueClientAsync, request_id: str) -> dict | None: + async def get_request(self, request_id: str) -> dict | None: """Retrieve a request from the queue. https://docs.apify.com/api/v2#/reference/request-queues/request/get-request @@ -549,7 +549,7 @@ async def get_request(self: RequestQueueClientAsync, request_id: str) -> dict | return None - async def update_request(self: RequestQueueClientAsync, request: dict, *, forefront: bool | None = None) -> dict: + async def update_request(self, request: dict, *, forefront: bool | None = None) -> dict: """Update a request in the queue. https://docs.apify.com/api/v2#/reference/request-queues/request/update-request @@ -574,7 +574,7 @@ async def update_request(self: RequestQueueClientAsync, request: dict, *, forefr return parse_date_fields(pluck_data(response.json())) - async def delete_request(self: RequestQueueClientAsync, request_id: str) -> None: + async def delete_request(self, request_id: str) -> None: """Delete a request from the queue. https://docs.apify.com/api/v2#/reference/request-queues/request/delete-request @@ -591,7 +591,7 @@ async def delete_request(self: RequestQueueClientAsync, request_id: str) -> None ) async def prolong_request_lock( - self: RequestQueueClientAsync, + self, request_id: str, *, forefront: bool | None = None, @@ -617,7 +617,7 @@ async def prolong_request_lock( return parse_date_fields(pluck_data(response.json())) async def delete_request_lock( - self: RequestQueueClientAsync, + self, request_id: str, *, forefront: bool | None = None, @@ -772,7 +772,7 @@ async def batch_add_requests( 'unprocessedRequests': unprocessed_requests, } - async def batch_delete_requests(self: RequestQueueClientAsync, requests: list[dict]) -> dict: + async def batch_delete_requests(self, requests: list[dict]) -> dict: """Delete given requests from the queue. https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests @@ -791,7 +791,7 @@ async def batch_delete_requests(self: RequestQueueClientAsync, requests: list[di return parse_date_fields(pluck_data(response.json())) async def list_requests( - self: RequestQueueClientAsync, + self, *, limit: int | None = None, exclusive_start_id: str | None = None, diff --git a/src/apify_client/clients/resource_clients/request_queue_collection.py b/src/apify_client/clients/resource_clients/request_queue_collection.py index d56657f8..f5c97808 100644 --- a/src/apify_client/clients/resource_clients/request_queue_collection.py +++ b/src/apify_client/clients/resource_clients/request_queue_collection.py @@ -14,13 +14,13 @@ class RequestQueueCollectionClient(ResourceCollectionClient): """Sub-client for manipulating request queues.""" @ignore_docs - def __init__(self: RequestQueueCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the RequestQueueCollectionClient with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'request-queues') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: RequestQueueCollectionClient, + self, *, unnamed: bool | None = None, limit: int | None = None, @@ -42,7 +42,7 @@ def list( """ return self._list(unnamed=unnamed, limit=limit, offset=offset, desc=desc) - def get_or_create(self: RequestQueueCollectionClient, *, name: str | None = None) -> dict: + def get_or_create(self, *, name: str | None = None) -> dict: """Retrieve a named request queue, or create a new one when it doesn't exist. https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/create-request-queue @@ -60,13 +60,13 @@ class RequestQueueCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating request queues.""" @ignore_docs - def __init__(self: RequestQueueCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the RequestQueueCollectionClientAsync with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'request-queues') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: RequestQueueCollectionClientAsync, + self, *, unnamed: bool | None = None, limit: int | None = None, @@ -88,7 +88,7 @@ async def list( """ return await self._list(unnamed=unnamed, limit=limit, offset=offset, desc=desc) - async def get_or_create(self: RequestQueueCollectionClientAsync, *, name: str | None = None) -> dict: + async def get_or_create(self, *, name: str | None = None) -> dict: """Retrieve a named request queue, or create a new one when it doesn't exist. https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/create-request-queue diff --git a/src/apify_client/clients/resource_clients/run.py b/src/apify_client/clients/resource_clients/run.py index 73263c1c..09ecbebf 100644 --- a/src/apify_client/clients/resource_clients/run.py +++ b/src/apify_client/clients/resource_clients/run.py @@ -20,12 +20,12 @@ class RunClient(ActorJobBaseClient): """Sub-client for manipulating a single Actor run.""" @ignore_docs - def __init__(self: RunClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the RunClient.""" resource_path = kwargs.pop('resource_path', 'actor-runs') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: RunClient) -> dict | None: + def get(self) -> dict | None: """Return information about the Actor run. https://docs.apify.com/api/v2#/reference/actor-runs/run-object/get-run @@ -35,7 +35,7 @@ def get(self: RunClient) -> dict | None: """ return self._get() - def update(self: RunClient, *, status_message: str | None = None, is_status_message_terminal: bool | None = None) -> dict: + def update(self, *, status_message: str | None = None, is_status_message_terminal: bool | None = None) -> dict: """Update the run with the specified fields. https://docs.apify.com/api/v2#/reference/actor-runs/run-object/update-run @@ -54,14 +54,14 @@ def update(self: RunClient, *, status_message: str | None = None, is_status_mess return self._update(filter_out_none_values_recursively(updated_fields)) - def delete(self: RunClient) -> None: + def delete(self) -> None: """Delete the run. https://docs.apify.com/api/v2#/reference/actor-runs/delete-run/delete-run """ return self._delete() - def abort(self: RunClient, *, gracefully: bool | None = None) -> dict: + def abort(self, *, gracefully: bool | None = None) -> dict: """Abort the Actor run which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run @@ -76,7 +76,7 @@ def abort(self: RunClient, *, gracefully: bool | None = None) -> dict: """ return self._abort(gracefully=gracefully) - def wait_for_finish(self: RunClient, *, wait_secs: int | None = None) -> dict | None: + def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None: """Wait synchronously until the run finishes or the server times out. Args: @@ -89,7 +89,7 @@ def wait_for_finish(self: RunClient, *, wait_secs: int | None = None) -> dict | return self._wait_for_finish(wait_secs=wait_secs) def metamorph( - self: RunClient, + self, *, target_actor_id: str, target_actor_build: str | None = None, @@ -130,7 +130,7 @@ def metamorph( return parse_date_fields(pluck_data(response.json())) def resurrect( - self: RunClient, + self, *, build: str | None = None, memory_mbytes: int | None = None, @@ -168,7 +168,7 @@ def resurrect( return parse_date_fields(pluck_data(response.json())) - def reboot(self: RunClient) -> dict: + def reboot(self) -> dict: """Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run @@ -182,7 +182,7 @@ def reboot(self: RunClient) -> dict: ) return parse_date_fields(pluck_data(response.json())) - def dataset(self: RunClient) -> DatasetClient: + def dataset(self) -> DatasetClient: """Get the client for the default dataset of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -194,7 +194,7 @@ def dataset(self: RunClient) -> DatasetClient: **self._sub_resource_init_options(resource_path='dataset'), ) - def key_value_store(self: RunClient) -> KeyValueStoreClient: + def key_value_store(self) -> KeyValueStoreClient: """Get the client for the default key-value store of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -206,7 +206,7 @@ def key_value_store(self: RunClient) -> KeyValueStoreClient: **self._sub_resource_init_options(resource_path='key-value-store'), ) - def request_queue(self: RunClient) -> RequestQueueClient: + def request_queue(self) -> RequestQueueClient: """Get the client for the default request queue of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -218,7 +218,7 @@ def request_queue(self: RunClient) -> RequestQueueClient: **self._sub_resource_init_options(resource_path='request-queue'), ) - def log(self: RunClient) -> LogClient: + def log(self) -> LogClient: """Get the client for the log of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -231,7 +231,7 @@ def log(self: RunClient) -> LogClient: ) def charge( - self: RunClient, + self, event_name: str, count: int | None = None, idempotency_key: str | None = None, @@ -271,12 +271,12 @@ class RunClientAsync(ActorJobBaseClientAsync): """Async sub-client for manipulating a single Actor run.""" @ignore_docs - def __init__(self: RunClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the RunClientAsync.""" resource_path = kwargs.pop('resource_path', 'actor-runs') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: RunClientAsync) -> dict | None: + async def get(self) -> dict | None: """Return information about the Actor run. https://docs.apify.com/api/v2#/reference/actor-runs/run-object/get-run @@ -286,7 +286,7 @@ async def get(self: RunClientAsync) -> dict | None: """ return await self._get() - async def update(self: RunClientAsync, *, status_message: str | None = None, is_status_message_terminal: bool | None = None) -> dict: + async def update(self, *, status_message: str | None = None, is_status_message_terminal: bool | None = None) -> dict: """Update the run with the specified fields. https://docs.apify.com/api/v2#/reference/actor-runs/run-object/update-run @@ -305,7 +305,7 @@ async def update(self: RunClientAsync, *, status_message: str | None = None, is_ return await self._update(filter_out_none_values_recursively(updated_fields)) - async def abort(self: RunClientAsync, *, gracefully: bool | None = None) -> dict: + async def abort(self, *, gracefully: bool | None = None) -> dict: """Abort the Actor run which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run @@ -320,7 +320,7 @@ async def abort(self: RunClientAsync, *, gracefully: bool | None = None) -> dict """ return await self._abort(gracefully=gracefully) - async def wait_for_finish(self: RunClientAsync, *, wait_secs: int | None = None) -> dict | None: + async def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None: """Wait synchronously until the run finishes or the server times out. Args: @@ -332,7 +332,7 @@ async def wait_for_finish(self: RunClientAsync, *, wait_secs: int | None = None) """ return await self._wait_for_finish(wait_secs=wait_secs) - async def delete(self: RunClientAsync) -> None: + async def delete(self) -> None: """Delete the run. https://docs.apify.com/api/v2#/reference/actor-runs/delete-run/delete-run @@ -340,7 +340,7 @@ async def delete(self: RunClientAsync) -> None: return await self._delete() async def metamorph( - self: RunClientAsync, + self, *, target_actor_id: str, target_actor_build: str | None = None, @@ -381,7 +381,7 @@ async def metamorph( return parse_date_fields(pluck_data(response.json())) async def resurrect( - self: RunClientAsync, + self, *, build: str | None = None, memory_mbytes: int | None = None, @@ -419,7 +419,7 @@ async def resurrect( return parse_date_fields(pluck_data(response.json())) - async def reboot(self: RunClientAsync) -> dict: + async def reboot(self) -> dict: """Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run @@ -433,7 +433,7 @@ async def reboot(self: RunClientAsync) -> dict: ) return parse_date_fields(pluck_data(response.json())) - def dataset(self: RunClientAsync) -> DatasetClientAsync: + def dataset(self) -> DatasetClientAsync: """Get the client for the default dataset of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -445,7 +445,7 @@ def dataset(self: RunClientAsync) -> DatasetClientAsync: **self._sub_resource_init_options(resource_path='dataset'), ) - def key_value_store(self: RunClientAsync) -> KeyValueStoreClientAsync: + def key_value_store(self) -> KeyValueStoreClientAsync: """Get the client for the default key-value store of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -457,7 +457,7 @@ def key_value_store(self: RunClientAsync) -> KeyValueStoreClientAsync: **self._sub_resource_init_options(resource_path='key-value-store'), ) - def request_queue(self: RunClientAsync) -> RequestQueueClientAsync: + def request_queue(self) -> RequestQueueClientAsync: """Get the client for the default request queue of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -469,7 +469,7 @@ def request_queue(self: RunClientAsync) -> RequestQueueClientAsync: **self._sub_resource_init_options(resource_path='request-queue'), ) - def log(self: RunClientAsync) -> LogClientAsync: + def log(self) -> LogClientAsync: """Get the client for the log of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages @@ -482,7 +482,7 @@ def log(self: RunClientAsync) -> LogClientAsync: ) async def charge( - self: RunClientAsync, + self, event_name: str, count: int | None = None, idempotency_key: str | None = None, diff --git a/src/apify_client/clients/resource_clients/run_collection.py b/src/apify_client/clients/resource_clients/run_collection.py index 65103dab..bb787b9b 100644 --- a/src/apify_client/clients/resource_clients/run_collection.py +++ b/src/apify_client/clients/resource_clients/run_collection.py @@ -15,13 +15,13 @@ class RunCollectionClient(ResourceCollectionClient): """Sub-client for listing Actor runs.""" @ignore_docs - def __init__(self: RunCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the RunCollectionClient.""" resource_path = kwargs.pop('resource_path', 'actor-runs') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: RunCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -55,13 +55,13 @@ class RunCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for listing Actor runs.""" @ignore_docs - def __init__(self: RunCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the RunCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'actor-runs') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: RunCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, diff --git a/src/apify_client/clients/resource_clients/schedule.py b/src/apify_client/clients/resource_clients/schedule.py index 76bf5f92..f5cbc85b 100644 --- a/src/apify_client/clients/resource_clients/schedule.py +++ b/src/apify_client/clients/resource_clients/schedule.py @@ -35,12 +35,12 @@ class ScheduleClient(ResourceClient): """Sub-client for manipulating a single schedule.""" @ignore_docs - def __init__(self: ScheduleClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ScheduleClient.""" resource_path = kwargs.pop('resource_path', 'schedules') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: ScheduleClient) -> dict | None: + def get(self) -> dict | None: """Return information about the schedule. https://docs.apify.com/api/v2#/reference/schedules/schedule-object/get-schedule @@ -51,7 +51,7 @@ def get(self: ScheduleClient) -> dict | None: return self._get() def update( - self: ScheduleClient, + self, *, cron_expression: str | None = None, is_enabled: bool | None = None, @@ -93,14 +93,14 @@ def update( return self._update(filter_out_none_values_recursively(schedule_representation)) - def delete(self: ScheduleClient) -> None: + def delete(self) -> None: """Delete the schedule. https://docs.apify.com/api/v2#/reference/schedules/schedule-object/delete-schedule """ self._delete() - def get_log(self: ScheduleClient) -> list | None: + def get_log(self) -> list | None: """Return log for the given schedule. https://docs.apify.com/api/v2#/reference/schedules/schedule-log/get-schedule-log @@ -125,12 +125,12 @@ class ScheduleClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single schedule.""" @ignore_docs - def __init__(self: ScheduleClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ScheduleClientAsync.""" resource_path = kwargs.pop('resource_path', 'schedules') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: ScheduleClientAsync) -> dict | None: + async def get(self) -> dict | None: """Return information about the schedule. https://docs.apify.com/api/v2#/reference/schedules/schedule-object/get-schedule @@ -141,7 +141,7 @@ async def get(self: ScheduleClientAsync) -> dict | None: return await self._get() async def update( - self: ScheduleClientAsync, + self, *, cron_expression: str | None = None, is_enabled: bool | None = None, @@ -183,14 +183,14 @@ async def update( return await self._update(filter_out_none_values_recursively(schedule_representation)) - async def delete(self: ScheduleClientAsync) -> None: + async def delete(self) -> None: """Delete the schedule. https://docs.apify.com/api/v2#/reference/schedules/schedule-object/delete-schedule """ await self._delete() - async def get_log(self: ScheduleClientAsync) -> list | None: + async def get_log(self) -> list | None: """Return log for the given schedule. https://docs.apify.com/api/v2#/reference/schedules/schedule-log/get-schedule-log diff --git a/src/apify_client/clients/resource_clients/schedule_collection.py b/src/apify_client/clients/resource_clients/schedule_collection.py index c894dc9b..845037a2 100644 --- a/src/apify_client/clients/resource_clients/schedule_collection.py +++ b/src/apify_client/clients/resource_clients/schedule_collection.py @@ -15,13 +15,13 @@ class ScheduleCollectionClient(ResourceCollectionClient): """Sub-client for manipulating schedules.""" @ignore_docs - def __init__(self: ScheduleCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ScheduleCollectionClient with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'schedules') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: ScheduleCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -42,7 +42,7 @@ def list( return self._list(limit=limit, offset=offset, desc=desc) def create( - self: ScheduleCollectionClient, + self, *, cron_expression: str, is_enabled: bool, @@ -92,13 +92,13 @@ class ScheduleCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating schedules.""" @ignore_docs - def __init__(self: ScheduleCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the ScheduleCollectionClientAsync with the passed arguments.""" resource_path = kwargs.pop('resource_path', 'schedules') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: ScheduleCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, @@ -119,7 +119,7 @@ async def list( return await self._list(limit=limit, offset=offset, desc=desc) async def create( - self: ScheduleCollectionClientAsync, + self, *, cron_expression: str, is_enabled: bool, diff --git a/src/apify_client/clients/resource_clients/store_collection.py b/src/apify_client/clients/resource_clients/store_collection.py index 76904e54..0812d66c 100644 --- a/src/apify_client/clients/resource_clients/store_collection.py +++ b/src/apify_client/clients/resource_clients/store_collection.py @@ -14,13 +14,13 @@ class StoreCollectionClient(ResourceCollectionClient): """Sub-client for Apify store.""" @ignore_docs - def __init__(self: StoreCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the StoreCollectionClient.""" resource_path = kwargs.pop('resource_path', 'store') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: StoreCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -61,13 +61,13 @@ class StoreCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for Apify store.""" @ignore_docs - def __init__(self: StoreCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the StoreCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'store') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: StoreCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, diff --git a/src/apify_client/clients/resource_clients/task.py b/src/apify_client/clients/resource_clients/task.py index 2df842a4..ea9e1e52 100644 --- a/src/apify_client/clients/resource_clients/task.py +++ b/src/apify_client/clients/resource_clients/task.py @@ -61,12 +61,12 @@ class TaskClient(ResourceClient): """Sub-client for manipulating a single task.""" @ignore_docs - def __init__(self: TaskClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the TaskClient.""" resource_path = kwargs.pop('resource_path', 'actor-tasks') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: TaskClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/get-task @@ -77,7 +77,7 @@ def get(self: TaskClient) -> dict | None: return self._get() def update( - self: TaskClient, + self, *, name: str | None = None, task_input: dict | None = None, @@ -134,7 +134,7 @@ def update( return self._update(filter_out_none_values_recursively(task_representation)) - def delete(self: TaskClient) -> None: + def delete(self) -> None: """Delete the task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/delete-task @@ -142,7 +142,7 @@ def delete(self: TaskClient) -> None: return self._delete() def start( - self: TaskClient, + self, *, task_input: dict | None = None, build: str | None = None, @@ -199,7 +199,7 @@ def start( return parse_date_fields(pluck_data(response.json())) def call( - self: TaskClient, + self, *, task_input: dict | None = None, build: str | None = None, @@ -243,7 +243,7 @@ def call( return self.root_client.run(started_run['id']).wait_for_finish(wait_secs=wait_secs) - def get_input(self: TaskClient) -> dict | None: + def get_input(self) -> dict | None: """Retrieve the default input for this task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/get-task-input @@ -262,7 +262,7 @@ def get_input(self: TaskClient) -> dict | None: catch_not_found_or_throw(exc) return None - def update_input(self: TaskClient, *, task_input: dict) -> dict: + def update_input(self, *, task_input: dict) -> dict: """Update the default input for this task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input @@ -278,11 +278,11 @@ def update_input(self: TaskClient, *, task_input: dict) -> dict: ) return cast(dict, response.json()) - def runs(self: TaskClient) -> RunCollectionClient: + def runs(self) -> RunCollectionClient: """Retrieve a client for the runs of this task.""" return RunCollectionClient(**self._sub_resource_init_options(resource_path='runs')) - def last_run(self: TaskClient, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClient: + def last_run(self, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClient: """Retrieve the client for the last run of this task. Last run is retrieved based on the start time of the runs. @@ -305,7 +305,7 @@ def last_run(self: TaskClient, *, status: ActorJobStatus | None = None, origin: ) ) - def webhooks(self: TaskClient) -> WebhookCollectionClient: + def webhooks(self) -> WebhookCollectionClient: """Retrieve a client for webhooks associated with this task.""" return WebhookCollectionClient(**self._sub_resource_init_options()) @@ -314,12 +314,12 @@ class TaskClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single task.""" @ignore_docs - def __init__(self: TaskClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the TaskClientAsync.""" resource_path = kwargs.pop('resource_path', 'actor-tasks') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: TaskClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/get-task @@ -330,7 +330,7 @@ async def get(self: TaskClientAsync) -> dict | None: return await self._get() async def update( - self: TaskClientAsync, + self, *, name: str | None = None, task_input: dict | None = None, @@ -387,7 +387,7 @@ async def update( return await self._update(filter_out_none_values_recursively(task_representation)) - async def delete(self: TaskClientAsync) -> None: + async def delete(self) -> None: """Delete the task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/delete-task @@ -395,7 +395,7 @@ async def delete(self: TaskClientAsync) -> None: return await self._delete() async def start( - self: TaskClientAsync, + self, *, task_input: dict | None = None, build: str | None = None, @@ -452,7 +452,7 @@ async def start( return parse_date_fields(pluck_data(response.json())) async def call( - self: TaskClientAsync, + self, *, task_input: dict | None = None, build: str | None = None, @@ -496,7 +496,7 @@ async def call( return await self.root_client.run(started_run['id']).wait_for_finish(wait_secs=wait_secs) - async def get_input(self: TaskClientAsync) -> dict | None: + async def get_input(self) -> dict | None: """Retrieve the default input for this task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/get-task-input @@ -515,7 +515,7 @@ async def get_input(self: TaskClientAsync) -> dict | None: catch_not_found_or_throw(exc) return None - async def update_input(self: TaskClientAsync, *, task_input: dict) -> dict: + async def update_input(self, *, task_input: dict) -> dict: """Update the default input for this task. https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input @@ -531,11 +531,11 @@ async def update_input(self: TaskClientAsync, *, task_input: dict) -> dict: ) return cast(dict, response.json()) - def runs(self: TaskClientAsync) -> RunCollectionClientAsync: + def runs(self) -> RunCollectionClientAsync: """Retrieve a client for the runs of this task.""" return RunCollectionClientAsync(**self._sub_resource_init_options(resource_path='runs')) - def last_run(self: TaskClientAsync, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClientAsync: + def last_run(self, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClientAsync: """Retrieve the client for the last run of this task. Last run is retrieved based on the start time of the runs. @@ -558,6 +558,6 @@ def last_run(self: TaskClientAsync, *, status: ActorJobStatus | None = None, ori ) ) - def webhooks(self: TaskClientAsync) -> WebhookCollectionClientAsync: + def webhooks(self) -> WebhookCollectionClientAsync: """Retrieve a client for webhooks associated with this task.""" return WebhookCollectionClientAsync(**self._sub_resource_init_options()) diff --git a/src/apify_client/clients/resource_clients/task_collection.py b/src/apify_client/clients/resource_clients/task_collection.py index 3245869c..d32266f1 100644 --- a/src/apify_client/clients/resource_clients/task_collection.py +++ b/src/apify_client/clients/resource_clients/task_collection.py @@ -15,13 +15,13 @@ class TaskCollectionClient(ResourceCollectionClient): """Sub-client for manipulating tasks.""" @ignore_docs - def __init__(self: TaskCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the TaskCollectionClient.""" resource_path = kwargs.pop('resource_path', 'actor-tasks') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: TaskCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -42,7 +42,7 @@ def list( return self._list(limit=limit, offset=offset, desc=desc) def create( - self: TaskCollectionClient, + self, *, actor_id: str, name: str, @@ -107,13 +107,13 @@ class TaskCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating tasks.""" @ignore_docs - def __init__(self: TaskCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the TaskCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'actor-tasks') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: TaskCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, @@ -134,7 +134,7 @@ async def list( return await self._list(limit=limit, offset=offset, desc=desc) async def create( - self: TaskCollectionClientAsync, + self, *, actor_id: str, name: str, diff --git a/src/apify_client/clients/resource_clients/user.py b/src/apify_client/clients/resource_clients/user.py index 6a28db6c..c74c990a 100644 --- a/src/apify_client/clients/resource_clients/user.py +++ b/src/apify_client/clients/resource_clients/user.py @@ -13,7 +13,7 @@ class UserClient(ResourceClient): """Sub-client for querying user data.""" @ignore_docs - def __init__(self: UserClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the UserClient.""" resource_id = kwargs.pop('resource_id', None) if resource_id is None: @@ -21,7 +21,7 @@ def __init__(self: UserClient, *args: Any, **kwargs: Any) -> None: resource_path = kwargs.pop('resource_path', 'users') super().__init__(*args, resource_id=resource_id, resource_path=resource_path, **kwargs) - def get(self: UserClient) -> dict | None: + def get(self) -> dict | None: """Return information about user account. You receive all or only public info based on your token permissions. @@ -33,7 +33,7 @@ def get(self: UserClient) -> dict | None: """ return self._get() - def monthly_usage(self: UserClient) -> dict | None: + def monthly_usage(self) -> dict | None: """Return monthly usage of the user account. This includes a complete usage summary for the current usage cycle, an overall sum, as well as a daily breakdown @@ -58,7 +58,7 @@ def monthly_usage(self: UserClient) -> dict | None: return None - def limits(self: UserClient) -> dict | None: + def limits(self) -> dict | None: """Returns a complete summary of the user account's limits. It is the same information which is available on the account's Limits page. The returned data includes the current @@ -83,7 +83,7 @@ def limits(self: UserClient) -> dict | None: return None def update_limits( - self: UserClient, + self, *, max_monthly_usage_usd: int | None = None, data_retention_days: int | None = None, @@ -106,7 +106,7 @@ class UserClientAsync(ResourceClientAsync): """Async sub-client for querying user data.""" @ignore_docs - def __init__(self: UserClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the UserClientAsync.""" resource_id = kwargs.pop('resource_id', None) if resource_id is None: @@ -114,7 +114,7 @@ def __init__(self: UserClientAsync, *args: Any, **kwargs: Any) -> None: resource_path = kwargs.pop('resource_path', 'users') super().__init__(*args, resource_id=resource_id, resource_path=resource_path, **kwargs) - async def get(self: UserClientAsync) -> dict | None: + async def get(self) -> dict | None: """Return information about user account. You receive all or only public info based on your token permissions. @@ -126,7 +126,7 @@ async def get(self: UserClientAsync) -> dict | None: """ return await self._get() - async def monthly_usage(self: UserClientAsync) -> dict | None: + async def monthly_usage(self) -> dict | None: """Return monthly usage of the user account. This includes a complete usage summary for the current usage cycle, an overall sum, as well as a daily breakdown @@ -151,7 +151,7 @@ async def monthly_usage(self: UserClientAsync) -> dict | None: return None - async def limits(self: UserClientAsync) -> dict | None: + async def limits(self) -> dict | None: """Returns a complete summary of the user account's limits. It is the same information which is available on the account's Limits page. The returned data includes the current @@ -176,7 +176,7 @@ async def limits(self: UserClientAsync) -> dict | None: return None async def update_limits( - self: UserClientAsync, + self, *, max_monthly_usage_usd: int | None = None, data_retention_days: int | None = None, diff --git a/src/apify_client/clients/resource_clients/webhook.py b/src/apify_client/clients/resource_clients/webhook.py index c2f8bcde..4fa8506e 100644 --- a/src/apify_client/clients/resource_clients/webhook.py +++ b/src/apify_client/clients/resource_clients/webhook.py @@ -61,12 +61,12 @@ class WebhookClient(ResourceClient): """Sub-client for manipulating a single webhook.""" @ignore_docs - def __init__(self: WebhookClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookClient.""" resource_path = kwargs.pop('resource_path', 'webhooks') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: WebhookClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the webhook. https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/get-webhook @@ -77,7 +77,7 @@ def get(self: WebhookClient) -> dict | None: return self._get() def update( - self: WebhookClient, + self, *, event_types: list[WebhookEventType] | None = None, request_url: str | None = None, @@ -126,14 +126,14 @@ def update( return self._update(filter_out_none_values_recursively(webhook_representation)) - def delete(self: WebhookClient) -> None: + def delete(self) -> None: """Delete the webhook. https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/delete-webhook """ return self._delete() - def test(self: WebhookClient) -> dict | None: + def test(self) -> dict | None: """Test a webhook. Creates a webhook dispatch with a dummy payload. @@ -157,7 +157,7 @@ def test(self: WebhookClient) -> dict | None: return None - def dispatches(self: WebhookClient) -> WebhookDispatchCollectionClient: + def dispatches(self) -> WebhookDispatchCollectionClient: """Get dispatches of the webhook. https://docs.apify.com/api/v2#/reference/webhooks/dispatches-collection/get-collection @@ -174,12 +174,12 @@ class WebhookClientAsync(ResourceClientAsync): """Async sub-client for manipulating a single webhook.""" @ignore_docs - def __init__(self: WebhookClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookClientAsync.""" resource_path = kwargs.pop('resource_path', 'webhooks') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: WebhookClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the webhook. https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/get-webhook @@ -190,7 +190,7 @@ async def get(self: WebhookClientAsync) -> dict | None: return await self._get() async def update( - self: WebhookClientAsync, + self, *, event_types: list[WebhookEventType] | None = None, request_url: str | None = None, @@ -239,14 +239,14 @@ async def update( return await self._update(filter_out_none_values_recursively(webhook_representation)) - async def delete(self: WebhookClientAsync) -> None: + async def delete(self) -> None: """Delete the webhook. https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/delete-webhook """ return await self._delete() - async def test(self: WebhookClientAsync) -> dict | None: + async def test(self) -> dict | None: """Test a webhook. Creates a webhook dispatch with a dummy payload. @@ -270,7 +270,7 @@ async def test(self: WebhookClientAsync) -> dict | None: return None - def dispatches(self: WebhookClientAsync) -> WebhookDispatchCollectionClientAsync: + def dispatches(self) -> WebhookDispatchCollectionClientAsync: """Get dispatches of the webhook. https://docs.apify.com/api/v2#/reference/webhooks/dispatches-collection/get-collection diff --git a/src/apify_client/clients/resource_clients/webhook_collection.py b/src/apify_client/clients/resource_clients/webhook_collection.py index 47d5c9f1..451e73fd 100644 --- a/src/apify_client/clients/resource_clients/webhook_collection.py +++ b/src/apify_client/clients/resource_clients/webhook_collection.py @@ -16,13 +16,13 @@ class WebhookCollectionClient(ResourceCollectionClient): """Sub-client for manipulating webhooks.""" @ignore_docs - def __init__(self: WebhookCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookCollectionClient.""" resource_path = kwargs.pop('resource_path', 'webhooks') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: WebhookCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -43,7 +43,7 @@ def list( return self._list(limit=limit, offset=offset, desc=desc) def create( - self: WebhookCollectionClient, + self, *, event_types: list[WebhookEventType], # type: ignore[valid-type] request_url: str, @@ -103,13 +103,13 @@ class WebhookCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for manipulating webhooks.""" @ignore_docs - def __init__(self: WebhookCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'webhooks') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: WebhookCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, @@ -130,7 +130,7 @@ async def list( return await self._list(limit=limit, offset=offset, desc=desc) async def create( - self: WebhookCollectionClientAsync, + self, *, event_types: list[WebhookEventType], # type: ignore[valid-type] request_url: str, diff --git a/src/apify_client/clients/resource_clients/webhook_dispatch.py b/src/apify_client/clients/resource_clients/webhook_dispatch.py index 9877ce41..ce5bf83b 100644 --- a/src/apify_client/clients/resource_clients/webhook_dispatch.py +++ b/src/apify_client/clients/resource_clients/webhook_dispatch.py @@ -11,12 +11,12 @@ class WebhookDispatchClient(ResourceClient): """Sub-client for querying information about a webhook dispatch.""" @ignore_docs - def __init__(self: WebhookDispatchClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookDispatchClient.""" resource_path = kwargs.pop('resource_path', 'webhook-dispatches') super().__init__(*args, resource_path=resource_path, **kwargs) - def get(self: WebhookDispatchClient) -> dict | None: + def get(self) -> dict | None: """Retrieve the webhook dispatch. https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatch-object/get-webhook-dispatch @@ -31,12 +31,12 @@ class WebhookDispatchClientAsync(ResourceClientAsync): """Async sub-client for querying information about a webhook dispatch.""" @ignore_docs - def __init__(self: WebhookDispatchClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookDispatchClientAsync.""" resource_path = kwargs.pop('resource_path', 'webhook-dispatches') super().__init__(*args, resource_path=resource_path, **kwargs) - async def get(self: WebhookDispatchClientAsync) -> dict | None: + async def get(self) -> dict | None: """Retrieve the webhook dispatch. https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatch-object/get-webhook-dispatch diff --git a/src/apify_client/clients/resource_clients/webhook_dispatch_collection.py b/src/apify_client/clients/resource_clients/webhook_dispatch_collection.py index b7747856..3afad78e 100644 --- a/src/apify_client/clients/resource_clients/webhook_dispatch_collection.py +++ b/src/apify_client/clients/resource_clients/webhook_dispatch_collection.py @@ -14,13 +14,13 @@ class WebhookDispatchCollectionClient(ResourceCollectionClient): """Sub-client for listing webhook dispatches.""" @ignore_docs - def __init__(self: WebhookDispatchCollectionClient, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookDispatchCollectionClient.""" resource_path = kwargs.pop('resource_path', 'webhook-dispatches') super().__init__(*args, resource_path=resource_path, **kwargs) def list( - self: WebhookDispatchCollectionClient, + self, *, limit: int | None = None, offset: int | None = None, @@ -45,13 +45,13 @@ class WebhookDispatchCollectionClientAsync(ResourceCollectionClientAsync): """Async sub-client for listing webhook dispatches.""" @ignore_docs - def __init__(self: WebhookDispatchCollectionClientAsync, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the WebhookDispatchCollectionClientAsync.""" resource_path = kwargs.pop('resource_path', 'webhook-dispatches') super().__init__(*args, resource_path=resource_path, **kwargs) async def list( - self: WebhookDispatchCollectionClientAsync, + self, *, limit: int | None = None, offset: int | None = None, diff --git a/tests/integration/test_basic.py b/tests/integration/test_basic.py index 2d2fb346..b8eec5f4 100644 --- a/tests/integration/test_basic.py +++ b/tests/integration/test_basic.py @@ -7,7 +7,7 @@ class TestBasicSync: - def test_basic(self: TestBasicSync, apify_client: ApifyClient) -> None: + def test_basic(self, apify_client: ApifyClient) -> None: me = apify_client.user('me').get() assert me is not None assert me.get('id') is not None @@ -15,7 +15,7 @@ def test_basic(self: TestBasicSync, apify_client: ApifyClient) -> None: class TestBasicAsync: - async def test_basic(self: TestBasicAsync, apify_client_async: ApifyClientAsync) -> None: + async def test_basic(self, apify_client_async: ApifyClientAsync) -> None: me = await apify_client_async.user('me').get() assert me is not None assert me.get('id') is not None diff --git a/tests/integration/test_request_queue.py b/tests/integration/test_request_queue.py index 4a27e8ac..029d3234 100644 --- a/tests/integration/test_request_queue.py +++ b/tests/integration/test_request_queue.py @@ -17,7 +17,7 @@ def random_queue_name() -> str: class TestRequestQueueSync: - def test_request_queue_lock(self: TestRequestQueueSync, apify_client: ApifyClient) -> None: + def test_request_queue_lock(self, apify_client: ApifyClient) -> None: created_queue = apify_client.request_queues().get_or_create(name=random_queue_name()) queue = apify_client.request_queue(created_queue['id'], client_key=random_string(10)) @@ -45,7 +45,7 @@ def test_request_queue_lock(self: TestRequestQueueSync, apify_client: ApifyClien queue.delete() assert apify_client.request_queue(created_queue['id']).get() is None - def test_request_batch_operations(self: TestRequestQueueSync, apify_client: ApifyClient) -> None: + def test_request_batch_operations(self, apify_client: ApifyClient) -> None: created_queue = apify_client.request_queues().get_or_create(name=random_queue_name()) queue = apify_client.request_queue(created_queue['id']) @@ -66,7 +66,7 @@ def test_request_batch_operations(self: TestRequestQueueSync, apify_client: Apif class TestRequestQueueAsync: - async def test_request_queue_lock(self: TestRequestQueueAsync, apify_client_async: ApifyClientAsync) -> None: + async def test_request_queue_lock(self, apify_client_async: ApifyClientAsync) -> None: created_queue = await apify_client_async.request_queues().get_or_create(name=random_queue_name()) queue = apify_client_async.request_queue(created_queue['id'], client_key=random_string(10)) @@ -95,7 +95,7 @@ async def test_request_queue_lock(self: TestRequestQueueAsync, apify_client_asyn await queue.delete() assert await apify_client_async.request_queue(created_queue['id']).get() is None - async def test_request_batch_operations(self: TestRequestQueueAsync, apify_client_async: ApifyClientAsync) -> None: + async def test_request_batch_operations(self, apify_client_async: ApifyClientAsync) -> None: created_queue = await apify_client_async.request_queues().get_or_create(name=random_queue_name()) queue = apify_client_async.request_queue(created_queue['id']) diff --git a/tests/integration/test_store.py b/tests/integration/test_store.py index fdf24123..fa2ce27b 100644 --- a/tests/integration/test_store.py +++ b/tests/integration/test_store.py @@ -7,14 +7,14 @@ class TestStoreCollectionSync: - def test_list(self: TestStoreCollectionSync, apify_client: ApifyClient) -> None: + def test_list(self, apify_client: ApifyClient) -> None: actors_list = apify_client.store().list() assert actors_list is not None assert len(actors_list.items) != 0 class TestStoreCollectionAsync: - async def test_list(self: TestStoreCollectionAsync, apify_client_async: ApifyClientAsync) -> None: + async def test_list(self, apify_client_async: ApifyClientAsync) -> None: actors_list = await apify_client_async.store().list() assert actors_list is not None assert len(actors_list.items) != 0