25
25
)
26
26
27
27
if TYPE_CHECKING :
28
+ from decimal import Decimal
29
+
28
30
from apify_shared .consts import ActorJobStatus , MetaOrigin
29
31
30
32
@@ -53,6 +55,7 @@ def get_actor_representation(
53
55
actor_standby_idle_timeout_secs : int | None = None ,
54
56
actor_standby_build : str | None = None ,
55
57
actor_standby_memory_mbytes : int | None = None ,
58
+ pricing_infos : list [dict ] | None = None ,
56
59
) -> dict :
57
60
"""Get dictionary representation of the Actor."""
58
61
return {
@@ -85,6 +88,7 @@ def get_actor_representation(
85
88
'build' : actor_standby_build ,
86
89
'memoryMbytes' : actor_standby_memory_mbytes ,
87
90
},
91
+ 'pricingInfos' : pricing_infos ,
88
92
}
89
93
90
94
@@ -132,6 +136,7 @@ def update(
132
136
actor_standby_idle_timeout_secs : int | None = None ,
133
137
actor_standby_build : str | None = None ,
134
138
actor_standby_memory_mbytes : int | None = None ,
139
+ pricing_infos : list [dict ] | None = None ,
135
140
) -> dict :
136
141
"""Update the Actor with the specified fields.
137
142
@@ -166,6 +171,7 @@ def update(
166
171
it will be shut down.
167
172
actor_standby_build: The build tag or number to run when the Actor is in Standby mode.
168
173
actor_standby_memory_mbytes: The memory in megabytes to use when the Actor is in Standby mode.
174
+ pricing_infos: A list of objects that describes the pricing of the Actor.
169
175
170
176
Returns:
171
177
The updated Actor.
@@ -194,6 +200,7 @@ def update(
194
200
actor_standby_idle_timeout_secs = actor_standby_idle_timeout_secs ,
195
201
actor_standby_build = actor_standby_build ,
196
202
actor_standby_memory_mbytes = actor_standby_memory_mbytes ,
203
+ pricing_infos = pricing_infos ,
197
204
)
198
205
199
206
return self ._update (filter_out_none_values_recursively (actor_representation ))
@@ -212,6 +219,7 @@ def start(
212
219
content_type : str | None = None ,
213
220
build : str | None = None ,
214
221
max_items : int | None = None ,
222
+ max_total_charge_usd : Decimal | None = None ,
215
223
memory_mbytes : int | None = None ,
216
224
timeout_secs : int | None = None ,
217
225
wait_for_finish : int | None = None ,
@@ -228,6 +236,7 @@ def start(
228
236
the run uses the build specified in the default run configuration for the Actor (typically latest).
229
237
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
230
238
per result, you will not be charged for more results than the given limit.
239
+ max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
231
240
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
232
241
specified in the default run configuration for the Actor.
233
242
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -250,6 +259,7 @@ def start(
250
259
request_params = self ._params (
251
260
build = build ,
252
261
maxItems = max_items ,
262
+ maxTotalChargeUsd = max_total_charge_usd ,
253
263
memory = memory_mbytes ,
254
264
timeout = timeout_secs ,
255
265
waitForFinish = wait_for_finish ,
@@ -273,6 +283,7 @@ def call(
273
283
content_type : str | None = None ,
274
284
build : str | None = None ,
275
285
max_items : int | None = None ,
286
+ max_total_charge_usd : Decimal | None = None ,
276
287
memory_mbytes : int | None = None ,
277
288
timeout_secs : int | None = None ,
278
289
webhooks : list [dict ] | None = None ,
@@ -291,6 +302,7 @@ def call(
291
302
the run uses the build specified in the default run configuration for the Actor (typically latest).
292
303
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
293
304
per result, you will not be charged for more results than the given limit.
305
+ max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
294
306
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
295
307
specified in the default run configuration for the Actor.
296
308
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -309,6 +321,7 @@ def call(
309
321
content_type = content_type ,
310
322
build = build ,
311
323
max_items = max_items ,
324
+ max_total_charge_usd = max_total_charge_usd ,
312
325
memory_mbytes = memory_mbytes ,
313
326
timeout_secs = timeout_secs ,
314
327
webhooks = webhooks ,
@@ -460,6 +473,7 @@ async def update(
460
473
actor_standby_idle_timeout_secs : int | None = None ,
461
474
actor_standby_build : str | None = None ,
462
475
actor_standby_memory_mbytes : int | None = None ,
476
+ pricing_infos : list [dict ] | None = None ,
463
477
) -> dict :
464
478
"""Update the Actor with the specified fields.
465
479
@@ -494,6 +508,7 @@ async def update(
494
508
it will be shut down.
495
509
actor_standby_build: The build tag or number to run when the Actor is in Standby mode.
496
510
actor_standby_memory_mbytes: The memory in megabytes to use when the Actor is in Standby mode.
511
+ pricing_infos: A list of objects that describes the pricing of the Actor.
497
512
498
513
Returns:
499
514
The updated Actor.
@@ -522,6 +537,7 @@ async def update(
522
537
actor_standby_idle_timeout_secs = actor_standby_idle_timeout_secs ,
523
538
actor_standby_build = actor_standby_build ,
524
539
actor_standby_memory_mbytes = actor_standby_memory_mbytes ,
540
+ pricing_infos = pricing_infos ,
525
541
)
526
542
527
543
return await self ._update (filter_out_none_values_recursively (actor_representation ))
@@ -540,6 +556,7 @@ async def start(
540
556
content_type : str | None = None ,
541
557
build : str | None = None ,
542
558
max_items : int | None = None ,
559
+ max_total_charge_usd : Decimal | None = None ,
543
560
memory_mbytes : int | None = None ,
544
561
timeout_secs : int | None = None ,
545
562
wait_for_finish : int | None = None ,
@@ -556,6 +573,7 @@ async def start(
556
573
the run uses the build specified in the default run configuration for the Actor (typically latest).
557
574
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
558
575
per result, you will not be charged for more results than the given limit.
576
+ max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
559
577
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
560
578
specified in the default run configuration for the Actor.
561
579
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -578,6 +596,7 @@ async def start(
578
596
request_params = self ._params (
579
597
build = build ,
580
598
maxItems = max_items ,
599
+ maxTotalChargeUsd = max_total_charge_usd ,
581
600
memory = memory_mbytes ,
582
601
timeout = timeout_secs ,
583
602
waitForFinish = wait_for_finish ,
@@ -601,6 +620,7 @@ async def call(
601
620
content_type : str | None = None ,
602
621
build : str | None = None ,
603
622
max_items : int | None = None ,
623
+ max_total_charge_usd : Decimal | None = None ,
604
624
memory_mbytes : int | None = None ,
605
625
timeout_secs : int | None = None ,
606
626
webhooks : list [dict ] | None = None ,
@@ -619,6 +639,7 @@ async def call(
619
639
the run uses the build specified in the default run configuration for the Actor (typically latest).
620
640
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
621
641
per result, you will not be charged for more results than the given limit.
642
+ max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
622
643
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
623
644
specified in the default run configuration for the Actor.
624
645
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -637,6 +658,7 @@ async def call(
637
658
content_type = content_type ,
638
659
build = build ,
639
660
max_items = max_items ,
661
+ max_total_charge_usd = max_total_charge_usd ,
640
662
memory_mbytes = memory_mbytes ,
641
663
timeout_secs = timeout_secs ,
642
664
webhooks = webhooks ,
0 commit comments