Skip to content
Merged
Changes from 1 commit
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
24 changes: 24 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,18 @@ 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) -> dict:
"""Retrieve Actor's default build.

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

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.
"""
response = self.http_client.call(url=self._url('builds/default'), method='GET')

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

def last_run(
self,
*,
Expand Down Expand Up @@ -718,6 +730,18 @@ 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) -> dict:
"""Retrieve Actor's default build.

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

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.
"""
response = await self.http_client.call(url=self._url('builds/default'), method='GET')

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

def last_run(
self,
*,
Expand Down