Skip to content

Commit d591e7a

Browse files
committed
More fixes
1 parent 17587e0 commit d591e7a

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

src/apify_client/_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: openapi.json
3-
# timestamp: 2026-01-03T11:43:11+00:00
3+
# timestamp: 2026-01-07T15:16:44+00:00
44

55
from __future__ import annotations
66

@@ -1026,7 +1026,7 @@ class Run(BaseModel):
10261026
Field(alias='pricingInfo', discriminator='pricing_model', title='ActorRunPricingInfo'),
10271027
] = None
10281028
stats: RunStats
1029-
charged_event_counts: Annotated[dict[str, ActorChargeEvent] | None, Field(alias='chargedEventCounts')] = None
1029+
charged_event_counts: Annotated[dict[str, int] | None, Field(alias='chargedEventCounts')] = None
10301030
options: RunOptions
10311031
build_id: Annotated[str, Field(alias='buildId', examples=['7sT5jcggjjA9fNcxF'])]
10321032
exit_code: Annotated[float | None, Field(alias='exitCode', examples=[0])] = None

src/apify_client/_resource_clients/actor.py

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,49 @@ def get_actor_representation(
8484
'isDeprecated': is_deprecated,
8585
'isAnonymouslyRunnable': is_anonymously_runnable,
8686
'categories': categories,
87-
'defaultRunOptions': {
87+
'pricingInfos': pricing_infos,
88+
'actorPermissionLevel': actor_permission_level,
89+
}
90+
91+
# Only include defaultRunOptions if at least one field is provided
92+
if any(
93+
[
94+
default_run_build is not None,
95+
default_run_max_items is not None,
96+
default_run_memory_mbytes is not None,
97+
default_run_timeout_secs is not None,
98+
restart_on_error is not None,
99+
default_run_force_permission_level is not None,
100+
]
101+
):
102+
actor_dict['defaultRunOptions'] = {
88103
'build': default_run_build,
89104
'maxItems': default_run_max_items,
90105
'memoryMbytes': default_run_memory_mbytes,
91106
'timeoutSecs': default_run_timeout_secs,
92107
'restartOnError': restart_on_error,
93108
'forcePermissionLevel': default_run_force_permission_level,
94-
},
95-
'actorStandby': {
109+
}
110+
111+
# Only include actorStandby if at least one field is provided
112+
if any(
113+
[
114+
actor_standby_is_enabled is not None,
115+
actor_standby_desired_requests_per_actor_run is not None,
116+
actor_standby_max_requests_per_actor_run is not None,
117+
actor_standby_idle_timeout_secs is not None,
118+
actor_standby_build is not None,
119+
actor_standby_memory_mbytes is not None,
120+
]
121+
):
122+
actor_dict['actorStandby'] = {
96123
'isEnabled': actor_standby_is_enabled,
97124
'desiredRequestsPerActorRun': actor_standby_desired_requests_per_actor_run,
98125
'maxRequestsPerActorRun': actor_standby_max_requests_per_actor_run,
99126
'idleTimeoutSecs': actor_standby_idle_timeout_secs,
100127
'build': actor_standby_build,
101128
'memoryMbytes': actor_standby_memory_mbytes,
102-
},
103-
'pricingInfos': pricing_infos,
104-
'actorPermissionLevel': actor_permission_level,
105-
}
129+
}
106130

107131
# Only include exampleRunInput if at least one field is provided
108132
if example_run_input_body is not None or example_run_input_content_type is not None:

0 commit comments

Comments
 (0)