@@ -4794,6 +4794,9 @@ async def get_worker_task_reachability(
4794
4794
namespace = self ._client .namespace ,
4795
4795
build_ids = input .build_ids ,
4796
4796
task_queues = input .task_queues ,
4797
+ reachability = input .reachability ._to_proto ()
4798
+ if input .reachability
4799
+ else temporalio .api .enums .v1 .TaskReachability .TASK_REACHABILITY_UNSPECIFIED ,
4797
4800
)
4798
4801
resp = await self ._client .workflow_service .get_worker_task_reachability (
4799
4802
req , retry = True , metadata = input .rpc_metadata , timeout = input .rpc_timeout
@@ -5170,3 +5173,25 @@ def _from_proto(
5170
5173
return TaskReachabilityType .CLOSED_WORKFLOWS
5171
5174
else :
5172
5175
raise ValueError (f"Cannot convert reachability type: { reachability } " )
5176
+
5177
+ def _to_proto (self ) -> temporalio .api .enums .v1 .TaskReachability .ValueType :
5178
+ if self == TaskReachabilityType .NEW_WORKFLOWS :
5179
+ return (
5180
+ temporalio .api .enums .v1 .TaskReachability .TASK_REACHABILITY_NEW_WORKFLOWS
5181
+ )
5182
+ elif self == TaskReachabilityType .EXISTING_WORKFLOWS :
5183
+ return (
5184
+ temporalio .api .enums .v1 .TaskReachability .TASK_REACHABILITY_EXISTING_WORKFLOWS
5185
+ )
5186
+ elif self == TaskReachabilityType .OPEN_WORKFLOWS :
5187
+ return (
5188
+ temporalio .api .enums .v1 .TaskReachability .TASK_REACHABILITY_OPEN_WORKFLOWS
5189
+ )
5190
+ elif self == TaskReachabilityType .CLOSED_WORKFLOWS :
5191
+ return (
5192
+ temporalio .api .enums .v1 .TaskReachability .TASK_REACHABILITY_CLOSED_WORKFLOWS
5193
+ )
5194
+ else :
5195
+ return (
5196
+ temporalio .api .enums .v1 .TaskReachability .TASK_REACHABILITY_UNSPECIFIED
5197
+ )
0 commit comments