Skip to content

Commit 75b1c6c

Browse files
authored
fix: Add missing PPE-related Actor parameters (#351)
1 parent d3378d1 commit 75b1c6c

File tree

1 file changed

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

1 file changed

+22
-0
lines changed

src/apify_client/clients/resource_clients/actor.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
)
2626

2727
if TYPE_CHECKING:
28+
from decimal import Decimal
29+
2830
from apify_shared.consts import ActorJobStatus, MetaOrigin
2931

3032

@@ -53,6 +55,7 @@ def get_actor_representation(
5355
actor_standby_idle_timeout_secs: int | None = None,
5456
actor_standby_build: str | None = None,
5557
actor_standby_memory_mbytes: int | None = None,
58+
pricing_infos: list[dict] | None = None,
5659
) -> dict:
5760
"""Get dictionary representation of the Actor."""
5861
return {
@@ -85,6 +88,7 @@ def get_actor_representation(
8588
'build': actor_standby_build,
8689
'memoryMbytes': actor_standby_memory_mbytes,
8790
},
91+
'pricingInfos': pricing_infos,
8892
}
8993

9094

@@ -132,6 +136,7 @@ def update(
132136
actor_standby_idle_timeout_secs: int | None = None,
133137
actor_standby_build: str | None = None,
134138
actor_standby_memory_mbytes: int | None = None,
139+
pricing_infos: list[dict] | None = None,
135140
) -> dict:
136141
"""Update the Actor with the specified fields.
137142
@@ -166,6 +171,7 @@ def update(
166171
it will be shut down.
167172
actor_standby_build: The build tag or number to run when the Actor is in Standby mode.
168173
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.
169175
170176
Returns:
171177
The updated Actor.
@@ -194,6 +200,7 @@ def update(
194200
actor_standby_idle_timeout_secs=actor_standby_idle_timeout_secs,
195201
actor_standby_build=actor_standby_build,
196202
actor_standby_memory_mbytes=actor_standby_memory_mbytes,
203+
pricing_infos=pricing_infos,
197204
)
198205

199206
return self._update(filter_out_none_values_recursively(actor_representation))
@@ -212,6 +219,7 @@ def start(
212219
content_type: str | None = None,
213220
build: str | None = None,
214221
max_items: int | None = None,
222+
max_total_charge_usd: Decimal | None = None,
215223
memory_mbytes: int | None = None,
216224
timeout_secs: int | None = None,
217225
wait_for_finish: int | None = None,
@@ -228,6 +236,7 @@ def start(
228236
the run uses the build specified in the default run configuration for the Actor (typically latest).
229237
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
230238
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.
231240
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
232241
specified in the default run configuration for the Actor.
233242
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -250,6 +259,7 @@ def start(
250259
request_params = self._params(
251260
build=build,
252261
maxItems=max_items,
262+
maxTotalChargeUsd=max_total_charge_usd,
253263
memory=memory_mbytes,
254264
timeout=timeout_secs,
255265
waitForFinish=wait_for_finish,
@@ -273,6 +283,7 @@ def call(
273283
content_type: str | None = None,
274284
build: str | None = None,
275285
max_items: int | None = None,
286+
max_total_charge_usd: Decimal | None = None,
276287
memory_mbytes: int | None = None,
277288
timeout_secs: int | None = None,
278289
webhooks: list[dict] | None = None,
@@ -291,6 +302,7 @@ def call(
291302
the run uses the build specified in the default run configuration for the Actor (typically latest).
292303
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
293304
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.
294306
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
295307
specified in the default run configuration for the Actor.
296308
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -309,6 +321,7 @@ def call(
309321
content_type=content_type,
310322
build=build,
311323
max_items=max_items,
324+
max_total_charge_usd=max_total_charge_usd,
312325
memory_mbytes=memory_mbytes,
313326
timeout_secs=timeout_secs,
314327
webhooks=webhooks,
@@ -460,6 +473,7 @@ async def update(
460473
actor_standby_idle_timeout_secs: int | None = None,
461474
actor_standby_build: str | None = None,
462475
actor_standby_memory_mbytes: int | None = None,
476+
pricing_infos: list[dict] | None = None,
463477
) -> dict:
464478
"""Update the Actor with the specified fields.
465479
@@ -494,6 +508,7 @@ async def update(
494508
it will be shut down.
495509
actor_standby_build: The build tag or number to run when the Actor is in Standby mode.
496510
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.
497512
498513
Returns:
499514
The updated Actor.
@@ -522,6 +537,7 @@ async def update(
522537
actor_standby_idle_timeout_secs=actor_standby_idle_timeout_secs,
523538
actor_standby_build=actor_standby_build,
524539
actor_standby_memory_mbytes=actor_standby_memory_mbytes,
540+
pricing_infos=pricing_infos,
525541
)
526542

527543
return await self._update(filter_out_none_values_recursively(actor_representation))
@@ -540,6 +556,7 @@ async def start(
540556
content_type: str | None = None,
541557
build: str | None = None,
542558
max_items: int | None = None,
559+
max_total_charge_usd: Decimal | None = None,
543560
memory_mbytes: int | None = None,
544561
timeout_secs: int | None = None,
545562
wait_for_finish: int | None = None,
@@ -556,6 +573,7 @@ async def start(
556573
the run uses the build specified in the default run configuration for the Actor (typically latest).
557574
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
558575
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.
559577
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
560578
specified in the default run configuration for the Actor.
561579
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -578,6 +596,7 @@ async def start(
578596
request_params = self._params(
579597
build=build,
580598
maxItems=max_items,
599+
maxTotalChargeUsd=max_total_charge_usd,
581600
memory=memory_mbytes,
582601
timeout=timeout_secs,
583602
waitForFinish=wait_for_finish,
@@ -601,6 +620,7 @@ async def call(
601620
content_type: str | None = None,
602621
build: str | None = None,
603622
max_items: int | None = None,
623+
max_total_charge_usd: Decimal | None = None,
604624
memory_mbytes: int | None = None,
605625
timeout_secs: int | None = None,
606626
webhooks: list[dict] | None = None,
@@ -619,6 +639,7 @@ async def call(
619639
the run uses the build specified in the default run configuration for the Actor (typically latest).
620640
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
621641
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.
622643
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
623644
specified in the default run configuration for the Actor.
624645
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
@@ -637,6 +658,7 @@ async def call(
637658
content_type=content_type,
638659
build=build,
639660
max_items=max_items,
661+
max_total_charge_usd=max_total_charge_usd,
640662
memory_mbytes=memory_mbytes,
641663
timeout_secs=timeout_secs,
642664
webhooks=webhooks,

0 commit comments

Comments
 (0)