Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add missing PPE-related Actor parameters #351

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/apify_client/clients/resource_clients/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
)

if TYPE_CHECKING:
from decimal import Decimal

from apify_shared.consts import ActorJobStatus, MetaOrigin


Expand Down Expand Up @@ -53,6 +55,7 @@ def get_actor_representation(
actor_standby_idle_timeout_secs: int | None = None,
actor_standby_build: str | None = None,
actor_standby_memory_mbytes: int | None = None,
pricing_infos: list[dict] | None = None,
) -> dict:
"""Get dictionary representation of the Actor."""
return {
Expand Down Expand Up @@ -85,6 +88,7 @@ def get_actor_representation(
'build': actor_standby_build,
'memoryMbytes': actor_standby_memory_mbytes,
},
'pricingInfos': pricing_infos,
}


Expand Down Expand Up @@ -132,6 +136,7 @@ def update(
actor_standby_idle_timeout_secs: int | None = None,
actor_standby_build: str | None = None,
actor_standby_memory_mbytes: int | None = None,
pricing_infos: list[dict] | None = None,
) -> dict:
"""Update the Actor with the specified fields.

Expand Down Expand Up @@ -166,6 +171,7 @@ def update(
it will be shut down.
actor_standby_build: The build tag or number to run when the Actor is in Standby mode.
actor_standby_memory_mbytes: The memory in megabytes to use when the Actor is in Standby mode.
pricing_infos: A list of objects that describes the pricing of the Actor.

Returns:
The updated Actor.
Expand Down Expand Up @@ -194,6 +200,7 @@ def update(
actor_standby_idle_timeout_secs=actor_standby_idle_timeout_secs,
actor_standby_build=actor_standby_build,
actor_standby_memory_mbytes=actor_standby_memory_mbytes,
pricing_infos=pricing_infos,
)

return self._update(filter_out_none_values_recursively(actor_representation))
Expand All @@ -212,6 +219,7 @@ def start(
content_type: str | None = None,
build: str | None = None,
max_items: int | None = None,
max_total_charge_usd: Decimal | None = None,
memory_mbytes: int | None = None,
timeout_secs: int | None = None,
wait_for_finish: int | None = None,
Expand All @@ -228,6 +236,7 @@ def start(
the run uses the build specified in the default run configuration for the Actor (typically latest).
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
per result, you will not be charged for more results than the given limit.
max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
specified in the default run configuration for the Actor.
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
Expand All @@ -250,6 +259,7 @@ def start(
request_params = self._params(
build=build,
maxItems=max_items,
maxTotalChargeUsd=max_total_charge_usd,
memory=memory_mbytes,
timeout=timeout_secs,
waitForFinish=wait_for_finish,
Expand All @@ -273,6 +283,7 @@ def call(
content_type: str | None = None,
build: str | None = None,
max_items: int | None = None,
max_total_charge_usd: Decimal | None = None,
memory_mbytes: int | None = None,
timeout_secs: int | None = None,
webhooks: list[dict] | None = None,
Expand All @@ -291,6 +302,7 @@ def call(
the run uses the build specified in the default run configuration for the Actor (typically latest).
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
per result, you will not be charged for more results than the given limit.
max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
specified in the default run configuration for the Actor.
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
Expand All @@ -309,6 +321,7 @@ def call(
content_type=content_type,
build=build,
max_items=max_items,
max_total_charge_usd=max_total_charge_usd,
memory_mbytes=memory_mbytes,
timeout_secs=timeout_secs,
webhooks=webhooks,
Expand Down Expand Up @@ -460,6 +473,7 @@ async def update(
actor_standby_idle_timeout_secs: int | None = None,
actor_standby_build: str | None = None,
actor_standby_memory_mbytes: int | None = None,
pricing_infos: list[dict] | None = None,
) -> dict:
"""Update the Actor with the specified fields.

Expand Down Expand Up @@ -494,6 +508,7 @@ async def update(
it will be shut down.
actor_standby_build: The build tag or number to run when the Actor is in Standby mode.
actor_standby_memory_mbytes: The memory in megabytes to use when the Actor is in Standby mode.
pricing_infos: A list of objects that describes the pricing of the Actor.

Returns:
The updated Actor.
Expand Down Expand Up @@ -522,6 +537,7 @@ async def update(
actor_standby_idle_timeout_secs=actor_standby_idle_timeout_secs,
actor_standby_build=actor_standby_build,
actor_standby_memory_mbytes=actor_standby_memory_mbytes,
pricing_infos=pricing_infos,
)

return await self._update(filter_out_none_values_recursively(actor_representation))
Expand All @@ -540,6 +556,7 @@ async def start(
content_type: str | None = None,
build: str | None = None,
max_items: int | None = None,
max_total_charge_usd: Decimal | None = None,
memory_mbytes: int | None = None,
timeout_secs: int | None = None,
wait_for_finish: int | None = None,
Expand All @@ -556,6 +573,7 @@ async def start(
the run uses the build specified in the default run configuration for the Actor (typically latest).
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
per result, you will not be charged for more results than the given limit.
max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
specified in the default run configuration for the Actor.
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
Expand All @@ -578,6 +596,7 @@ async def start(
request_params = self._params(
build=build,
maxItems=max_items,
maxTotalChargeUsd=max_total_charge_usd,
memory=memory_mbytes,
timeout=timeout_secs,
waitForFinish=wait_for_finish,
Expand All @@ -601,6 +620,7 @@ async def call(
content_type: str | None = None,
build: str | None = None,
max_items: int | None = None,
max_total_charge_usd: Decimal | None = None,
memory_mbytes: int | None = None,
timeout_secs: int | None = None,
webhooks: list[dict] | None = None,
Expand All @@ -619,6 +639,7 @@ async def call(
the run uses the build specified in the default run configuration for the Actor (typically latest).
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
per result, you will not be charged for more results than the given limit.
max_total_charge_usd: A limit on the total charged amount for pay-per-event actors.
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit
specified in the default run configuration for the Actor.
timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
Expand All @@ -637,6 +658,7 @@ async def call(
content_type=content_type,
build=build,
max_items=max_items,
max_total_charge_usd=max_total_charge_usd,
memory_mbytes=memory_mbytes,
timeout_secs=timeout_secs,
webhooks=webhooks,
Expand Down
Loading