Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/apify_client/clients/resource_clients/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,30 @@ def runs(self) -> RunCollectionClient:
"""Retrieve a client for the runs of this Actor."""
return RunCollectionClient(**self._sub_resource_init_options(resource_path='runs'))

async def default_build(
self,
*,
wait_for_finish: int | None = None,
) -> dict:
"""Retrieve Actor's default build.

https://docs.apify.com/api/v2/act-build-default-get

Args:
wait_for_finish: The maximum number of seconds the server waits for the build to finish before returning.
By default it is 0, the maximum value is 60.

Returns:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build object.
"""
request_params = self._params(
waitForFinish=wait_for_finish,
)

response = self.http_client.call(url=self._url('builds/default'), method='GET', params=request_params)

return parse_date_fields(pluck_data(response.json()))

def last_run(
self,
*,
Expand Down Expand Up @@ -718,6 +742,34 @@ def runs(self) -> RunCollectionClientAsync:
"""Retrieve a client for the runs of this Actor."""
return RunCollectionClientAsync(**self._sub_resource_init_options(resource_path='runs'))

async def default_build(
self,
*,
wait_for_finish: int | None = None,
) -> dict:
"""Retrieve Actor's default build.

https://docs.apify.com/api/v2/act-build-default-get

Args:
wait_for_finish: The maximum number of seconds the server waits for the build to finish before returning.
By default it is 0, the maximum value is 60.

Returns:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

The build object.
"""
request_params = self._params(
waitForFinish=wait_for_finish,
)

response = await self.http_client.call(
url=self._url('builds/default'),
method='GET',
params=request_params,
)

return parse_date_fields(pluck_data(response.json()))

def last_run(
self,
*,
Expand Down