@@ -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