Skip to content
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
26 changes: 20 additions & 6 deletions src/apify_client/clients/resource_clients/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_actor_representation(
actor_permission_level: ActorPermissionLevel | None = None,
) -> dict:
"""Get dictionary representation of the Actor."""
return {
actor_dict = {
'name': name,
'title': title,
'description': description,
Expand All @@ -85,17 +85,31 @@ def get_actor_representation(
'body': example_run_input_body,
'contentType': example_run_input_content_type,
},
'actorStandby': {
'pricingInfos': pricing_infos,
'actorPermissionLevel': actor_permission_level,
}

# Only include actorStandby if at least one field is provided
if any(
[
actor_standby_is_enabled is not None,
actor_standby_desired_requests_per_actor_run is not None,
actor_standby_max_requests_per_actor_run is not None,
actor_standby_idle_timeout_secs is not None,
actor_standby_build is not None,
actor_standby_memory_mbytes is not None,
]
):
actor_dict['actorStandby'] = {
'isEnabled': actor_standby_is_enabled,
'desiredRequestsPerActorRun': actor_standby_desired_requests_per_actor_run,
'maxRequestsPerActorRun': actor_standby_max_requests_per_actor_run,
'idleTimeoutSecs': actor_standby_idle_timeout_secs,
'build': actor_standby_build,
'memoryMbytes': actor_standby_memory_mbytes,
},
'pricingInfos': pricing_infos,
'actorPermissionLevel': actor_permission_level,
}
}

return actor_dict


class ActorClient(ResourceClient):
Expand Down