Skip to content

Commit 81b7b42

Browse files
committed
Address comments
1 parent 6764f59 commit 81b7b42

38 files changed

+280
-229
lines changed

src/apify_client/_apify_client.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,8 @@
5353
ScheduleClientAsync,
5454
ScheduleCollectionClient,
5555
ScheduleCollectionClientAsync,
56-
StatusMessageWatcherAsync,
57-
StatusMessageWatcherSync,
5856
StoreCollectionClient,
5957
StoreCollectionClientAsync,
60-
StreamedLogAsync,
61-
StreamedLogSync,
6258
TaskClient,
6359
TaskClientAsync,
6460
TaskCollectionClient,
@@ -181,8 +177,6 @@ def __init__(
181177
key_value_store_client=KeyValueStoreClient,
182178
key_value_store_collection_client=KeyValueStoreCollectionClient,
183179
log_client=LogClient,
184-
status_message_watcher=StatusMessageWatcherSync,
185-
streamed_log=StreamedLogSync,
186180
request_queue_client=RequestQueueClient,
187181
request_queue_collection_client=RequestQueueCollectionClient,
188182
run_client=RunClient,
@@ -386,6 +380,7 @@ class ApifyClientAsync:
386380
387381
from apify_client import ApifyClientAsync
388382
383+
389384
async def main() -> None:
390385
client = ApifyClientAsync(token='MY-APIFY-TOKEN')
391386
@@ -400,6 +395,7 @@ async def main() -> None:
400395
for item in items:
401396
print(item)
402397
398+
403399
asyncio.run(main())
404400
```
405401
"""
@@ -475,8 +471,6 @@ def __init__(
475471
key_value_store_client=KeyValueStoreClientAsync,
476472
key_value_store_collection_client=KeyValueStoreCollectionClientAsync,
477473
log_client=LogClientAsync,
478-
status_message_watcher=StatusMessageWatcherAsync,
479-
streamed_log=StreamedLogAsync,
480474
request_queue_client=RequestQueueClientAsync,
481475
request_queue_collection_client=RequestQueueCollectionClientAsync,
482476
run_client=RunClientAsync,

src/apify_client/_client_registry.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@
4343
ScheduleClientAsync,
4444
ScheduleCollectionClient,
4545
ScheduleCollectionClientAsync,
46-
StatusMessageWatcherAsync,
47-
StatusMessageWatcherSync,
4846
StoreCollectionClient,
4947
StoreCollectionClientAsync,
50-
StreamedLogAsync,
51-
StreamedLogSync,
5248
TaskClient,
5349
TaskClientAsync,
5450
TaskCollectionClient,
@@ -87,8 +83,6 @@ class ClientRegistry:
8783
key_value_store_client: type[KeyValueStoreClient]
8884
key_value_store_collection_client: type[KeyValueStoreCollectionClient]
8985
log_client: type[LogClient]
90-
status_message_watcher: type[StatusMessageWatcherSync]
91-
streamed_log: type[StreamedLogSync]
9286
request_queue_client: type[RequestQueueClient]
9387
request_queue_collection_client: type[RequestQueueCollectionClient]
9488
run_client: type[RunClient]
@@ -126,8 +120,6 @@ class ClientRegistryAsync:
126120
key_value_store_client: type[KeyValueStoreClientAsync]
127121
key_value_store_collection_client: type[KeyValueStoreCollectionClientAsync]
128122
log_client: type[LogClientAsync]
129-
status_message_watcher: type[StatusMessageWatcherAsync]
130-
streamed_log: type[StreamedLogAsync]
131123
request_queue_client: type[RequestQueueClientAsync]
132124
request_queue_collection_client: type[RequestQueueCollectionClientAsync]
133125
run_client: type[RunClientAsync]

src/apify_client/_docs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
from collections.abc import Callable
44
from typing import Any, Literal, TypeVar
55

6-
# The order of the rendered API groups is defined in the website/docusaurus.config.js file.
6+
# The order of the rendered API groups is defined by GROUP_ORDER in website/transformDocs.js
7+
# and applied via groupSort in website/docusaurus.config.js.
78
GroupName = Literal[
89
'Apify API clients',
9-
'Resource clients',
1010
'HTTP clients',
11-
'Models',
11+
'Resource clients',
1212
'Errors',
13+
'Models',
14+
'Other',
1315
]
1416

1517
T = TypeVar('T', bound=Callable[..., Any])

src/apify_client/_resource_clients/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
from .run_collection import RunCollectionClient, RunCollectionClientAsync
1818
from .schedule import ScheduleClient, ScheduleClientAsync
1919
from .schedule_collection import ScheduleCollectionClient, ScheduleCollectionClientAsync
20-
from .status_message_watcher import StatusMessageWatcher, StatusMessageWatcherAsync, StatusMessageWatcherSync
2120
from .store_collection import StoreCollectionClient, StoreCollectionClientAsync
22-
from .streamed_log import StreamedLog, StreamedLogAsync, StreamedLogSync
2321
from .task import TaskClient, TaskClientAsync
2422
from .task_collection import TaskCollectionClient, TaskCollectionClientAsync
2523
from .user import UserClient, UserClientAsync
@@ -67,14 +65,8 @@
6765
'ScheduleClientAsync',
6866
'ScheduleCollectionClient',
6967
'ScheduleCollectionClientAsync',
70-
'StatusMessageWatcher',
71-
'StatusMessageWatcherAsync',
72-
'StatusMessageWatcherSync',
7368
'StoreCollectionClient',
7469
'StoreCollectionClientAsync',
75-
'StreamedLog',
76-
'StreamedLogAsync',
77-
'StreamedLogSync',
7870
'TaskClient',
7971
'TaskClientAsync',
8072
'TaskCollectionClient',

src/apify_client/_resource_clients/_resource_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import TYPE_CHECKING, Any
88

99
from apify_client._consts import DEFAULT_WAIT_FOR_FINISH, DEFAULT_WAIT_WHEN_JOB_NOT_EXIST, TERMINAL_STATUSES
10+
from apify_client._docs import docs_group
1011
from apify_client._internal_models import ActorJobResponse
1112
from apify_client._logging import WithLogDetailsClient
1213
from apify_client._utils import catch_not_found_or_throw, response_to_dict, to_safe_id, to_seconds
@@ -120,6 +121,7 @@ def _build_params(self, **kwargs: Any) -> dict:
120121
return {k: v for k, v in merged.items() if v is not None}
121122

122123

124+
@docs_group('Resource clients')
123125
class ResourceClient(ResourceClientBase):
124126
"""Base class for synchronous resource clients."""
125127

@@ -286,6 +288,7 @@ def _wait_for_finish(
286288
return actor_job
287289

288290

291+
@docs_group('Resource clients')
289292
class ResourceClientAsync(ResourceClientBase):
290293
"""Base class for asynchronous resource clients."""
291294

src/apify_client/_resource_clients/actor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
class ActorClient(ResourceClient):
5353
"""Sub-client for managing a specific Actor.
5454
55-
Provides methods to get, update, delete, build, and start runs of an Actor.
56-
Obtain an instance via `ApifyClient.actor`.
55+
Provides methods to manage a specific Actor, e.g. update it, delete it, build it, or start runs. Obtain an instance
56+
via an appropriate method on the `ApifyClient` class.
5757
"""
5858

5959
def __init__(
@@ -516,8 +516,8 @@ def validate_input(
516516
class ActorClientAsync(ResourceClientAsync):
517517
"""Sub-client for managing a specific Actor.
518518
519-
Provides methods to get, update, delete, build, and start runs of an Actor.
520-
Obtain an instance via `ApifyClientAsync.actor`.
519+
Provides methods to manage a specific Actor, e.g. update it, delete it, build it, or start runs. Obtain an instance
520+
via an appropriate method on the `ApifyClientAsync` class.
521521
"""
522522

523523
def __init__(

src/apify_client/_resource_clients/actor_collection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
class ActorCollectionClient(ResourceClient):
1717
"""Sub-client for the Actor collection.
1818
19-
Provides methods to list and create Actors. Obtain an instance via `ApifyClient.actors`.
19+
Provides methods to manage the Actor collection, e.g. list or create Actors. Obtain an instance via an appropriate
20+
method on the `ApifyClient` class.
2021
"""
2122

2223
def __init__(self, *args: Any, **kwargs: Any) -> None:
@@ -147,7 +148,8 @@ def create(
147148
class ActorCollectionClientAsync(ResourceClientAsync):
148149
"""Sub-client for the Actor collection.
149150
150-
Provides methods to list and create Actors. Obtain an instance via `ApifyClientAsync.actors`.
151+
Provides methods to manage the Actor collection, e.g. list or create Actors. Obtain an instance via an appropriate
152+
method on the `ApifyClientAsync` class.
151153
"""
152154

153155
def __init__(self, *args: Any, **kwargs: Any) -> None:

src/apify_client/_resource_clients/actor_env_var.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def get_actor_env_var_representation(
2626
class ActorEnvVarClient(ResourceClient):
2727
"""Sub-client for managing a specific Actor environment variable.
2828
29-
Provides methods to get, update, and delete an environment variable.
30-
Obtain an instance via `ActorVersionClient.env_var`.
29+
Provides methods to manage a specific Actor environment variable, e.g. get, update, or delete it. Obtain an instance
30+
via an appropriate method on the `ActorVersionClient` class.
3131
"""
3232

3333
def __init__(self, *args: Any, **kwargs: Any) -> None:
@@ -87,8 +87,8 @@ def delete(self) -> None:
8787
class ActorEnvVarClientAsync(ResourceClientAsync):
8888
"""Sub-client for managing a specific Actor environment variable.
8989
90-
Provides methods to get, update, and delete an environment variable.
91-
Obtain an instance via `ActorVersionClientAsync.env_var`.
90+
Provides methods to manage a specific Actor environment variable, e.g. get, update, or delete it. Obtain an instance
91+
via an appropriate method on the `ActorVersionClientAsync` class.
9292
"""
9393

9494
def __init__(self, *args: Any, **kwargs: Any) -> None:

src/apify_client/_resource_clients/actor_env_var_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
class ActorEnvVarCollectionClient(ResourceClient):
1414
"""Sub-client for the Actor environment variable collection.
1515
16-
Provides methods to list and create environment variables.
17-
Obtain an instance via `ActorVersionClient.env_vars`.
16+
Provides methods to manage Actor environment variables, e.g. list or create them. Obtain an instance via an
17+
appropriate method on the `ActorVersionClient` class.
1818
"""
1919

2020
def __init__(self, *args: Any, **kwargs: Any) -> None:
@@ -65,8 +65,8 @@ def create(
6565
class ActorEnvVarCollectionClientAsync(ResourceClientAsync):
6666
"""Sub-client for the Actor environment variable collection.
6767
68-
Provides methods to list and create environment variables.
69-
Obtain an instance via `ActorVersionClientAsync.env_vars`.
68+
Provides methods to manage Actor environment variables, e.g. list or create them. Obtain an instance via an
69+
appropriate method on the `ActorVersionClientAsync` class.
7070
"""
7171

7272
def __init__(self, *args: Any, **kwargs: Any) -> None:

src/apify_client/_resource_clients/actor_version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
class ActorVersionClient(ResourceClient):
2222
"""Sub-client for managing a specific Actor version.
2323
24-
Provides methods to get, update, and delete an Actor version.
25-
Obtain an instance via `ActorClient.version`.
24+
Provides methods to manage a specific Actor version, e.g. get, update, or delete it. Obtain an instance via an
25+
appropriate method on the `ActorClient` class.
2626
"""
2727

2828
def __init__(
@@ -131,8 +131,8 @@ def env_var(self, env_var_name: str) -> ActorEnvVarClient:
131131
class ActorVersionClientAsync(ResourceClientAsync):
132132
"""Sub-client for managing a specific Actor version.
133133
134-
Provides methods to get, update, and delete an Actor version.
135-
Obtain an instance via `ActorClientAsync.version`.
134+
Provides methods to manage a specific Actor version, e.g. get, update, or delete it. Obtain an instance via an
135+
appropriate method on the `ActorClientAsync` class.
136136
"""
137137

138138
def __init__(

0 commit comments

Comments
 (0)