30
30
from decimal import Decimal
31
31
from logging import Logger
32
32
33
- from apify_shared .consts import ActorJobStatus , MetaOrigin
33
+ from apify_shared .consts import ActorJobStatus , ActorPermissionLevel , MetaOrigin
34
34
35
35
36
36
def get_actor_representation (
@@ -50,6 +50,7 @@ def get_actor_representation(
50
50
default_run_max_items : int | None = None ,
51
51
default_run_memory_mbytes : int | None = None ,
52
52
default_run_timeout_secs : int | None = None ,
53
+ default_run_force_permission_level : ActorPermissionLevel | None = None ,
53
54
example_run_input_body : Any = None ,
54
55
example_run_input_content_type : str | None = None ,
55
56
actor_standby_is_enabled : bool | None = None ,
@@ -78,6 +79,7 @@ def get_actor_representation(
78
79
'maxItems' : default_run_max_items ,
79
80
'memoryMbytes' : default_run_memory_mbytes ,
80
81
'timeoutSecs' : default_run_timeout_secs ,
82
+ 'forcePermissionLevel' : default_run_force_permission_level ,
81
83
},
82
84
'exampleRunInput' : {
83
85
'body' : example_run_input_body ,
@@ -224,6 +226,7 @@ def start(
224
226
max_total_charge_usd : Decimal | None = None ,
225
227
memory_mbytes : int | None = None ,
226
228
timeout_secs : int | None = None ,
229
+ force_permission_level : ActorPermissionLevel | None = None ,
227
230
wait_for_finish : int | None = None ,
228
231
webhooks : list [dict ] | None = None ,
229
232
) -> dict :
@@ -243,6 +246,8 @@ def start(
243
246
specified in the default run configuration for the Actor.
244
247
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
245
248
in the default run configuration for the Actor.
249
+ force_permission_level: Override the Actor's permissions for this run. If not set, the Actor will run
250
+ with permissions configured in the Actor settings.
246
251
wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
247
252
it is 0, the maximum value is 60.
248
253
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
@@ -265,6 +270,7 @@ def start(
265
270
memory = memory_mbytes ,
266
271
timeout = timeout_secs ,
267
272
waitForFinish = wait_for_finish ,
273
+ forcePermissionLevel = force_permission_level .value if force_permission_level is not None else None ,
268
274
webhooks = encode_webhook_list_to_base64 (webhooks ) if webhooks is not None else None ,
269
275
)
270
276
@@ -289,6 +295,7 @@ def call(
289
295
memory_mbytes : int | None = None ,
290
296
timeout_secs : int | None = None ,
291
297
webhooks : list [dict ] | None = None ,
298
+ force_permission_level : ActorPermissionLevel | None = None ,
292
299
wait_secs : int | None = None ,
293
300
logger : Logger | None | Literal ['default' ] = 'default' ,
294
301
) -> dict | None :
@@ -310,6 +317,8 @@ def call(
310
317
specified in the default run configuration for the Actor.
311
318
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
312
319
in the default run configuration for the Actor.
320
+ force_permission_level: Override the Actor's permissions for this run. If not set, the Actor will run
321
+ with permissions configured in the Actor settings.
313
322
webhooks: Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, which can
314
323
be used to receive a notification, e.g. when the Actor finished or failed. If you already have
315
324
a webhook set up for the Actor, you do not have to add it again here.
@@ -332,6 +341,7 @@ def call(
332
341
memory_mbytes = memory_mbytes ,
333
342
timeout_secs = timeout_secs ,
334
343
webhooks = webhooks ,
344
+ force_permission_level = force_permission_level ,
335
345
)
336
346
if not logger :
337
347
return self .root_client .run (started_run ['id' ]).wait_for_finish (wait_secs = wait_secs )
@@ -628,6 +638,7 @@ async def start(
628
638
max_total_charge_usd : Decimal | None = None ,
629
639
memory_mbytes : int | None = None ,
630
640
timeout_secs : int | None = None ,
641
+ force_permission_level : ActorPermissionLevel | None = None ,
631
642
wait_for_finish : int | None = None ,
632
643
webhooks : list [dict ] | None = None ,
633
644
) -> dict :
@@ -647,6 +658,8 @@ async def start(
647
658
specified in the default run configuration for the Actor.
648
659
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
649
660
in the default run configuration for the Actor.
661
+ force_permission_level: Override the Actor's permissions for this run. If not set, the Actor will run
662
+ with permissions configured in the Actor settings.
650
663
wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
651
664
it is 0, the maximum value is 60.
652
665
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
@@ -669,6 +682,7 @@ async def start(
669
682
memory = memory_mbytes ,
670
683
timeout = timeout_secs ,
671
684
waitForFinish = wait_for_finish ,
685
+ forcePermissionLevel = force_permission_level ,
672
686
webhooks = encode_webhook_list_to_base64 (webhooks ) if webhooks is not None else None ,
673
687
)
674
688
@@ -693,6 +707,7 @@ async def call(
693
707
memory_mbytes : int | None = None ,
694
708
timeout_secs : int | None = None ,
695
709
webhooks : list [dict ] | None = None ,
710
+ force_permission_level : ActorPermissionLevel | None = None ,
696
711
wait_secs : int | None = None ,
697
712
logger : Logger | None | Literal ['default' ] = 'default' ,
698
713
) -> dict | None :
@@ -714,6 +729,8 @@ async def call(
714
729
specified in the default run configuration for the Actor.
715
730
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
716
731
in the default run configuration for the Actor.
732
+ force_permission_level: Override the Actor's permissions for this run. If not set, the Actor will run
733
+ with permissions configured in the Actor settings.
717
734
webhooks: Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, which can
718
735
be used to receive a notification, e.g. when the Actor finished or failed. If you already have
719
736
a webhook set up for the Actor, you do not have to add it again here.
@@ -736,6 +753,7 @@ async def call(
736
753
memory_mbytes = memory_mbytes ,
737
754
timeout_secs = timeout_secs ,
738
755
webhooks = webhooks ,
756
+ force_permission_level = force_permission_level ,
739
757
)
740
758
741
759
if not logger :
0 commit comments