Skip to content

Commit 6210e80

Browse files
vdusekclaude
andauthored
fix: Add missing tagged_builds parameter to Actor update method (#596)
Add support for the missing `tagged_builds` parameter in the Actor update method, allowing users to create, update, or remove build tags. The parameter accepts a dictionary mapping tag names to either: - A dict with 'build_id' key to assign/reassign a tag - None to remove a tag **Example usage:** ```python client.actor('my-actor').update( tagged_builds={ 'latest': {'build_id': 'abc123'}, 'beta': None # removes beta tag } ) ``` **Changes:** - Added `tagged_builds` parameter to `get_actor_representation()` helper function - Added `tagged_builds` parameter to `ActorClient.update()` (sync version) - Added `tagged_builds` parameter to `ActorClientAsync.update()` (async version) **Related:** - Related JS client issue: apify/apify-client-js#829 Closes #585 --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 03c5e3d commit 6210e80

File tree

1 file changed

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

1 file changed

+12
-0
lines changed

src/apify_client/clients/resource_clients/actor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def get_actor_representation(
6060
actor_standby_memory_mbytes: int | None = None,
6161
pricing_infos: list[dict] | None = None,
6262
actor_permission_level: ActorPermissionLevel | None = None,
63+
tagged_builds: dict[str, None | dict[str, str]] | None = None,
6364
) -> dict:
6465
"""Get dictionary representation of the Actor."""
6566
actor_dict = {
@@ -87,6 +88,7 @@ def get_actor_representation(
8788
},
8889
'pricingInfos': pricing_infos,
8990
'actorPermissionLevel': actor_permission_level,
91+
'taggedBuilds': tagged_builds,
9092
}
9193

9294
# Only include actorStandby if at least one field is provided
@@ -157,6 +159,7 @@ def update(
157159
actor_standby_memory_mbytes: int | None = None,
158160
pricing_infos: list[dict] | None = None,
159161
actor_permission_level: ActorPermissionLevel | None = None,
162+
tagged_builds: dict[str, None | dict[str, str]] | None = None,
160163
) -> dict:
161164
"""Update the Actor with the specified fields.
162165
@@ -193,6 +196,9 @@ def update(
193196
actor_standby_memory_mbytes: The memory in megabytes to use when the Actor is in Standby mode.
194197
pricing_infos: A list of objects that describes the pricing of the Actor.
195198
actor_permission_level: The permission level of the Actor on Apify platform.
199+
tagged_builds: A dictionary mapping build tag names to their settings. Use it to create, update,
200+
or remove build tags. To assign a tag, provide a dict with 'buildId' key. To remove a tag,
201+
set its value to None. Example: {'latest': {'buildId': 'abc'}, 'beta': None}.
196202
197203
Returns:
198204
The updated Actor.
@@ -223,6 +229,7 @@ def update(
223229
actor_standby_memory_mbytes=actor_standby_memory_mbytes,
224230
pricing_infos=pricing_infos,
225231
actor_permission_level=actor_permission_level,
232+
tagged_builds=tagged_builds,
226233
)
227234

228235
return self._update(filter_out_none_values_recursively(actor_representation))
@@ -580,6 +587,7 @@ async def update(
580587
actor_standby_memory_mbytes: int | None = None,
581588
pricing_infos: list[dict] | None = None,
582589
actor_permission_level: ActorPermissionLevel | None = None,
590+
tagged_builds: dict[str, None | dict[str, str]] | None = None,
583591
) -> dict:
584592
"""Update the Actor with the specified fields.
585593
@@ -616,6 +624,9 @@ async def update(
616624
actor_standby_memory_mbytes: The memory in megabytes to use when the Actor is in Standby mode.
617625
pricing_infos: A list of objects that describes the pricing of the Actor.
618626
actor_permission_level: The permission level of the Actor on Apify platform.
627+
tagged_builds: A dictionary mapping build tag names to their settings. Use it to create, update,
628+
or remove build tags. To assign a tag, provide a dict with 'buildId' key. To remove a tag,
629+
set its value to None. Example: {'latest': {'buildId': 'abc'}, 'beta': None}.
619630
620631
Returns:
621632
The updated Actor.
@@ -646,6 +657,7 @@ async def update(
646657
actor_standby_memory_mbytes=actor_standby_memory_mbytes,
647658
pricing_infos=pricing_infos,
648659
actor_permission_level=actor_permission_level,
660+
tagged_builds=tagged_builds,
649661
)
650662

651663
return await self._update(filter_out_none_values_recursively(actor_representation))

0 commit comments

Comments
 (0)