Skip to content

Commit aabb3a5

Browse files
committed
feat: add get default build method
1 parent 3059a17 commit aabb3a5

File tree

1 file changed

+24
-0
lines changed
  • src/apify_client/clients/resource_clients

1 file changed

+24
-0
lines changed

src/apify_client/clients/resource_clients/actor.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,18 @@ def runs(self) -> RunCollectionClient:
381381
"""Retrieve a client for the runs of this Actor."""
382382
return RunCollectionClient(**self._sub_resource_init_options(resource_path='runs'))
383383

384+
async def default_build(self) -> dict:
385+
"""Retrieve Actor's default build.
386+
387+
https://docs.apify.com/api/v2/act-build-default-get
388+
389+
Returns:
390+
The build object.
391+
"""
392+
response = self.http_client.call(url=self._url('builds/default'), method='GET')
393+
394+
return parse_date_fields(pluck_data(response.json()))
395+
384396
def last_run(
385397
self,
386398
*,
@@ -718,6 +730,18 @@ def runs(self) -> RunCollectionClientAsync:
718730
"""Retrieve a client for the runs of this Actor."""
719731
return RunCollectionClientAsync(**self._sub_resource_init_options(resource_path='runs'))
720732

733+
async def default_build(self) -> dict:
734+
"""Retrieve Actor's default build.
735+
736+
https://docs.apify.com/api/v2/act-build-default-get
737+
738+
Returns:
739+
The build object.
740+
"""
741+
response = await self.http_client.call(url=self._url('builds/default'), method='GET')
742+
743+
return parse_date_fields(pluck_data(response.json()))
744+
721745
def last_run(
722746
self,
723747
*,

0 commit comments

Comments
 (0)