|
5 | 5 | from apify_shared.utils import ignore_docs
|
6 | 6 |
|
7 | 7 | from apify_client.clients.base import ActorJobBaseClient, ActorJobBaseClientAsync
|
| 8 | +from apify_client.clients.resource_clients.log import LogClient, LogClientAsync |
8 | 9 |
|
9 | 10 |
|
10 | 11 | class BuildClient(ActorJobBaseClient):
|
@@ -55,6 +56,18 @@ def wait_for_finish(self: BuildClient, *, wait_secs: int | None = None) -> dict
|
55 | 56 | """
|
56 | 57 | return self._wait_for_finish(wait_secs=wait_secs)
|
57 | 58 |
|
| 59 | + def log(self: BuildClient) -> LogClient: |
| 60 | + """Get the client for the log of the actor build. |
| 61 | +
|
| 62 | + https://docs.apify.com/api/v2/#/reference/actor-builds/build-log/get-log |
| 63 | +
|
| 64 | + Returns: |
| 65 | + LogClient: A client allowing access to the log of this actor build. |
| 66 | + """ |
| 67 | + return LogClient( |
| 68 | + **self._sub_resource_init_options(resource_path='log'), |
| 69 | + ) |
| 70 | + |
58 | 71 |
|
59 | 72 | class BuildClientAsync(ActorJobBaseClientAsync):
|
60 | 73 | """Async sub-client for manipulating a single actor build."""
|
@@ -103,3 +116,15 @@ async def wait_for_finish(self: BuildClientAsync, *, wait_secs: int | None = Non
|
103 | 116 | (SUCEEDED, FAILED, TIMED_OUT, ABORTED), then the build has not yet finished.
|
104 | 117 | """
|
105 | 118 | return await self._wait_for_finish(wait_secs=wait_secs)
|
| 119 | + |
| 120 | + def log(self: BuildClientAsync) -> LogClientAsync: |
| 121 | + """Get the client for the log of the actor build. |
| 122 | +
|
| 123 | + https://docs.apify.com/api/v2/#/reference/actor-builds/build-log/get-log |
| 124 | +
|
| 125 | + Returns: |
| 126 | + LogClientAsync: A client allowing access to the log of this actor build. |
| 127 | + """ |
| 128 | + return LogClientAsync( |
| 129 | + **self._sub_resource_init_options(resource_path='log'), |
| 130 | + ) |
0 commit comments