@@ -4794,6 +4794,9 @@ async def get_worker_task_reachability(
47944794 namespace = self ._client .namespace ,
47954795 build_ids = input .build_ids ,
47964796 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 ,
47974800 )
47984801 resp = await self ._client .workflow_service .get_worker_task_reachability (
47994802 req , retry = True , metadata = input .rpc_metadata , timeout = input .rpc_timeout
@@ -5170,3 +5173,25 @@ def _from_proto(
51705173 return TaskReachabilityType .CLOSED_WORKFLOWS
51715174 else :
51725175 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