16
16
ActorVersionCollectionClient ,
17
17
ActorVersionCollectionClientAsync ,
18
18
)
19
+ from apify_client .clients .resource_clients .build import BuildClient , BuildClientAsync
19
20
from apify_client .clients .resource_clients .build_collection import BuildCollectionClient , BuildCollectionClientAsync
20
21
from apify_client .clients .resource_clients .run import RunClient , RunClientAsync
21
22
from apify_client .clients .resource_clients .run_collection import RunCollectionClient , RunCollectionClientAsync
@@ -385,7 +386,7 @@ async def default_build(
385
386
self ,
386
387
* ,
387
388
wait_for_finish : int | None = None ,
388
- ) -> dict :
389
+ ) -> BuildClient :
389
390
"""Retrieve Actor's default build.
390
391
391
392
https://docs.apify.com/api/v2/act-build-default-get
@@ -395,15 +396,21 @@ async def default_build(
395
396
By default it is 0, the maximum value is 60.
396
397
397
398
Returns:
398
- The build object .
399
+ The resource client for the default build of this Actor .
399
400
"""
400
401
request_params = self ._params (
401
402
waitForFinish = wait_for_finish ,
402
403
)
403
404
404
405
response = self .http_client .call (url = self ._url ('builds/default' ), method = 'GET' , params = request_params )
406
+ data = pluck_data (response .json ())
405
407
406
- return parse_date_fields (pluck_data (response .json ()))
408
+ return BuildClient (
409
+ base_url = self .base_url ,
410
+ http_client = self .http_client ,
411
+ root_client = self .root_client ,
412
+ resource_id = data ['id' ],
413
+ )
407
414
408
415
def last_run (
409
416
self ,
@@ -746,7 +753,7 @@ async def default_build(
746
753
self ,
747
754
* ,
748
755
wait_for_finish : int | None = None ,
749
- ) -> dict :
756
+ ) -> BuildClientAsync :
750
757
"""Retrieve Actor's default build.
751
758
752
759
https://docs.apify.com/api/v2/act-build-default-get
@@ -756,7 +763,7 @@ async def default_build(
756
763
By default it is 0, the maximum value is 60.
757
764
758
765
Returns:
759
- The build object .
766
+ The resource client for the default build of this Actor .
760
767
"""
761
768
request_params = self ._params (
762
769
waitForFinish = wait_for_finish ,
@@ -767,8 +774,14 @@ async def default_build(
767
774
method = 'GET' ,
768
775
params = request_params ,
769
776
)
777
+ data = pluck_data (response .json ())
770
778
771
- return parse_date_fields (pluck_data (response .json ()))
779
+ return BuildClientAsync (
780
+ base_url = self .base_url ,
781
+ http_client = self .http_client ,
782
+ root_client = self .root_client ,
783
+ resource_id = data ['id' ],
784
+ )
772
785
773
786
def last_run (
774
787
self ,
0 commit comments