From 168aa7c837a7c9ffe62d80f49a8c61409d651d93 Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Thu, 25 Sep 2025 11:53:25 -0700 Subject: [PATCH 1/7] Add initial draft of rpc call generation --- scripts/gen_bridge_client.py | 124 ++++ scripts/gen_protos_docker.py | 5 + temporalio/bridge/Cargo.lock | 1 + temporalio/bridge/Cargo.toml | 1 + temporalio/bridge/client.py | 2 + temporalio/bridge/src/client.rs | 433 +----------- temporalio/bridge/src/client_rpc_generated.rs | 614 ++++++++++++++++++ temporalio/bridge/src/lib.rs | 6 +- 8 files changed, 758 insertions(+), 428 deletions(-) create mode 100644 scripts/gen_bridge_client.py create mode 100644 temporalio/bridge/src/client_rpc_generated.rs diff --git a/scripts/gen_bridge_client.py b/scripts/gen_bridge_client.py new file mode 100644 index 000000000..b15261dfd --- /dev/null +++ b/scripts/gen_bridge_client.py @@ -0,0 +1,124 @@ +import re +from string import Template + +from google.protobuf.descriptor import ( + FileDescriptor, + MethodDescriptor, + ServiceDescriptor, +) + +import temporalio.api.cloud.cloudservice.v1.service_pb2 as cloud_service +import temporalio.api.operatorservice.v1.service_pb2 as operator_service +import temporalio.api.testservice.v1.service_pb2 as test_service +import temporalio.api.workflowservice.v1.service_pb2 as workflow_service +import temporalio.bridge.proto.health.v1.health_pb2 as health_service + + +def generate_match_arm(trait_name: str, method: MethodDescriptor) -> str: + match_template = Template("""\ + "$method_name" => { + rpc_call!(retry_client, call, $trait_name, $method_name) + }""") + + return match_template.substitute( + method_name=pascal_to_snake(method.name), trait_name=trait_name + ) + + +def generate_service_call(service_descriptor: ServiceDescriptor) -> str: + print(f"generating rpc call wrapper for {service_descriptor.full_name}") + + call_template = Template(""" +fn call_${service_name}<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::${descriptor_name}; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { +$match_arms + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + }""") + + sanitized_service_name: str = service_descriptor.name + # The health service doesn't end in "Service" in the proto definition + # this check ensures that the proto descriptor name will match the format in core + if not sanitized_service_name.endswith("Service"): + sanitized_service_name += "Service" + + # remove any streaming methods b/c we don't support them at the moment + methods = [ + method + for method in service_descriptor.methods + if not method.client_streaming and not method.server_streaming + ] + + match_arms = [ + generate_match_arm(sanitized_service_name, method) + for method in sorted(methods, key=lambda m: m.name) + ] + + return call_template.substitute( + service_name=pascal_to_snake(sanitized_service_name), + descriptor_name=sanitized_service_name, + match_arms="\n".join(match_arms), + ) + + +def generate_client_impl( + file_descriptors: list[FileDescriptor], + output_file: str = "temporalio/bridge/src/client_rpc_generated.rs", +): + print("generating bridge rpc calls") + + service_calls = [ + generate_service_call(service_descriptor) + for file_descriptor in file_descriptors + for service_descriptor in file_descriptor.services_by_name.values() + ] + + impl_template = Template("""// Generated file. DO NOT EDIT + +use pyo3::exceptions::PyValueError; +use pyo3::prelude::*; + +use super::{ + client::{rpc_req, rpc_resp, ClientRef, RpcCall}, + rpc_call, +}; + +#[pymethods] +impl ClientRef { +$service_calls +}""") + + with open(output_file, "w") as f: + f.write(impl_template.substitute(service_calls="\n".join(service_calls))) + + print(f"successfully generated client at {output_file}") + + +def pascal_to_snake(input: str) -> str: + return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", input).lower() + + +if __name__ == "__main__": + generate_client_impl( + [ + workflow_service.DESCRIPTOR, + operator_service.DESCRIPTOR, + cloud_service.DESCRIPTOR, + test_service.DESCRIPTOR, + health_service.DESCRIPTOR, + ] + ) diff --git a/scripts/gen_protos_docker.py b/scripts/gen_protos_docker.py index 099c56a2d..64ff81600 100644 --- a/scripts/gen_protos_docker.py +++ b/scripts/gen_protos_docker.py @@ -36,3 +36,8 @@ ["uv", "run", os.path.join(os.getcwd(), "scripts", "gen_payload_visitor.py")], check=True, ) + +subprocess.run( + ["uv", "run", os.path.join(os.getcwd(), "scripts", "gen_bridge_client.py")], + check=True, +) diff --git a/temporalio/bridge/Cargo.lock b/temporalio/bridge/Cargo.lock index 740f9a547..b40d5fc72 100644 --- a/temporalio/bridge/Cargo.lock +++ b/temporalio/bridge/Cargo.lock @@ -1713,6 +1713,7 @@ checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" dependencies = [ "anyhow", "indoc", + "inventory", "libc", "memoffset", "once_cell", diff --git a/temporalio/bridge/Cargo.toml b/temporalio/bridge/Cargo.toml index 70a3c5820..d1aaabb53 100644 --- a/temporalio/bridge/Cargo.toml +++ b/temporalio/bridge/Cargo.toml @@ -24,6 +24,7 @@ pyo3 = { version = "0.25", features = [ "extension-module", "abi3-py39", "anyhow", + "multiple-pymethods", ] } pyo3-async-runtimes = { version = "0.25", features = ["tokio-runtime"] } pythonize = "0.25" diff --git a/temporalio/bridge/client.py b/temporalio/bridge/client.py index dafd6fb71..a4ae70b15 100644 --- a/temporalio/bridge/client.py +++ b/temporalio/bridge/client.py @@ -132,6 +132,8 @@ async def call( timeout_millis = round(timeout.total_seconds() * 1000) if timeout else None call = RpcCall(rpc, req.SerializeToString(), retry, metadata, timeout_millis) + print(f"calling rpc '{rpc}'") + # Do call (this throws an RPCError on failure) if service == "workflow": resp_fut = self._ref.call_workflow_service(call) diff --git a/temporalio/bridge/src/client.rs b/temporalio/bridge/src/client.rs index 0287a5b64..dfbd432a1 100644 --- a/temporalio/bridge/src/client.rs +++ b/temporalio/bridge/src/client.rs @@ -5,8 +5,8 @@ use std::str::FromStr; use std::time::Duration; use temporal_client::{ ClientKeepAliveConfig as CoreClientKeepAliveConfig, ClientOptions, ClientOptionsBuilder, - ConfiguredClient, HealthService, HttpConnectProxyOptions, RetryClient, RetryConfig, - TemporalServiceClientWithMetrics, TestService, TlsConfig, WorkflowService, + ConfiguredClient, HttpConnectProxyOptions, RetryClient, RetryConfig, + TemporalServiceClientWithMetrics, TlsConfig, }; use tonic::metadata::{ AsciiMetadataKey, AsciiMetadataValue, BinaryMetadataKey, BinaryMetadataValue, @@ -22,7 +22,7 @@ type Client = RetryClient>; #[pyclass] pub struct ClientRef { pub(crate) retry_client: Client, - runtime: runtime::Runtime, + pub(crate) runtime: runtime::Runtime, } #[derive(FromPyObject)] @@ -70,10 +70,10 @@ struct ClientHttpConnectProxyConfig { } #[derive(FromPyObject)] -struct RpcCall { - rpc: String, +pub(crate) struct RpcCall { + pub(crate) rpc: String, req: Vec, - retry: bool, + pub(crate) retry: bool, metadata: HashMap, timeout_millis: Option, } @@ -104,17 +104,8 @@ pub fn connect_client<'a>( }) } +#[macro_export] macro_rules! rpc_call { - ($retry_client:ident, $call:ident, $call_name:ident) => { - if $call.retry { - rpc_resp($retry_client.$call_name(rpc_req($call)?).await) - } else { - rpc_resp($retry_client.into_inner().$call_name(rpc_req($call)?).await) - } - }; -} - -macro_rules! rpc_call_on_trait { ($retry_client:ident, $call:ident, $trait:tt, $call_name:ident) => { if $call.retry { rpc_resp($trait::$call_name(&mut $retry_client, rpc_req($call)?).await) @@ -144,415 +135,9 @@ impl ClientRef { fn update_api_key(&self, api_key: Option) { self.retry_client.get_client().set_api_key(api_key); } - - fn call_workflow_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "count_workflow_executions" => { - rpc_call!(retry_client, call, count_workflow_executions) - } - "create_schedule" => { - rpc_call!(retry_client, call, create_schedule) - } - "create_workflow_rule" => { - rpc_call!(retry_client, call, create_workflow_rule) - } - "delete_schedule" => { - rpc_call!(retry_client, call, delete_schedule) - } - "delete_worker_deployment" => { - rpc_call!(retry_client, call, delete_worker_deployment) - } - "delete_worker_deployment_version" => { - rpc_call!(retry_client, call, delete_worker_deployment_version) - } - "delete_workflow_execution" => { - rpc_call!(retry_client, call, delete_workflow_execution) - } - "delete_workflow_rule" => { - rpc_call!(retry_client, call, delete_workflow_rule) - } - "describe_batch_operation" => { - rpc_call!(retry_client, call, describe_batch_operation) - } - "describe_deployment" => { - rpc_call!(retry_client, call, describe_deployment) - } - "deprecate_namespace" => rpc_call!(retry_client, call, deprecate_namespace), - "describe_namespace" => rpc_call!(retry_client, call, describe_namespace), - "describe_schedule" => rpc_call!(retry_client, call, describe_schedule), - "describe_task_queue" => rpc_call!(retry_client, call, describe_task_queue), - "describe_worker_deployment" => { - rpc_call!(retry_client, call, describe_worker_deployment) - } - "describe_worker_deployment_version" => { - rpc_call!(retry_client, call, describe_worker_deployment_version) - } - "describe_workflow_execution" => { - rpc_call!(retry_client, call, describe_workflow_execution) - } - "describe_workflow_rule" => { - rpc_call!(retry_client, call, describe_workflow_rule) - } - "execute_multi_operation" => rpc_call!(retry_client, call, execute_multi_operation), - "fetch_worker_config" => rpc_call!(retry_client, call, fetch_worker_config), - "get_cluster_info" => rpc_call!(retry_client, call, get_cluster_info), - "get_current_deployment" => rpc_call!(retry_client, call, get_current_deployment), - "get_deployment_reachability" => { - rpc_call!(retry_client, call, get_deployment_reachability) - } - "get_search_attributes" => { - rpc_call!(retry_client, call, get_search_attributes) - } - "get_system_info" => rpc_call!(retry_client, call, get_system_info), - "get_worker_build_id_compatibility" => { - rpc_call!(retry_client, call, get_worker_build_id_compatibility) - } - "get_worker_task_reachability" => { - rpc_call!(retry_client, call, get_worker_task_reachability) - } - "get_worker_versioning_rules" => { - rpc_call!(retry_client, call, get_worker_versioning_rules) - } - "get_workflow_execution_history" => { - rpc_call!(retry_client, call, get_workflow_execution_history) - } - "get_workflow_execution_history_reverse" => { - rpc_call!(retry_client, call, get_workflow_execution_history_reverse) - } - "list_archived_workflow_executions" => { - rpc_call!(retry_client, call, list_archived_workflow_executions) - } - "list_closed_workflow_executions" => { - rpc_call!(retry_client, call, list_closed_workflow_executions) - } - "list_deployments" => { - rpc_call!(retry_client, call, list_deployments) - } - "list_namespaces" => rpc_call!(retry_client, call, list_namespaces), - "list_open_workflow_executions" => { - rpc_call!(retry_client, call, list_open_workflow_executions) - } - "list_schedule_matching_times" => { - rpc_call!(retry_client, call, list_schedule_matching_times) - } - "list_schedules" => { - rpc_call!(retry_client, call, list_schedules) - } - "list_task_queue_partitions" => { - rpc_call!(retry_client, call, list_task_queue_partitions) - } - "list_worker_deployments" => { - rpc_call!(retry_client, call, list_worker_deployments) - } - "list_workflow_executions" => { - rpc_call!(retry_client, call, list_workflow_executions) - } - "list_workflow_rules" => { - rpc_call!(retry_client, call, list_workflow_rules) - } - "patch_schedule" => { - rpc_call!(retry_client, call, patch_schedule) - } - "pause_activity" => { - rpc_call!(retry_client, call, pause_activity) - } - "poll_activity_task_queue" => { - rpc_call!(retry_client, call, poll_activity_task_queue) - } - "poll_nexus_task_queue" => rpc_call!(retry_client, call, poll_nexus_task_queue), - "poll_workflow_execution_update" => { - rpc_call!(retry_client, call, poll_workflow_execution_update) - } - "poll_workflow_task_queue" => { - rpc_call!(retry_client, call, poll_workflow_task_queue) - } - "query_workflow" => rpc_call!(retry_client, call, query_workflow), - "record_activity_task_heartbeat" => { - rpc_call!(retry_client, call, record_activity_task_heartbeat) - } - "record_activity_task_heartbeat_by_id" => { - rpc_call!(retry_client, call, record_activity_task_heartbeat_by_id) - } - "register_namespace" => rpc_call!(retry_client, call, register_namespace), - "request_cancel_workflow_execution" => { - rpc_call!(retry_client, call, request_cancel_workflow_execution) - } - "reset_activity" => { - rpc_call!(retry_client, call, reset_activity) - } - "reset_sticky_task_queue" => { - rpc_call!(retry_client, call, reset_sticky_task_queue) - } - "reset_workflow_execution" => { - rpc_call!(retry_client, call, reset_workflow_execution) - } - "respond_activity_task_canceled" => { - rpc_call!(retry_client, call, respond_activity_task_canceled) - } - "respond_activity_task_canceled_by_id" => { - rpc_call!(retry_client, call, respond_activity_task_canceled_by_id) - } - "respond_activity_task_completed" => { - rpc_call!(retry_client, call, respond_activity_task_completed) - } - "respond_activity_task_completed_by_id" => { - rpc_call!(retry_client, call, respond_activity_task_completed_by_id) - } - "respond_activity_task_failed" => { - rpc_call!(retry_client, call, respond_activity_task_failed) - } - "respond_activity_task_failed_by_id" => { - rpc_call!(retry_client, call, respond_activity_task_failed_by_id) - } - "respond_nexus_task_completed" => { - rpc_call!(retry_client, call, respond_nexus_task_completed) - } - "respond_nexus_task_failed" => { - rpc_call!(retry_client, call, respond_nexus_task_failed) - } - "respond_query_task_completed" => { - rpc_call!(retry_client, call, respond_query_task_completed) - } - "respond_workflow_task_completed" => { - rpc_call!(retry_client, call, respond_workflow_task_completed) - } - "respond_workflow_task_failed" => { - rpc_call!(retry_client, call, respond_workflow_task_failed) - } - "scan_workflow_executions" => { - rpc_call!(retry_client, call, scan_workflow_executions) - } - "set_current_deployment" => { - rpc_call!(retry_client, call, set_current_deployment) - } - "set_worker_deployment_current_version" => { - rpc_call!(retry_client, call, set_worker_deployment_current_version) - } - "set_worker_deployment_ramping_version" => { - rpc_call!(retry_client, call, set_worker_deployment_ramping_version) - } - "shutdown_worker" => { - rpc_call!(retry_client, call, shutdown_worker) - } - "signal_with_start_workflow_execution" => { - rpc_call!(retry_client, call, signal_with_start_workflow_execution) - } - "signal_workflow_execution" => { - rpc_call!(retry_client, call, signal_workflow_execution) - } - "start_workflow_execution" => { - rpc_call!(retry_client, call, start_workflow_execution) - } - "terminate_workflow_execution" => { - rpc_call!(retry_client, call, terminate_workflow_execution) - } - "trigger_workflow_rule" => { - rpc_call!(retry_client, call, trigger_workflow_rule) - } - "unpause_activity" => { - rpc_call!(retry_client, call, unpause_activity) - } - "update_namespace" => { - rpc_call_on_trait!(retry_client, call, WorkflowService, update_namespace) - } - "update_schedule" => rpc_call!(retry_client, call, update_schedule), - "update_task_queue_config" => { - rpc_call!(retry_client, call, update_task_queue_config) - } - "update_worker_config" => rpc_call!(retry_client, call, update_worker_config), - "update_worker_deployment_version_metadata" => { - rpc_call!( - retry_client, - call, - update_worker_deployment_version_metadata - ) - } - "update_worker_build_id_compatibility" => { - rpc_call!(retry_client, call, update_worker_build_id_compatibility) - } - "update_worker_versioning_rules" => { - rpc_call!(retry_client, call, update_worker_versioning_rules) - } - "update_workflow_execution" => { - rpc_call!(retry_client, call, update_workflow_execution) - } - "update_workflow_execution_options" => { - rpc_call!(retry_client, call, update_workflow_execution_options) - } - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } - - fn call_operator_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - use temporal_client::OperatorService; - - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "add_or_update_remote_cluster" => { - rpc_call!(retry_client, call, add_or_update_remote_cluster) - } - "add_search_attributes" => { - rpc_call!(retry_client, call, add_search_attributes) - } - "create_nexus_endpoint" => rpc_call!(retry_client, call, create_nexus_endpoint), - "delete_namespace" => { - rpc_call_on_trait!(retry_client, call, OperatorService, delete_namespace) - } - "delete_nexus_endpoint" => rpc_call!(retry_client, call, delete_nexus_endpoint), - "get_nexus_endpoint" => rpc_call!(retry_client, call, get_nexus_endpoint), - "list_clusters" => rpc_call!(retry_client, call, list_clusters), - "list_nexus_endpoints" => rpc_call!(retry_client, call, list_nexus_endpoints), - "list_search_attributes" => { - rpc_call!(retry_client, call, list_search_attributes) - } - "remove_remote_cluster" => { - rpc_call!(retry_client, call, remove_remote_cluster) - } - "remove_search_attributes" => { - rpc_call!(retry_client, call, remove_search_attributes) - } - "update_nexus_endpoint" => rpc_call!(retry_client, call, update_nexus_endpoint), - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } - - fn call_cloud_service<'p>(&self, py: Python<'p>, call: RpcCall) -> PyResult> { - use temporal_client::CloudService; - - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "add_namespace_region" => rpc_call!(retry_client, call, add_namespace_region), - "create_api_key" => rpc_call!(retry_client, call, create_api_key), - "create_connectivity_rule" => { - rpc_call!(retry_client, call, create_connectivity_rule) - } - "create_namespace" => rpc_call!(retry_client, call, create_namespace), - "create_service_account" => rpc_call!(retry_client, call, create_service_account), - "create_user_group" => rpc_call!(retry_client, call, create_user_group), - "create_user" => rpc_call!(retry_client, call, create_user), - "delete_api_key" => rpc_call!(retry_client, call, delete_api_key), - "delete_connectivity_rule" => { - rpc_call!(retry_client, call, delete_connectivity_rule) - } - "delete_namespace" => { - rpc_call_on_trait!(retry_client, call, CloudService, delete_namespace) - } - "delete_service_account" => rpc_call!(retry_client, call, delete_service_account), - "delete_user_group" => rpc_call!(retry_client, call, delete_user_group), - "delete_user" => rpc_call!(retry_client, call, delete_user), - "failover_namespace_region" => { - rpc_call!(retry_client, call, failover_namespace_region) - } - "get_api_key" => rpc_call!(retry_client, call, get_api_key), - "get_api_keys" => rpc_call!(retry_client, call, get_api_keys), - "get_async_operation" => rpc_call!(retry_client, call, get_async_operation), - "get_connectivity_rule" => rpc_call!(retry_client, call, get_connectivity_rule), - "get_connectivity_rules" => rpc_call!(retry_client, call, get_connectivity_rules), - "get_namespace" => rpc_call!(retry_client, call, get_namespace), - "get_namespaces" => rpc_call!(retry_client, call, get_namespaces), - "get_region" => rpc_call!(retry_client, call, get_region), - "get_regions" => rpc_call!(retry_client, call, get_regions), - "get_service_account" => rpc_call!(retry_client, call, get_service_account), - "get_service_accounts" => rpc_call!(retry_client, call, get_service_accounts), - "get_user_group" => rpc_call!(retry_client, call, get_user_group), - "get_user_groups" => rpc_call!(retry_client, call, get_user_groups), - "get_user" => rpc_call!(retry_client, call, get_user), - "get_users" => rpc_call!(retry_client, call, get_users), - "rename_custom_search_attribute" => { - rpc_call!(retry_client, call, rename_custom_search_attribute) - } - "set_user_group_namespace_access" => { - rpc_call!(retry_client, call, set_user_group_namespace_access) - } - "set_user_namespace_access" => { - rpc_call!(retry_client, call, set_user_namespace_access) - } - "update_api_key" => rpc_call!(retry_client, call, update_api_key), - "update_namespace" => { - rpc_call_on_trait!(retry_client, call, CloudService, update_namespace) - } - "update_namespace_tags" => rpc_call!(retry_client, call, update_namespace_tags), - "update_service_account" => rpc_call!(retry_client, call, update_service_account), - "update_user_group" => rpc_call!(retry_client, call, update_user_group), - "update_user" => rpc_call!(retry_client, call, update_user), - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } - - fn call_test_service<'p>(&self, py: Python<'p>, call: RpcCall) -> PyResult> { - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "get_current_time" => rpc_call!(retry_client, call, get_current_time), - "lock_time_skipping" => rpc_call!(retry_client, call, lock_time_skipping), - "sleep_until" => rpc_call!(retry_client, call, sleep_until), - "sleep" => rpc_call!(retry_client, call, sleep), - "unlock_time_skipping_with_sleep" => { - rpc_call!(retry_client, call, unlock_time_skipping_with_sleep) - } - "unlock_time_skipping" => rpc_call!(retry_client, call, unlock_time_skipping), - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } - - fn call_health_service<'p>(&self, py: Python<'p>, call: RpcCall) -> PyResult> { - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "check" => rpc_call!(retry_client, call, check), - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } } -fn rpc_req(call: RpcCall) -> PyResult> { +pub(crate) fn rpc_req(call: RpcCall) -> PyResult> { let proto = P::decode(&*call.req) .map_err(|err| PyValueError::new_err(format!("Invalid proto: {err}")))?; let mut req = tonic::Request::new(proto); @@ -590,7 +175,7 @@ fn rpc_req(call: RpcCall) -> PyResult(res: Result, tonic::Status>) -> PyResult> +pub(crate) fn rpc_resp

(res: Result, tonic::Status>) -> PyResult> where P: prost::Message, P: Default, diff --git a/temporalio/bridge/src/client_rpc_generated.rs b/temporalio/bridge/src/client_rpc_generated.rs new file mode 100644 index 000000000..6de23d1d5 --- /dev/null +++ b/temporalio/bridge/src/client_rpc_generated.rs @@ -0,0 +1,614 @@ +// Generated file. DO NOT EDIT + +use pyo3::exceptions::PyValueError; +use pyo3::prelude::*; + +use super::{ + client::{rpc_req, rpc_resp, ClientRef, RpcCall}, + rpc_call, +}; + +#[pymethods] +impl ClientRef { + +fn call_workflow_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::WorkflowService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "count_workflow_executions" => { + rpc_call!(retry_client, call, WorkflowService, count_workflow_executions) + } + "create_schedule" => { + rpc_call!(retry_client, call, WorkflowService, create_schedule) + } + "create_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, create_workflow_rule) + } + "delete_schedule" => { + rpc_call!(retry_client, call, WorkflowService, delete_schedule) + } + "delete_worker_deployment" => { + rpc_call!(retry_client, call, WorkflowService, delete_worker_deployment) + } + "delete_worker_deployment_version" => { + rpc_call!(retry_client, call, WorkflowService, delete_worker_deployment_version) + } + "delete_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, delete_workflow_execution) + } + "delete_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, delete_workflow_rule) + } + "deprecate_namespace" => { + rpc_call!(retry_client, call, WorkflowService, deprecate_namespace) + } + "describe_batch_operation" => { + rpc_call!(retry_client, call, WorkflowService, describe_batch_operation) + } + "describe_deployment" => { + rpc_call!(retry_client, call, WorkflowService, describe_deployment) + } + "describe_namespace" => { + rpc_call!(retry_client, call, WorkflowService, describe_namespace) + } + "describe_schedule" => { + rpc_call!(retry_client, call, WorkflowService, describe_schedule) + } + "describe_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, describe_task_queue) + } + "describe_worker_deployment" => { + rpc_call!(retry_client, call, WorkflowService, describe_worker_deployment) + } + "describe_worker_deployment_version" => { + rpc_call!(retry_client, call, WorkflowService, describe_worker_deployment_version) + } + "describe_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, describe_workflow_execution) + } + "describe_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, describe_workflow_rule) + } + "execute_multi_operation" => { + rpc_call!(retry_client, call, WorkflowService, execute_multi_operation) + } + "fetch_worker_config" => { + rpc_call!(retry_client, call, WorkflowService, fetch_worker_config) + } + "get_cluster_info" => { + rpc_call!(retry_client, call, WorkflowService, get_cluster_info) + } + "get_current_deployment" => { + rpc_call!(retry_client, call, WorkflowService, get_current_deployment) + } + "get_deployment_reachability" => { + rpc_call!(retry_client, call, WorkflowService, get_deployment_reachability) + } + "get_search_attributes" => { + rpc_call!(retry_client, call, WorkflowService, get_search_attributes) + } + "get_system_info" => { + rpc_call!(retry_client, call, WorkflowService, get_system_info) + } + "get_worker_build_id_compatibility" => { + rpc_call!(retry_client, call, WorkflowService, get_worker_build_id_compatibility) + } + "get_worker_task_reachability" => { + rpc_call!(retry_client, call, WorkflowService, get_worker_task_reachability) + } + "get_worker_versioning_rules" => { + rpc_call!(retry_client, call, WorkflowService, get_worker_versioning_rules) + } + "get_workflow_execution_history" => { + rpc_call!(retry_client, call, WorkflowService, get_workflow_execution_history) + } + "get_workflow_execution_history_reverse" => { + rpc_call!(retry_client, call, WorkflowService, get_workflow_execution_history_reverse) + } + "list_archived_workflow_executions" => { + rpc_call!(retry_client, call, WorkflowService, list_archived_workflow_executions) + } + "list_batch_operations" => { + rpc_call!(retry_client, call, WorkflowService, list_batch_operations) + } + "list_closed_workflow_executions" => { + rpc_call!(retry_client, call, WorkflowService, list_closed_workflow_executions) + } + "list_deployments" => { + rpc_call!(retry_client, call, WorkflowService, list_deployments) + } + "list_namespaces" => { + rpc_call!(retry_client, call, WorkflowService, list_namespaces) + } + "list_open_workflow_executions" => { + rpc_call!(retry_client, call, WorkflowService, list_open_workflow_executions) + } + "list_schedule_matching_times" => { + rpc_call!(retry_client, call, WorkflowService, list_schedule_matching_times) + } + "list_schedules" => { + rpc_call!(retry_client, call, WorkflowService, list_schedules) + } + "list_task_queue_partitions" => { + rpc_call!(retry_client, call, WorkflowService, list_task_queue_partitions) + } + "list_worker_deployments" => { + rpc_call!(retry_client, call, WorkflowService, list_worker_deployments) + } + "list_workers" => { + rpc_call!(retry_client, call, WorkflowService, list_workers) + } + "list_workflow_executions" => { + rpc_call!(retry_client, call, WorkflowService, list_workflow_executions) + } + "list_workflow_rules" => { + rpc_call!(retry_client, call, WorkflowService, list_workflow_rules) + } + "patch_schedule" => { + rpc_call!(retry_client, call, WorkflowService, patch_schedule) + } + "pause_activity" => { + rpc_call!(retry_client, call, WorkflowService, pause_activity) + } + "poll_activity_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, poll_activity_task_queue) + } + "poll_nexus_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, poll_nexus_task_queue) + } + "poll_workflow_execution_update" => { + rpc_call!(retry_client, call, WorkflowService, poll_workflow_execution_update) + } + "poll_workflow_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, poll_workflow_task_queue) + } + "query_workflow" => { + rpc_call!(retry_client, call, WorkflowService, query_workflow) + } + "record_activity_task_heartbeat" => { + rpc_call!(retry_client, call, WorkflowService, record_activity_task_heartbeat) + } + "record_activity_task_heartbeat_by_id" => { + rpc_call!(retry_client, call, WorkflowService, record_activity_task_heartbeat_by_id) + } + "record_worker_heartbeat" => { + rpc_call!(retry_client, call, WorkflowService, record_worker_heartbeat) + } + "register_namespace" => { + rpc_call!(retry_client, call, WorkflowService, register_namespace) + } + "request_cancel_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, request_cancel_workflow_execution) + } + "reset_activity" => { + rpc_call!(retry_client, call, WorkflowService, reset_activity) + } + "reset_sticky_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, reset_sticky_task_queue) + } + "reset_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, reset_workflow_execution) + } + "respond_activity_task_canceled" => { + rpc_call!(retry_client, call, WorkflowService, respond_activity_task_canceled) + } + "respond_activity_task_canceled_by_id" => { + rpc_call!(retry_client, call, WorkflowService, respond_activity_task_canceled_by_id) + } + "respond_activity_task_completed" => { + rpc_call!(retry_client, call, WorkflowService, respond_activity_task_completed) + } + "respond_activity_task_completed_by_id" => { + rpc_call!(retry_client, call, WorkflowService, respond_activity_task_completed_by_id) + } + "respond_activity_task_failed" => { + rpc_call!(retry_client, call, WorkflowService, respond_activity_task_failed) + } + "respond_activity_task_failed_by_id" => { + rpc_call!(retry_client, call, WorkflowService, respond_activity_task_failed_by_id) + } + "respond_nexus_task_completed" => { + rpc_call!(retry_client, call, WorkflowService, respond_nexus_task_completed) + } + "respond_nexus_task_failed" => { + rpc_call!(retry_client, call, WorkflowService, respond_nexus_task_failed) + } + "respond_query_task_completed" => { + rpc_call!(retry_client, call, WorkflowService, respond_query_task_completed) + } + "respond_workflow_task_completed" => { + rpc_call!(retry_client, call, WorkflowService, respond_workflow_task_completed) + } + "respond_workflow_task_failed" => { + rpc_call!(retry_client, call, WorkflowService, respond_workflow_task_failed) + } + "scan_workflow_executions" => { + rpc_call!(retry_client, call, WorkflowService, scan_workflow_executions) + } + "set_current_deployment" => { + rpc_call!(retry_client, call, WorkflowService, set_current_deployment) + } + "set_worker_deployment_current_version" => { + rpc_call!(retry_client, call, WorkflowService, set_worker_deployment_current_version) + } + "set_worker_deployment_ramping_version" => { + rpc_call!(retry_client, call, WorkflowService, set_worker_deployment_ramping_version) + } + "shutdown_worker" => { + rpc_call!(retry_client, call, WorkflowService, shutdown_worker) + } + "signal_with_start_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, signal_with_start_workflow_execution) + } + "signal_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, signal_workflow_execution) + } + "start_batch_operation" => { + rpc_call!(retry_client, call, WorkflowService, start_batch_operation) + } + "start_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, start_workflow_execution) + } + "stop_batch_operation" => { + rpc_call!(retry_client, call, WorkflowService, stop_batch_operation) + } + "terminate_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, terminate_workflow_execution) + } + "trigger_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, trigger_workflow_rule) + } + "unpause_activity" => { + rpc_call!(retry_client, call, WorkflowService, unpause_activity) + } + "update_activity_options" => { + rpc_call!(retry_client, call, WorkflowService, update_activity_options) + } + "update_namespace" => { + rpc_call!(retry_client, call, WorkflowService, update_namespace) + } + "update_schedule" => { + rpc_call!(retry_client, call, WorkflowService, update_schedule) + } + "update_task_queue_config" => { + rpc_call!(retry_client, call, WorkflowService, update_task_queue_config) + } + "update_worker_build_id_compatibility" => { + rpc_call!(retry_client, call, WorkflowService, update_worker_build_id_compatibility) + } + "update_worker_config" => { + rpc_call!(retry_client, call, WorkflowService, update_worker_config) + } + "update_worker_deployment_version_metadata" => { + rpc_call!(retry_client, call, WorkflowService, update_worker_deployment_version_metadata) + } + "update_worker_versioning_rules" => { + rpc_call!(retry_client, call, WorkflowService, update_worker_versioning_rules) + } + "update_workflow_execution" => { + rpc_call!(retry_client, call, WorkflowService, update_workflow_execution) + } + "update_workflow_execution_options" => { + rpc_call!(retry_client, call, WorkflowService, update_workflow_execution_options) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } + +fn call_operator_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::OperatorService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "add_or_update_remote_cluster" => { + rpc_call!(retry_client, call, OperatorService, add_or_update_remote_cluster) + } + "add_search_attributes" => { + rpc_call!(retry_client, call, OperatorService, add_search_attributes) + } + "create_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, create_nexus_endpoint) + } + "delete_namespace" => { + rpc_call!(retry_client, call, OperatorService, delete_namespace) + } + "delete_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, delete_nexus_endpoint) + } + "get_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, get_nexus_endpoint) + } + "list_clusters" => { + rpc_call!(retry_client, call, OperatorService, list_clusters) + } + "list_nexus_endpoints" => { + rpc_call!(retry_client, call, OperatorService, list_nexus_endpoints) + } + "list_search_attributes" => { + rpc_call!(retry_client, call, OperatorService, list_search_attributes) + } + "remove_remote_cluster" => { + rpc_call!(retry_client, call, OperatorService, remove_remote_cluster) + } + "remove_search_attributes" => { + rpc_call!(retry_client, call, OperatorService, remove_search_attributes) + } + "update_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, update_nexus_endpoint) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } + +fn call_cloud_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::CloudService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "add_namespace_region" => { + rpc_call!(retry_client, call, CloudService, add_namespace_region) + } + "add_user_group_member" => { + rpc_call!(retry_client, call, CloudService, add_user_group_member) + } + "create_api_key" => { + rpc_call!(retry_client, call, CloudService, create_api_key) + } + "create_connectivity_rule" => { + rpc_call!(retry_client, call, CloudService, create_connectivity_rule) + } + "create_namespace" => { + rpc_call!(retry_client, call, CloudService, create_namespace) + } + "create_namespace_export_sink" => { + rpc_call!(retry_client, call, CloudService, create_namespace_export_sink) + } + "create_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, create_nexus_endpoint) + } + "create_service_account" => { + rpc_call!(retry_client, call, CloudService, create_service_account) + } + "create_user" => { + rpc_call!(retry_client, call, CloudService, create_user) + } + "create_user_group" => { + rpc_call!(retry_client, call, CloudService, create_user_group) + } + "delete_api_key" => { + rpc_call!(retry_client, call, CloudService, delete_api_key) + } + "delete_connectivity_rule" => { + rpc_call!(retry_client, call, CloudService, delete_connectivity_rule) + } + "delete_namespace" => { + rpc_call!(retry_client, call, CloudService, delete_namespace) + } + "delete_namespace_export_sink" => { + rpc_call!(retry_client, call, CloudService, delete_namespace_export_sink) + } + "delete_namespace_region" => { + rpc_call!(retry_client, call, CloudService, delete_namespace_region) + } + "delete_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, delete_nexus_endpoint) + } + "delete_service_account" => { + rpc_call!(retry_client, call, CloudService, delete_service_account) + } + "delete_user" => { + rpc_call!(retry_client, call, CloudService, delete_user) + } + "delete_user_group" => { + rpc_call!(retry_client, call, CloudService, delete_user_group) + } + "failover_namespace_region" => { + rpc_call!(retry_client, call, CloudService, failover_namespace_region) + } + "get_account" => { + rpc_call!(retry_client, call, CloudService, get_account) + } + "get_api_key" => { + rpc_call!(retry_client, call, CloudService, get_api_key) + } + "get_api_keys" => { + rpc_call!(retry_client, call, CloudService, get_api_keys) + } + "get_async_operation" => { + rpc_call!(retry_client, call, CloudService, get_async_operation) + } + "get_connectivity_rule" => { + rpc_call!(retry_client, call, CloudService, get_connectivity_rule) + } + "get_connectivity_rules" => { + rpc_call!(retry_client, call, CloudService, get_connectivity_rules) + } + "get_namespace" => { + rpc_call!(retry_client, call, CloudService, get_namespace) + } + "get_namespace_export_sink" => { + rpc_call!(retry_client, call, CloudService, get_namespace_export_sink) + } + "get_namespace_export_sinks" => { + rpc_call!(retry_client, call, CloudService, get_namespace_export_sinks) + } + "get_namespaces" => { + rpc_call!(retry_client, call, CloudService, get_namespaces) + } + "get_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, get_nexus_endpoint) + } + "get_nexus_endpoints" => { + rpc_call!(retry_client, call, CloudService, get_nexus_endpoints) + } + "get_region" => { + rpc_call!(retry_client, call, CloudService, get_region) + } + "get_regions" => { + rpc_call!(retry_client, call, CloudService, get_regions) + } + "get_service_account" => { + rpc_call!(retry_client, call, CloudService, get_service_account) + } + "get_service_accounts" => { + rpc_call!(retry_client, call, CloudService, get_service_accounts) + } + "get_usage" => { + rpc_call!(retry_client, call, CloudService, get_usage) + } + "get_user" => { + rpc_call!(retry_client, call, CloudService, get_user) + } + "get_user_group" => { + rpc_call!(retry_client, call, CloudService, get_user_group) + } + "get_user_group_members" => { + rpc_call!(retry_client, call, CloudService, get_user_group_members) + } + "get_user_groups" => { + rpc_call!(retry_client, call, CloudService, get_user_groups) + } + "get_users" => { + rpc_call!(retry_client, call, CloudService, get_users) + } + "remove_user_group_member" => { + rpc_call!(retry_client, call, CloudService, remove_user_group_member) + } + "rename_custom_search_attribute" => { + rpc_call!(retry_client, call, CloudService, rename_custom_search_attribute) + } + "set_user_group_namespace_access" => { + rpc_call!(retry_client, call, CloudService, set_user_group_namespace_access) + } + "set_user_namespace_access" => { + rpc_call!(retry_client, call, CloudService, set_user_namespace_access) + } + "update_account" => { + rpc_call!(retry_client, call, CloudService, update_account) + } + "update_api_key" => { + rpc_call!(retry_client, call, CloudService, update_api_key) + } + "update_namespace" => { + rpc_call!(retry_client, call, CloudService, update_namespace) + } + "update_namespace_export_sink" => { + rpc_call!(retry_client, call, CloudService, update_namespace_export_sink) + } + "update_namespace_tags" => { + rpc_call!(retry_client, call, CloudService, update_namespace_tags) + } + "update_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, update_nexus_endpoint) + } + "update_service_account" => { + rpc_call!(retry_client, call, CloudService, update_service_account) + } + "update_user" => { + rpc_call!(retry_client, call, CloudService, update_user) + } + "update_user_group" => { + rpc_call!(retry_client, call, CloudService, update_user_group) + } + "validate_namespace_export_sink" => { + rpc_call!(retry_client, call, CloudService, validate_namespace_export_sink) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } + +fn call_test_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::TestService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "get_current_time" => { + rpc_call!(retry_client, call, TestService, get_current_time) + } + "lock_time_skipping" => { + rpc_call!(retry_client, call, TestService, lock_time_skipping) + } + "sleep" => { + rpc_call!(retry_client, call, TestService, sleep) + } + "sleep_until" => { + rpc_call!(retry_client, call, TestService, sleep_until) + } + "unlock_time_skipping" => { + rpc_call!(retry_client, call, TestService, unlock_time_skipping) + } + "unlock_time_skipping_with_sleep" => { + rpc_call!(retry_client, call, TestService, unlock_time_skipping_with_sleep) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } + +fn call_health_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::HealthService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "check" => { + rpc_call!(retry_client, call, HealthService, check) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } +} \ No newline at end of file diff --git a/temporalio/bridge/src/lib.rs b/temporalio/bridge/src/lib.rs index 0281e9210..cbd5be10e 100644 --- a/temporalio/bridge/src/lib.rs +++ b/temporalio/bridge/src/lib.rs @@ -2,6 +2,7 @@ use pyo3::prelude::*; use pyo3::types::PyTuple; mod client; +mod client_rpc_generated; mod envconfig; mod metric; mod runtime; @@ -60,10 +61,7 @@ fn temporal_sdk_bridge(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { let envconfig_module = PyModule::new(py, "envconfig")?; envconfig_module.add("ConfigError", py.get_type::())?; envconfig_module.add_function(wrap_pyfunction!(envconfig::load_client_config, m)?)?; - envconfig_module.add_function(wrap_pyfunction!( - envconfig::load_client_connect_config, - m - )?)?; + envconfig_module.add_function(wrap_pyfunction!(envconfig::load_client_connect_config, m)?)?; m.add_submodule(&envconfig_module)?; Ok(()) From 8ac8f310e87f74fd59358818040e2d74736270d0 Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Thu, 25 Sep 2025 13:46:47 -0700 Subject: [PATCH 2/7] remove test log statement. Reorder gen_bridge_client.py --- scripts/gen_bridge_client.py | 76 ++++++++++++++++++------------------ temporalio/bridge/client.py | 2 - 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/scripts/gen_bridge_client.py b/scripts/gen_bridge_client.py index b15261dfd..8e9071323 100644 --- a/scripts/gen_bridge_client.py +++ b/scripts/gen_bridge_client.py @@ -14,15 +14,37 @@ import temporalio.bridge.proto.health.v1.health_pb2 as health_service -def generate_match_arm(trait_name: str, method: MethodDescriptor) -> str: - match_template = Template("""\ - "$method_name" => { - rpc_call!(retry_client, call, $trait_name, $method_name) - }""") +def generate_client_impl( + file_descriptors: list[FileDescriptor], + output_file: str = "temporalio/bridge/src/client_rpc_generated.rs", +): + print("generating bridge rpc calls") - return match_template.substitute( - method_name=pascal_to_snake(method.name), trait_name=trait_name - ) + service_calls = [ + generate_service_call(service_descriptor) + for file_descriptor in file_descriptors + for service_descriptor in file_descriptor.services_by_name.values() + ] + + impl_template = Template("""// Generated file. DO NOT EDIT + +use pyo3::exceptions::PyValueError; +use pyo3::prelude::*; + +use super::{ + client::{rpc_req, rpc_resp, ClientRef, RpcCall}, + rpc_call, +}; + +#[pymethods] +impl ClientRef { +$service_calls +}""") + + with open(output_file, "w") as f: + f.write(impl_template.substitute(service_calls="\n".join(service_calls))) + + print(f"successfully generated client at {output_file}") def generate_service_call(service_descriptor: ServiceDescriptor) -> str: @@ -75,37 +97,15 @@ def generate_service_call(service_descriptor: ServiceDescriptor) -> str: ) -def generate_client_impl( - file_descriptors: list[FileDescriptor], - output_file: str = "temporalio/bridge/src/client_rpc_generated.rs", -): - print("generating bridge rpc calls") - - service_calls = [ - generate_service_call(service_descriptor) - for file_descriptor in file_descriptors - for service_descriptor in file_descriptor.services_by_name.values() - ] - - impl_template = Template("""// Generated file. DO NOT EDIT - -use pyo3::exceptions::PyValueError; -use pyo3::prelude::*; - -use super::{ - client::{rpc_req, rpc_resp, ClientRef, RpcCall}, - rpc_call, -}; - -#[pymethods] -impl ClientRef { -$service_calls -}""") - - with open(output_file, "w") as f: - f.write(impl_template.substitute(service_calls="\n".join(service_calls))) +def generate_match_arm(trait_name: str, method: MethodDescriptor) -> str: + match_template = Template("""\ + "$method_name" => { + rpc_call!(retry_client, call, $trait_name, $method_name) + }""") - print(f"successfully generated client at {output_file}") + return match_template.substitute( + method_name=pascal_to_snake(method.name), trait_name=trait_name + ) def pascal_to_snake(input: str) -> str: diff --git a/temporalio/bridge/client.py b/temporalio/bridge/client.py index a4ae70b15..dafd6fb71 100644 --- a/temporalio/bridge/client.py +++ b/temporalio/bridge/client.py @@ -132,8 +132,6 @@ async def call( timeout_millis = round(timeout.total_seconds() * 1000) if timeout else None call = RpcCall(rpc, req.SerializeToString(), retry, metadata, timeout_millis) - print(f"calling rpc '{rpc}'") - # Do call (this throws an RPCError on failure) if service == "workflow": resp_fut = self._ref.call_workflow_service(call) From 3e01e9b12691602c8be88edc9952d6eadf2ad54b Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Mon, 29 Sep 2025 14:47:36 -0700 Subject: [PATCH 3/7] Add generation of python services. Update a couple tests to avoid relying on previous behavior but still contain the same assertions --- scripts/gen_bridge_client.py | 155 +- temporalio/bridge/services_generated.py | 3221 +++++++++++++++++++++++ temporalio/service.py | 1004 +------ tests/test_client.py | 9 +- tests/test_service.py | 14 +- tests/worker/test_update_with_start.py | 9 +- 6 files changed, 3394 insertions(+), 1018 deletions(-) create mode 100644 temporalio/bridge/services_generated.py diff --git a/scripts/gen_bridge_client.py b/scripts/gen_bridge_client.py index 8e9071323..a7fce165c 100644 --- a/scripts/gen_bridge_client.py +++ b/scripts/gen_bridge_client.py @@ -1,3 +1,4 @@ +from functools import partial import re from string import Template @@ -14,14 +15,128 @@ import temporalio.bridge.proto.health.v1.health_pb2 as health_service -def generate_client_impl( +def generate_python_services( + file_descriptors: list[FileDescriptor], + output_file: str = "temporalio/bridge/services_generated.py", +): + print("generating python services") + + services_template = Template("""# Generated file. DO NOT EDIT + +from __future__ import annotations + +from datetime import timedelta +from typing import Mapping, Optional, Union, TYPE_CHECKING +import google.protobuf.empty_pb2 + +$service_imports + + +if TYPE_CHECKING: + from temporalio.service import ServiceClient + +$service_defns +""") + + def service_name(s): + return f"import {sanitize_proto_name(s.full_name)[:-len(s.name)-1]}" + + service_imports = [ + service_name(service_descriptor) + for file_descriptor in file_descriptors + for service_descriptor in file_descriptor.services_by_name.values() + ] + + service_defns = [ + generate_python_service(service_descriptor) + for file_descriptor in file_descriptors + for service_descriptor in file_descriptor.services_by_name.values() + ] + + with open(output_file, "w") as f: + f.write( + services_template.substitute( + service_imports="\n".join(service_imports), + service_defns="\n".join(service_defns), + ) + ) + + print(f"successfully generated client at {output_file}") + + +def generate_python_service(service_descriptor: ServiceDescriptor) -> str: + service_template = Template(""" +class $service_name: + def __init__(self, client: ServiceClient): + self.client = client + self.service = "$rpc_service_name" +$method_calls +""") + + sanitized_service_name: str = service_descriptor.name + # The health service doesn't end in "Service" in the proto definition + # this check ensures that the proto descriptor name will match the format in core + if not sanitized_service_name.endswith("Service"): + sanitized_service_name += "Service" + + # remove "Service" and lowercase + rpc_name = sanitized_service_name[:-7].lower() + + # remove any streaming methods b/c we don't support them at the moment + methods = [ + method + for method in service_descriptor.methods + if not method.client_streaming and not method.server_streaming + ] + + method_calls = [ + generate_python_method_call(method) + for method in sorted(methods, key=lambda m: m.name) + ] + + return service_template.substitute( + service_name=sanitized_service_name, + rpc_service_name=pascal_to_snake(rpc_name), + method_calls="\n".join(method_calls), + ) + + +def generate_python_method_call(method_descriptor: MethodDescriptor) -> str: + method_template = Template(""" + async def $method_name( + self, + req: $request_type, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> $response_type: + print("sup from $method_name") + return await self.client._rpc_call( + rpc="$method_name", + req=req, + service=self.service, + resp_type=$response_type, + retry=retry, + metadata=metadata, + timeout=timeout, + ) +""") + + return method_template.substitute( + method_name=pascal_to_snake(method_descriptor.name), + request_type=sanitize_proto_name(method_descriptor.input_type.full_name), + response_type=sanitize_proto_name(method_descriptor.output_type.full_name), + ) + + +def generate_rust_client_impl( file_descriptors: list[FileDescriptor], output_file: str = "temporalio/bridge/src/client_rpc_generated.rs", ): print("generating bridge rpc calls") service_calls = [ - generate_service_call(service_descriptor) + generate_rust_service_call(service_descriptor) for file_descriptor in file_descriptors for service_descriptor in file_descriptor.services_by_name.values() ] @@ -47,7 +162,7 @@ def generate_client_impl( print(f"successfully generated client at {output_file}") -def generate_service_call(service_descriptor: ServiceDescriptor) -> str: +def generate_rust_service_call(service_descriptor: ServiceDescriptor) -> str: print(f"generating rpc call wrapper for {service_descriptor.full_name}") call_template = Template(""" @@ -86,7 +201,7 @@ def generate_service_call(service_descriptor: ServiceDescriptor) -> str: ] match_arms = [ - generate_match_arm(sanitized_service_name, method) + generate_rust_match_arm(sanitized_service_name, method) for method in sorted(methods, key=lambda m: m.name) ] @@ -97,7 +212,7 @@ def generate_service_call(service_descriptor: ServiceDescriptor) -> str: ) -def generate_match_arm(trait_name: str, method: MethodDescriptor) -> str: +def generate_rust_match_arm(trait_name: str, method: MethodDescriptor) -> str: match_template = Template("""\ "$method_name" => { rpc_call!(retry_client, call, $trait_name, $method_name) @@ -112,8 +227,36 @@ def pascal_to_snake(input: str) -> str: return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", input).lower() +sanitize_import_fixes = [ + partial(re.compile(r"temporal\.api\.").sub, r"temporalio.api."), + partial( + re.compile(r"temporal\.grpc.health\.").sub, r"temporalio.bridge.proto.health." + ), + partial( + re.compile(r"google\.protobuf\.Empty").sub, r"google.protobuf.empty_pb2.Empty" + ), +] + + +def sanitize_proto_name(input: str) -> str: + content = input + for fix in sanitize_import_fixes: + content = fix(content) + return content + + if __name__ == "__main__": - generate_client_impl( + generate_rust_client_impl( + [ + workflow_service.DESCRIPTOR, + operator_service.DESCRIPTOR, + cloud_service.DESCRIPTOR, + test_service.DESCRIPTOR, + health_service.DESCRIPTOR, + ] + ) + + generate_python_services( [ workflow_service.DESCRIPTOR, operator_service.DESCRIPTOR, diff --git a/temporalio/bridge/services_generated.py b/temporalio/bridge/services_generated.py new file mode 100644 index 000000000..9863b7739 --- /dev/null +++ b/temporalio/bridge/services_generated.py @@ -0,0 +1,3221 @@ +# Generated file. DO NOT EDIT + +from __future__ import annotations + +from datetime import timedelta +from typing import Mapping, Optional, Union, TYPE_CHECKING +import google.protobuf.empty_pb2 + +import temporalio.api.workflowservice.v1 +import temporalio.api.operatorservice.v1 +import temporalio.api.cloud.cloudservice.v1 +import temporalio.api.testservice.v1 +import temporalio.bridge.proto.health.v1 + + +if TYPE_CHECKING: + from temporalio.service import ServiceClient + + +class WorkflowService: + def __init__(self, client: ServiceClient): + self.client = client + self.service = "workflow" + + async def count_workflow_executions( + self, + req: temporalio.api.workflowservice.v1.CountWorkflowExecutionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.CountWorkflowExecutionsResponse: + print("sup from count_workflow_executions") + return await self.client._rpc_call( + rpc="count_workflow_executions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.CountWorkflowExecutionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_schedule( + self, + req: temporalio.api.workflowservice.v1.CreateScheduleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.CreateScheduleResponse: + print("sup from create_schedule") + return await self.client._rpc_call( + rpc="create_schedule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.CreateScheduleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_workflow_rule( + self, + req: temporalio.api.workflowservice.v1.CreateWorkflowRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.CreateWorkflowRuleResponse: + print("sup from create_workflow_rule") + return await self.client._rpc_call( + rpc="create_workflow_rule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.CreateWorkflowRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_schedule( + self, + req: temporalio.api.workflowservice.v1.DeleteScheduleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DeleteScheduleResponse: + print("sup from delete_schedule") + return await self.client._rpc_call( + rpc="delete_schedule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DeleteScheduleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_worker_deployment( + self, + req: temporalio.api.workflowservice.v1.DeleteWorkerDeploymentRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DeleteWorkerDeploymentResponse: + print("sup from delete_worker_deployment") + return await self.client._rpc_call( + rpc="delete_worker_deployment", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DeleteWorkerDeploymentResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_worker_deployment_version( + self, + req: temporalio.api.workflowservice.v1.DeleteWorkerDeploymentVersionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DeleteWorkerDeploymentVersionResponse: + print("sup from delete_worker_deployment_version") + return await self.client._rpc_call( + rpc="delete_worker_deployment_version", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DeleteWorkerDeploymentVersionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.DeleteWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DeleteWorkflowExecutionResponse: + print("sup from delete_workflow_execution") + return await self.client._rpc_call( + rpc="delete_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DeleteWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_workflow_rule( + self, + req: temporalio.api.workflowservice.v1.DeleteWorkflowRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DeleteWorkflowRuleResponse: + print("sup from delete_workflow_rule") + return await self.client._rpc_call( + rpc="delete_workflow_rule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DeleteWorkflowRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def deprecate_namespace( + self, + req: temporalio.api.workflowservice.v1.DeprecateNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DeprecateNamespaceResponse: + print("sup from deprecate_namespace") + return await self.client._rpc_call( + rpc="deprecate_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DeprecateNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_batch_operation( + self, + req: temporalio.api.workflowservice.v1.DescribeBatchOperationRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeBatchOperationResponse: + print("sup from describe_batch_operation") + return await self.client._rpc_call( + rpc="describe_batch_operation", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeBatchOperationResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_deployment( + self, + req: temporalio.api.workflowservice.v1.DescribeDeploymentRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeDeploymentResponse: + print("sup from describe_deployment") + return await self.client._rpc_call( + rpc="describe_deployment", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeDeploymentResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_namespace( + self, + req: temporalio.api.workflowservice.v1.DescribeNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeNamespaceResponse: + print("sup from describe_namespace") + return await self.client._rpc_call( + rpc="describe_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_schedule( + self, + req: temporalio.api.workflowservice.v1.DescribeScheduleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeScheduleResponse: + print("sup from describe_schedule") + return await self.client._rpc_call( + rpc="describe_schedule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeScheduleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_task_queue( + self, + req: temporalio.api.workflowservice.v1.DescribeTaskQueueRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeTaskQueueResponse: + print("sup from describe_task_queue") + return await self.client._rpc_call( + rpc="describe_task_queue", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeTaskQueueResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_worker_deployment( + self, + req: temporalio.api.workflowservice.v1.DescribeWorkerDeploymentRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeWorkerDeploymentResponse: + print("sup from describe_worker_deployment") + return await self.client._rpc_call( + rpc="describe_worker_deployment", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeWorkerDeploymentResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_worker_deployment_version( + self, + req: temporalio.api.workflowservice.v1.DescribeWorkerDeploymentVersionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeWorkerDeploymentVersionResponse: + print("sup from describe_worker_deployment_version") + return await self.client._rpc_call( + rpc="describe_worker_deployment_version", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeWorkerDeploymentVersionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.DescribeWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeWorkflowExecutionResponse: + print("sup from describe_workflow_execution") + return await self.client._rpc_call( + rpc="describe_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def describe_workflow_rule( + self, + req: temporalio.api.workflowservice.v1.DescribeWorkflowRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.DescribeWorkflowRuleResponse: + print("sup from describe_workflow_rule") + return await self.client._rpc_call( + rpc="describe_workflow_rule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.DescribeWorkflowRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def execute_multi_operation( + self, + req: temporalio.api.workflowservice.v1.ExecuteMultiOperationRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ExecuteMultiOperationResponse: + print("sup from execute_multi_operation") + return await self.client._rpc_call( + rpc="execute_multi_operation", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ExecuteMultiOperationResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def fetch_worker_config( + self, + req: temporalio.api.workflowservice.v1.FetchWorkerConfigRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.FetchWorkerConfigResponse: + print("sup from fetch_worker_config") + return await self.client._rpc_call( + rpc="fetch_worker_config", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.FetchWorkerConfigResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_cluster_info( + self, + req: temporalio.api.workflowservice.v1.GetClusterInfoRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetClusterInfoResponse: + print("sup from get_cluster_info") + return await self.client._rpc_call( + rpc="get_cluster_info", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetClusterInfoResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_current_deployment( + self, + req: temporalio.api.workflowservice.v1.GetCurrentDeploymentRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetCurrentDeploymentResponse: + print("sup from get_current_deployment") + return await self.client._rpc_call( + rpc="get_current_deployment", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetCurrentDeploymentResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_deployment_reachability( + self, + req: temporalio.api.workflowservice.v1.GetDeploymentReachabilityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetDeploymentReachabilityResponse: + print("sup from get_deployment_reachability") + return await self.client._rpc_call( + rpc="get_deployment_reachability", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetDeploymentReachabilityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_search_attributes( + self, + req: temporalio.api.workflowservice.v1.GetSearchAttributesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetSearchAttributesResponse: + print("sup from get_search_attributes") + return await self.client._rpc_call( + rpc="get_search_attributes", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetSearchAttributesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_system_info( + self, + req: temporalio.api.workflowservice.v1.GetSystemInfoRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetSystemInfoResponse: + print("sup from get_system_info") + return await self.client._rpc_call( + rpc="get_system_info", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetSystemInfoResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_worker_build_id_compatibility( + self, + req: temporalio.api.workflowservice.v1.GetWorkerBuildIdCompatibilityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse: + print("sup from get_worker_build_id_compatibility") + return await self.client._rpc_call( + rpc="get_worker_build_id_compatibility", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_worker_task_reachability( + self, + req: temporalio.api.workflowservice.v1.GetWorkerTaskReachabilityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetWorkerTaskReachabilityResponse: + print("sup from get_worker_task_reachability") + return await self.client._rpc_call( + rpc="get_worker_task_reachability", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetWorkerTaskReachabilityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_worker_versioning_rules( + self, + req: temporalio.api.workflowservice.v1.GetWorkerVersioningRulesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetWorkerVersioningRulesResponse: + print("sup from get_worker_versioning_rules") + return await self.client._rpc_call( + rpc="get_worker_versioning_rules", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetWorkerVersioningRulesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_workflow_execution_history( + self, + req: temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryResponse: + print("sup from get_workflow_execution_history") + return await self.client._rpc_call( + rpc="get_workflow_execution_history", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_workflow_execution_history_reverse( + self, + req: temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseResponse: + print("sup from get_workflow_execution_history_reverse") + return await self.client._rpc_call( + rpc="get_workflow_execution_history_reverse", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_archived_workflow_executions( + self, + req: temporalio.api.workflowservice.v1.ListArchivedWorkflowExecutionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListArchivedWorkflowExecutionsResponse: + print("sup from list_archived_workflow_executions") + return await self.client._rpc_call( + rpc="list_archived_workflow_executions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListArchivedWorkflowExecutionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_batch_operations( + self, + req: temporalio.api.workflowservice.v1.ListBatchOperationsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListBatchOperationsResponse: + print("sup from list_batch_operations") + return await self.client._rpc_call( + rpc="list_batch_operations", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListBatchOperationsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_closed_workflow_executions( + self, + req: temporalio.api.workflowservice.v1.ListClosedWorkflowExecutionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListClosedWorkflowExecutionsResponse: + print("sup from list_closed_workflow_executions") + return await self.client._rpc_call( + rpc="list_closed_workflow_executions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListClosedWorkflowExecutionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_deployments( + self, + req: temporalio.api.workflowservice.v1.ListDeploymentsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListDeploymentsResponse: + print("sup from list_deployments") + return await self.client._rpc_call( + rpc="list_deployments", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListDeploymentsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_namespaces( + self, + req: temporalio.api.workflowservice.v1.ListNamespacesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListNamespacesResponse: + print("sup from list_namespaces") + return await self.client._rpc_call( + rpc="list_namespaces", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListNamespacesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_open_workflow_executions( + self, + req: temporalio.api.workflowservice.v1.ListOpenWorkflowExecutionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListOpenWorkflowExecutionsResponse: + print("sup from list_open_workflow_executions") + return await self.client._rpc_call( + rpc="list_open_workflow_executions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListOpenWorkflowExecutionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_schedule_matching_times( + self, + req: temporalio.api.workflowservice.v1.ListScheduleMatchingTimesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListScheduleMatchingTimesResponse: + print("sup from list_schedule_matching_times") + return await self.client._rpc_call( + rpc="list_schedule_matching_times", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListScheduleMatchingTimesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_schedules( + self, + req: temporalio.api.workflowservice.v1.ListSchedulesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListSchedulesResponse: + print("sup from list_schedules") + return await self.client._rpc_call( + rpc="list_schedules", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListSchedulesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_task_queue_partitions( + self, + req: temporalio.api.workflowservice.v1.ListTaskQueuePartitionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListTaskQueuePartitionsResponse: + print("sup from list_task_queue_partitions") + return await self.client._rpc_call( + rpc="list_task_queue_partitions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListTaskQueuePartitionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_worker_deployments( + self, + req: temporalio.api.workflowservice.v1.ListWorkerDeploymentsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListWorkerDeploymentsResponse: + print("sup from list_worker_deployments") + return await self.client._rpc_call( + rpc="list_worker_deployments", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListWorkerDeploymentsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_workers( + self, + req: temporalio.api.workflowservice.v1.ListWorkersRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListWorkersResponse: + print("sup from list_workers") + return await self.client._rpc_call( + rpc="list_workers", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListWorkersResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_workflow_executions( + self, + req: temporalio.api.workflowservice.v1.ListWorkflowExecutionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListWorkflowExecutionsResponse: + print("sup from list_workflow_executions") + return await self.client._rpc_call( + rpc="list_workflow_executions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListWorkflowExecutionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_workflow_rules( + self, + req: temporalio.api.workflowservice.v1.ListWorkflowRulesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ListWorkflowRulesResponse: + print("sup from list_workflow_rules") + return await self.client._rpc_call( + rpc="list_workflow_rules", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ListWorkflowRulesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def patch_schedule( + self, + req: temporalio.api.workflowservice.v1.PatchScheduleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.PatchScheduleResponse: + print("sup from patch_schedule") + return await self.client._rpc_call( + rpc="patch_schedule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.PatchScheduleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def pause_activity( + self, + req: temporalio.api.workflowservice.v1.PauseActivityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.PauseActivityResponse: + print("sup from pause_activity") + return await self.client._rpc_call( + rpc="pause_activity", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.PauseActivityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def poll_activity_task_queue( + self, + req: temporalio.api.workflowservice.v1.PollActivityTaskQueueRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.PollActivityTaskQueueResponse: + print("sup from poll_activity_task_queue") + return await self.client._rpc_call( + rpc="poll_activity_task_queue", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.PollActivityTaskQueueResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def poll_nexus_task_queue( + self, + req: temporalio.api.workflowservice.v1.PollNexusTaskQueueRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.PollNexusTaskQueueResponse: + print("sup from poll_nexus_task_queue") + return await self.client._rpc_call( + rpc="poll_nexus_task_queue", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.PollNexusTaskQueueResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def poll_workflow_execution_update( + self, + req: temporalio.api.workflowservice.v1.PollWorkflowExecutionUpdateRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.PollWorkflowExecutionUpdateResponse: + print("sup from poll_workflow_execution_update") + return await self.client._rpc_call( + rpc="poll_workflow_execution_update", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.PollWorkflowExecutionUpdateResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def poll_workflow_task_queue( + self, + req: temporalio.api.workflowservice.v1.PollWorkflowTaskQueueRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.PollWorkflowTaskQueueResponse: + print("sup from poll_workflow_task_queue") + return await self.client._rpc_call( + rpc="poll_workflow_task_queue", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.PollWorkflowTaskQueueResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def query_workflow( + self, + req: temporalio.api.workflowservice.v1.QueryWorkflowRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.QueryWorkflowResponse: + print("sup from query_workflow") + return await self.client._rpc_call( + rpc="query_workflow", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.QueryWorkflowResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def record_activity_task_heartbeat( + self, + req: temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatResponse: + print("sup from record_activity_task_heartbeat") + return await self.client._rpc_call( + rpc="record_activity_task_heartbeat", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def record_activity_task_heartbeat_by_id( + self, + req: temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdResponse: + print("sup from record_activity_task_heartbeat_by_id") + return await self.client._rpc_call( + rpc="record_activity_task_heartbeat_by_id", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def record_worker_heartbeat( + self, + req: temporalio.api.workflowservice.v1.RecordWorkerHeartbeatRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RecordWorkerHeartbeatResponse: + print("sup from record_worker_heartbeat") + return await self.client._rpc_call( + rpc="record_worker_heartbeat", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RecordWorkerHeartbeatResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def register_namespace( + self, + req: temporalio.api.workflowservice.v1.RegisterNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RegisterNamespaceResponse: + print("sup from register_namespace") + return await self.client._rpc_call( + rpc="register_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RegisterNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def request_cancel_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.RequestCancelWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse: + print("sup from request_cancel_workflow_execution") + return await self.client._rpc_call( + rpc="request_cancel_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def reset_activity( + self, + req: temporalio.api.workflowservice.v1.ResetActivityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ResetActivityResponse: + print("sup from reset_activity") + return await self.client._rpc_call( + rpc="reset_activity", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ResetActivityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def reset_sticky_task_queue( + self, + req: temporalio.api.workflowservice.v1.ResetStickyTaskQueueRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ResetStickyTaskQueueResponse: + print("sup from reset_sticky_task_queue") + return await self.client._rpc_call( + rpc="reset_sticky_task_queue", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ResetStickyTaskQueueResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def reset_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.ResetWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ResetWorkflowExecutionResponse: + print("sup from reset_workflow_execution") + return await self.client._rpc_call( + rpc="reset_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ResetWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_activity_task_canceled( + self, + req: temporalio.api.workflowservice.v1.RespondActivityTaskCanceledRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCanceledResponse: + print("sup from respond_activity_task_canceled") + return await self.client._rpc_call( + rpc="respond_activity_task_canceled", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondActivityTaskCanceledResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_activity_task_canceled_by_id( + self, + req: temporalio.api.workflowservice.v1.RespondActivityTaskCanceledByIdRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCanceledByIdResponse: + print("sup from respond_activity_task_canceled_by_id") + return await self.client._rpc_call( + rpc="respond_activity_task_canceled_by_id", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondActivityTaskCanceledByIdResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_activity_task_completed( + self, + req: temporalio.api.workflowservice.v1.RespondActivityTaskCompletedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCompletedResponse: + print("sup from respond_activity_task_completed") + return await self.client._rpc_call( + rpc="respond_activity_task_completed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondActivityTaskCompletedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_activity_task_completed_by_id( + self, + req: temporalio.api.workflowservice.v1.RespondActivityTaskCompletedByIdRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCompletedByIdResponse: + print("sup from respond_activity_task_completed_by_id") + return await self.client._rpc_call( + rpc="respond_activity_task_completed_by_id", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondActivityTaskCompletedByIdResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_activity_task_failed( + self, + req: temporalio.api.workflowservice.v1.RespondActivityTaskFailedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondActivityTaskFailedResponse: + print("sup from respond_activity_task_failed") + return await self.client._rpc_call( + rpc="respond_activity_task_failed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondActivityTaskFailedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_activity_task_failed_by_id( + self, + req: temporalio.api.workflowservice.v1.RespondActivityTaskFailedByIdRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondActivityTaskFailedByIdResponse: + print("sup from respond_activity_task_failed_by_id") + return await self.client._rpc_call( + rpc="respond_activity_task_failed_by_id", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondActivityTaskFailedByIdResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_nexus_task_completed( + self, + req: temporalio.api.workflowservice.v1.RespondNexusTaskCompletedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondNexusTaskCompletedResponse: + print("sup from respond_nexus_task_completed") + return await self.client._rpc_call( + rpc="respond_nexus_task_completed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondNexusTaskCompletedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_nexus_task_failed( + self, + req: temporalio.api.workflowservice.v1.RespondNexusTaskFailedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondNexusTaskFailedResponse: + print("sup from respond_nexus_task_failed") + return await self.client._rpc_call( + rpc="respond_nexus_task_failed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondNexusTaskFailedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_query_task_completed( + self, + req: temporalio.api.workflowservice.v1.RespondQueryTaskCompletedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondQueryTaskCompletedResponse: + print("sup from respond_query_task_completed") + return await self.client._rpc_call( + rpc="respond_query_task_completed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondQueryTaskCompletedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_workflow_task_completed( + self, + req: temporalio.api.workflowservice.v1.RespondWorkflowTaskCompletedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondWorkflowTaskCompletedResponse: + print("sup from respond_workflow_task_completed") + return await self.client._rpc_call( + rpc="respond_workflow_task_completed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondWorkflowTaskCompletedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def respond_workflow_task_failed( + self, + req: temporalio.api.workflowservice.v1.RespondWorkflowTaskFailedRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.RespondWorkflowTaskFailedResponse: + print("sup from respond_workflow_task_failed") + return await self.client._rpc_call( + rpc="respond_workflow_task_failed", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.RespondWorkflowTaskFailedResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def scan_workflow_executions( + self, + req: temporalio.api.workflowservice.v1.ScanWorkflowExecutionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ScanWorkflowExecutionsResponse: + print("sup from scan_workflow_executions") + return await self.client._rpc_call( + rpc="scan_workflow_executions", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ScanWorkflowExecutionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def set_current_deployment( + self, + req: temporalio.api.workflowservice.v1.SetCurrentDeploymentRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.SetCurrentDeploymentResponse: + print("sup from set_current_deployment") + return await self.client._rpc_call( + rpc="set_current_deployment", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.SetCurrentDeploymentResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def set_worker_deployment_current_version( + self, + req: temporalio.api.workflowservice.v1.SetWorkerDeploymentCurrentVersionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.SetWorkerDeploymentCurrentVersionResponse: + print("sup from set_worker_deployment_current_version") + return await self.client._rpc_call( + rpc="set_worker_deployment_current_version", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.SetWorkerDeploymentCurrentVersionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def set_worker_deployment_ramping_version( + self, + req: temporalio.api.workflowservice.v1.SetWorkerDeploymentRampingVersionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.SetWorkerDeploymentRampingVersionResponse: + print("sup from set_worker_deployment_ramping_version") + return await self.client._rpc_call( + rpc="set_worker_deployment_ramping_version", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.SetWorkerDeploymentRampingVersionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def shutdown_worker( + self, + req: temporalio.api.workflowservice.v1.ShutdownWorkerRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.ShutdownWorkerResponse: + print("sup from shutdown_worker") + return await self.client._rpc_call( + rpc="shutdown_worker", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.ShutdownWorkerResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def signal_with_start_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse: + print("sup from signal_with_start_workflow_execution") + return await self.client._rpc_call( + rpc="signal_with_start_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def signal_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.SignalWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.SignalWorkflowExecutionResponse: + print("sup from signal_workflow_execution") + return await self.client._rpc_call( + rpc="signal_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.SignalWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def start_batch_operation( + self, + req: temporalio.api.workflowservice.v1.StartBatchOperationRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.StartBatchOperationResponse: + print("sup from start_batch_operation") + return await self.client._rpc_call( + rpc="start_batch_operation", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.StartBatchOperationResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def start_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.StartWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.StartWorkflowExecutionResponse: + print("sup from start_workflow_execution") + return await self.client._rpc_call( + rpc="start_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.StartWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def stop_batch_operation( + self, + req: temporalio.api.workflowservice.v1.StopBatchOperationRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.StopBatchOperationResponse: + print("sup from stop_batch_operation") + return await self.client._rpc_call( + rpc="stop_batch_operation", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.StopBatchOperationResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def terminate_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.TerminateWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.TerminateWorkflowExecutionResponse: + print("sup from terminate_workflow_execution") + return await self.client._rpc_call( + rpc="terminate_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.TerminateWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def trigger_workflow_rule( + self, + req: temporalio.api.workflowservice.v1.TriggerWorkflowRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.TriggerWorkflowRuleResponse: + print("sup from trigger_workflow_rule") + return await self.client._rpc_call( + rpc="trigger_workflow_rule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.TriggerWorkflowRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def unpause_activity( + self, + req: temporalio.api.workflowservice.v1.UnpauseActivityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UnpauseActivityResponse: + print("sup from unpause_activity") + return await self.client._rpc_call( + rpc="unpause_activity", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UnpauseActivityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_activity_options( + self, + req: temporalio.api.workflowservice.v1.UpdateActivityOptionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateActivityOptionsResponse: + print("sup from update_activity_options") + return await self.client._rpc_call( + rpc="update_activity_options", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateActivityOptionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_namespace( + self, + req: temporalio.api.workflowservice.v1.UpdateNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateNamespaceResponse: + print("sup from update_namespace") + return await self.client._rpc_call( + rpc="update_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_schedule( + self, + req: temporalio.api.workflowservice.v1.UpdateScheduleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateScheduleResponse: + print("sup from update_schedule") + return await self.client._rpc_call( + rpc="update_schedule", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateScheduleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_task_queue_config( + self, + req: temporalio.api.workflowservice.v1.UpdateTaskQueueConfigRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateTaskQueueConfigResponse: + print("sup from update_task_queue_config") + return await self.client._rpc_call( + rpc="update_task_queue_config", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateTaskQueueConfigResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_worker_build_id_compatibility( + self, + req: temporalio.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityResponse: + print("sup from update_worker_build_id_compatibility") + return await self.client._rpc_call( + rpc="update_worker_build_id_compatibility", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_worker_config( + self, + req: temporalio.api.workflowservice.v1.UpdateWorkerConfigRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateWorkerConfigResponse: + print("sup from update_worker_config") + return await self.client._rpc_call( + rpc="update_worker_config", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateWorkerConfigResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_worker_deployment_version_metadata( + self, + req: temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataResponse: + print("sup from update_worker_deployment_version_metadata") + return await self.client._rpc_call( + rpc="update_worker_deployment_version_metadata", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_worker_versioning_rules( + self, + req: temporalio.api.workflowservice.v1.UpdateWorkerVersioningRulesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateWorkerVersioningRulesResponse: + print("sup from update_worker_versioning_rules") + return await self.client._rpc_call( + rpc="update_worker_versioning_rules", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateWorkerVersioningRulesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_workflow_execution( + self, + req: temporalio.api.workflowservice.v1.UpdateWorkflowExecutionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateWorkflowExecutionResponse: + print("sup from update_workflow_execution") + return await self.client._rpc_call( + rpc="update_workflow_execution", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateWorkflowExecutionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_workflow_execution_options( + self, + req: temporalio.api.workflowservice.v1.UpdateWorkflowExecutionOptionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.workflowservice.v1.UpdateWorkflowExecutionOptionsResponse: + print("sup from update_workflow_execution_options") + return await self.client._rpc_call( + rpc="update_workflow_execution_options", + req=req, + service=self.service, + resp_type=temporalio.api.workflowservice.v1.UpdateWorkflowExecutionOptionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + +class OperatorService: + def __init__(self, client: ServiceClient): + self.client = client + self.service = "operator" + + async def add_or_update_remote_cluster( + self, + req: temporalio.api.operatorservice.v1.AddOrUpdateRemoteClusterRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.AddOrUpdateRemoteClusterResponse: + print("sup from add_or_update_remote_cluster") + return await self.client._rpc_call( + rpc="add_or_update_remote_cluster", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.AddOrUpdateRemoteClusterResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def add_search_attributes( + self, + req: temporalio.api.operatorservice.v1.AddSearchAttributesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.AddSearchAttributesResponse: + print("sup from add_search_attributes") + return await self.client._rpc_call( + rpc="add_search_attributes", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.AddSearchAttributesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_nexus_endpoint( + self, + req: temporalio.api.operatorservice.v1.CreateNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.CreateNexusEndpointResponse: + print("sup from create_nexus_endpoint") + return await self.client._rpc_call( + rpc="create_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.CreateNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_namespace( + self, + req: temporalio.api.operatorservice.v1.DeleteNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.DeleteNamespaceResponse: + print("sup from delete_namespace") + return await self.client._rpc_call( + rpc="delete_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.DeleteNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_nexus_endpoint( + self, + req: temporalio.api.operatorservice.v1.DeleteNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.DeleteNexusEndpointResponse: + print("sup from delete_nexus_endpoint") + return await self.client._rpc_call( + rpc="delete_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.DeleteNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_nexus_endpoint( + self, + req: temporalio.api.operatorservice.v1.GetNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.GetNexusEndpointResponse: + print("sup from get_nexus_endpoint") + return await self.client._rpc_call( + rpc="get_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.GetNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_clusters( + self, + req: temporalio.api.operatorservice.v1.ListClustersRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.ListClustersResponse: + print("sup from list_clusters") + return await self.client._rpc_call( + rpc="list_clusters", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.ListClustersResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_nexus_endpoints( + self, + req: temporalio.api.operatorservice.v1.ListNexusEndpointsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.ListNexusEndpointsResponse: + print("sup from list_nexus_endpoints") + return await self.client._rpc_call( + rpc="list_nexus_endpoints", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.ListNexusEndpointsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def list_search_attributes( + self, + req: temporalio.api.operatorservice.v1.ListSearchAttributesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.ListSearchAttributesResponse: + print("sup from list_search_attributes") + return await self.client._rpc_call( + rpc="list_search_attributes", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.ListSearchAttributesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def remove_remote_cluster( + self, + req: temporalio.api.operatorservice.v1.RemoveRemoteClusterRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.RemoveRemoteClusterResponse: + print("sup from remove_remote_cluster") + return await self.client._rpc_call( + rpc="remove_remote_cluster", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.RemoveRemoteClusterResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def remove_search_attributes( + self, + req: temporalio.api.operatorservice.v1.RemoveSearchAttributesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.RemoveSearchAttributesResponse: + print("sup from remove_search_attributes") + return await self.client._rpc_call( + rpc="remove_search_attributes", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.RemoveSearchAttributesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_nexus_endpoint( + self, + req: temporalio.api.operatorservice.v1.UpdateNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.operatorservice.v1.UpdateNexusEndpointResponse: + print("sup from update_nexus_endpoint") + return await self.client._rpc_call( + rpc="update_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.operatorservice.v1.UpdateNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + +class CloudService: + def __init__(self, client: ServiceClient): + self.client = client + self.service = "cloud" + + async def add_namespace_region( + self, + req: temporalio.api.cloud.cloudservice.v1.AddNamespaceRegionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.AddNamespaceRegionResponse: + print("sup from add_namespace_region") + return await self.client._rpc_call( + rpc="add_namespace_region", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.AddNamespaceRegionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def add_user_group_member( + self, + req: temporalio.api.cloud.cloudservice.v1.AddUserGroupMemberRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.AddUserGroupMemberResponse: + print("sup from add_user_group_member") + return await self.client._rpc_call( + rpc="add_user_group_member", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.AddUserGroupMemberResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_api_key( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateApiKeyRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateApiKeyResponse: + print("sup from create_api_key") + return await self.client._rpc_call( + rpc="create_api_key", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateApiKeyResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_connectivity_rule( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateConnectivityRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateConnectivityRuleResponse: + print("sup from create_connectivity_rule") + return await self.client._rpc_call( + rpc="create_connectivity_rule", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateConnectivityRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_namespace( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateNamespaceResponse: + print("sup from create_namespace") + return await self.client._rpc_call( + rpc="create_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_namespace_export_sink( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateNamespaceExportSinkRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateNamespaceExportSinkResponse: + print("sup from create_namespace_export_sink") + return await self.client._rpc_call( + rpc="create_namespace_export_sink", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateNamespaceExportSinkResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_nexus_endpoint( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateNexusEndpointResponse: + print("sup from create_nexus_endpoint") + return await self.client._rpc_call( + rpc="create_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_service_account( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateServiceAccountRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateServiceAccountResponse: + print("sup from create_service_account") + return await self.client._rpc_call( + rpc="create_service_account", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateServiceAccountResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_user( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateUserRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateUserResponse: + print("sup from create_user") + return await self.client._rpc_call( + rpc="create_user", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateUserResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def create_user_group( + self, + req: temporalio.api.cloud.cloudservice.v1.CreateUserGroupRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.CreateUserGroupResponse: + print("sup from create_user_group") + return await self.client._rpc_call( + rpc="create_user_group", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.CreateUserGroupResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_api_key( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteApiKeyRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteApiKeyResponse: + print("sup from delete_api_key") + return await self.client._rpc_call( + rpc="delete_api_key", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteApiKeyResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_connectivity_rule( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteConnectivityRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteConnectivityRuleResponse: + print("sup from delete_connectivity_rule") + return await self.client._rpc_call( + rpc="delete_connectivity_rule", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteConnectivityRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_namespace( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteNamespaceResponse: + print("sup from delete_namespace") + return await self.client._rpc_call( + rpc="delete_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_namespace_export_sink( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteNamespaceExportSinkRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteNamespaceExportSinkResponse: + print("sup from delete_namespace_export_sink") + return await self.client._rpc_call( + rpc="delete_namespace_export_sink", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteNamespaceExportSinkResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_namespace_region( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRegionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRegionResponse: + print("sup from delete_namespace_region") + return await self.client._rpc_call( + rpc="delete_namespace_region", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRegionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_nexus_endpoint( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteNexusEndpointResponse: + print("sup from delete_nexus_endpoint") + return await self.client._rpc_call( + rpc="delete_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_service_account( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteServiceAccountRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteServiceAccountResponse: + print("sup from delete_service_account") + return await self.client._rpc_call( + rpc="delete_service_account", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteServiceAccountResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_user( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteUserRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteUserResponse: + print("sup from delete_user") + return await self.client._rpc_call( + rpc="delete_user", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteUserResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def delete_user_group( + self, + req: temporalio.api.cloud.cloudservice.v1.DeleteUserGroupRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.DeleteUserGroupResponse: + print("sup from delete_user_group") + return await self.client._rpc_call( + rpc="delete_user_group", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.DeleteUserGroupResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def failover_namespace_region( + self, + req: temporalio.api.cloud.cloudservice.v1.FailoverNamespaceRegionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.FailoverNamespaceRegionResponse: + print("sup from failover_namespace_region") + return await self.client._rpc_call( + rpc="failover_namespace_region", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.FailoverNamespaceRegionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_account( + self, + req: temporalio.api.cloud.cloudservice.v1.GetAccountRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetAccountResponse: + print("sup from get_account") + return await self.client._rpc_call( + rpc="get_account", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetAccountResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_api_key( + self, + req: temporalio.api.cloud.cloudservice.v1.GetApiKeyRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetApiKeyResponse: + print("sup from get_api_key") + return await self.client._rpc_call( + rpc="get_api_key", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetApiKeyResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_api_keys( + self, + req: temporalio.api.cloud.cloudservice.v1.GetApiKeysRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetApiKeysResponse: + print("sup from get_api_keys") + return await self.client._rpc_call( + rpc="get_api_keys", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetApiKeysResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_async_operation( + self, + req: temporalio.api.cloud.cloudservice.v1.GetAsyncOperationRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetAsyncOperationResponse: + print("sup from get_async_operation") + return await self.client._rpc_call( + rpc="get_async_operation", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetAsyncOperationResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_connectivity_rule( + self, + req: temporalio.api.cloud.cloudservice.v1.GetConnectivityRuleRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetConnectivityRuleResponse: + print("sup from get_connectivity_rule") + return await self.client._rpc_call( + rpc="get_connectivity_rule", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetConnectivityRuleResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_connectivity_rules( + self, + req: temporalio.api.cloud.cloudservice.v1.GetConnectivityRulesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetConnectivityRulesResponse: + print("sup from get_connectivity_rules") + return await self.client._rpc_call( + rpc="get_connectivity_rules", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetConnectivityRulesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_namespace( + self, + req: temporalio.api.cloud.cloudservice.v1.GetNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetNamespaceResponse: + print("sup from get_namespace") + return await self.client._rpc_call( + rpc="get_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_namespace_export_sink( + self, + req: temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinkRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinkResponse: + print("sup from get_namespace_export_sink") + return await self.client._rpc_call( + rpc="get_namespace_export_sink", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinkResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_namespace_export_sinks( + self, + req: temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinksRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinksResponse: + print("sup from get_namespace_export_sinks") + return await self.client._rpc_call( + rpc="get_namespace_export_sinks", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinksResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_namespaces( + self, + req: temporalio.api.cloud.cloudservice.v1.GetNamespacesRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetNamespacesResponse: + print("sup from get_namespaces") + return await self.client._rpc_call( + rpc="get_namespaces", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetNamespacesResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_nexus_endpoint( + self, + req: temporalio.api.cloud.cloudservice.v1.GetNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetNexusEndpointResponse: + print("sup from get_nexus_endpoint") + return await self.client._rpc_call( + rpc="get_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_nexus_endpoints( + self, + req: temporalio.api.cloud.cloudservice.v1.GetNexusEndpointsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetNexusEndpointsResponse: + print("sup from get_nexus_endpoints") + return await self.client._rpc_call( + rpc="get_nexus_endpoints", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetNexusEndpointsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_region( + self, + req: temporalio.api.cloud.cloudservice.v1.GetRegionRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetRegionResponse: + print("sup from get_region") + return await self.client._rpc_call( + rpc="get_region", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetRegionResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_regions( + self, + req: temporalio.api.cloud.cloudservice.v1.GetRegionsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetRegionsResponse: + print("sup from get_regions") + return await self.client._rpc_call( + rpc="get_regions", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetRegionsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_service_account( + self, + req: temporalio.api.cloud.cloudservice.v1.GetServiceAccountRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetServiceAccountResponse: + print("sup from get_service_account") + return await self.client._rpc_call( + rpc="get_service_account", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetServiceAccountResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_service_accounts( + self, + req: temporalio.api.cloud.cloudservice.v1.GetServiceAccountsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetServiceAccountsResponse: + print("sup from get_service_accounts") + return await self.client._rpc_call( + rpc="get_service_accounts", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetServiceAccountsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_usage( + self, + req: temporalio.api.cloud.cloudservice.v1.GetUsageRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetUsageResponse: + print("sup from get_usage") + return await self.client._rpc_call( + rpc="get_usage", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetUsageResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_user( + self, + req: temporalio.api.cloud.cloudservice.v1.GetUserRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetUserResponse: + print("sup from get_user") + return await self.client._rpc_call( + rpc="get_user", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetUserResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_user_group( + self, + req: temporalio.api.cloud.cloudservice.v1.GetUserGroupRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetUserGroupResponse: + print("sup from get_user_group") + return await self.client._rpc_call( + rpc="get_user_group", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetUserGroupResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_user_group_members( + self, + req: temporalio.api.cloud.cloudservice.v1.GetUserGroupMembersRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetUserGroupMembersResponse: + print("sup from get_user_group_members") + return await self.client._rpc_call( + rpc="get_user_group_members", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetUserGroupMembersResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_user_groups( + self, + req: temporalio.api.cloud.cloudservice.v1.GetUserGroupsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetUserGroupsResponse: + print("sup from get_user_groups") + return await self.client._rpc_call( + rpc="get_user_groups", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetUserGroupsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def get_users( + self, + req: temporalio.api.cloud.cloudservice.v1.GetUsersRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.GetUsersResponse: + print("sup from get_users") + return await self.client._rpc_call( + rpc="get_users", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.GetUsersResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def remove_user_group_member( + self, + req: temporalio.api.cloud.cloudservice.v1.RemoveUserGroupMemberRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.RemoveUserGroupMemberResponse: + print("sup from remove_user_group_member") + return await self.client._rpc_call( + rpc="remove_user_group_member", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.RemoveUserGroupMemberResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def rename_custom_search_attribute( + self, + req: temporalio.api.cloud.cloudservice.v1.RenameCustomSearchAttributeRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.RenameCustomSearchAttributeResponse: + print("sup from rename_custom_search_attribute") + return await self.client._rpc_call( + rpc="rename_custom_search_attribute", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.RenameCustomSearchAttributeResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def set_user_group_namespace_access( + self, + req: temporalio.api.cloud.cloudservice.v1.SetUserGroupNamespaceAccessRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.SetUserGroupNamespaceAccessResponse: + print("sup from set_user_group_namespace_access") + return await self.client._rpc_call( + rpc="set_user_group_namespace_access", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.SetUserGroupNamespaceAccessResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def set_user_namespace_access( + self, + req: temporalio.api.cloud.cloudservice.v1.SetUserNamespaceAccessRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.SetUserNamespaceAccessResponse: + print("sup from set_user_namespace_access") + return await self.client._rpc_call( + rpc="set_user_namespace_access", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.SetUserNamespaceAccessResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_account( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateAccountRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateAccountResponse: + print("sup from update_account") + return await self.client._rpc_call( + rpc="update_account", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateAccountResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_api_key( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateApiKeyRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateApiKeyResponse: + print("sup from update_api_key") + return await self.client._rpc_call( + rpc="update_api_key", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateApiKeyResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_namespace( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateNamespaceRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateNamespaceResponse: + print("sup from update_namespace") + return await self.client._rpc_call( + rpc="update_namespace", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateNamespaceResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_namespace_export_sink( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateNamespaceExportSinkRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateNamespaceExportSinkResponse: + print("sup from update_namespace_export_sink") + return await self.client._rpc_call( + rpc="update_namespace_export_sink", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateNamespaceExportSinkResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_namespace_tags( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateNamespaceTagsRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateNamespaceTagsResponse: + print("sup from update_namespace_tags") + return await self.client._rpc_call( + rpc="update_namespace_tags", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateNamespaceTagsResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_nexus_endpoint( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateNexusEndpointRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateNexusEndpointResponse: + print("sup from update_nexus_endpoint") + return await self.client._rpc_call( + rpc="update_nexus_endpoint", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateNexusEndpointResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_service_account( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateServiceAccountRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateServiceAccountResponse: + print("sup from update_service_account") + return await self.client._rpc_call( + rpc="update_service_account", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateServiceAccountResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_user( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateUserRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateUserResponse: + print("sup from update_user") + return await self.client._rpc_call( + rpc="update_user", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateUserResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def update_user_group( + self, + req: temporalio.api.cloud.cloudservice.v1.UpdateUserGroupRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.UpdateUserGroupResponse: + print("sup from update_user_group") + return await self.client._rpc_call( + rpc="update_user_group", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.UpdateUserGroupResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def validate_namespace_export_sink( + self, + req: temporalio.api.cloud.cloudservice.v1.ValidateNamespaceExportSinkRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.cloud.cloudservice.v1.ValidateNamespaceExportSinkResponse: + print("sup from validate_namespace_export_sink") + return await self.client._rpc_call( + rpc="validate_namespace_export_sink", + req=req, + service=self.service, + resp_type=temporalio.api.cloud.cloudservice.v1.ValidateNamespaceExportSinkResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + +class TestService: + def __init__(self, client: ServiceClient): + self.client = client + self.service = "test" + + async def get_current_time( + self, + req: google.protobuf.empty_pb2.Empty, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.testservice.v1.GetCurrentTimeResponse: + print("sup from get_current_time") + return await self.client._rpc_call( + rpc="get_current_time", + req=req, + service=self.service, + resp_type=temporalio.api.testservice.v1.GetCurrentTimeResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def lock_time_skipping( + self, + req: temporalio.api.testservice.v1.LockTimeSkippingRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.testservice.v1.LockTimeSkippingResponse: + print("sup from lock_time_skipping") + return await self.client._rpc_call( + rpc="lock_time_skipping", + req=req, + service=self.service, + resp_type=temporalio.api.testservice.v1.LockTimeSkippingResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def sleep( + self, + req: temporalio.api.testservice.v1.SleepRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.testservice.v1.SleepResponse: + print("sup from sleep") + return await self.client._rpc_call( + rpc="sleep", + req=req, + service=self.service, + resp_type=temporalio.api.testservice.v1.SleepResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def sleep_until( + self, + req: temporalio.api.testservice.v1.SleepUntilRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.testservice.v1.SleepResponse: + print("sup from sleep_until") + return await self.client._rpc_call( + rpc="sleep_until", + req=req, + service=self.service, + resp_type=temporalio.api.testservice.v1.SleepResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def unlock_time_skipping( + self, + req: temporalio.api.testservice.v1.UnlockTimeSkippingRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.testservice.v1.UnlockTimeSkippingResponse: + print("sup from unlock_time_skipping") + return await self.client._rpc_call( + rpc="unlock_time_skipping", + req=req, + service=self.service, + resp_type=temporalio.api.testservice.v1.UnlockTimeSkippingResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + async def unlock_time_skipping_with_sleep( + self, + req: temporalio.api.testservice.v1.SleepRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.api.testservice.v1.SleepResponse: + print("sup from unlock_time_skipping_with_sleep") + return await self.client._rpc_call( + rpc="unlock_time_skipping_with_sleep", + req=req, + service=self.service, + resp_type=temporalio.api.testservice.v1.SleepResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + + +class HealthService: + def __init__(self, client: ServiceClient): + self.client = client + self.service = "health" + + async def check( + self, + req: temporalio.bridge.proto.health.v1.HealthCheckRequest, + retry: bool = False, + metadata: Mapping[str, Union[str, bytes]] = {}, + timeout: Optional[timedelta] = None, + ) -> temporalio.bridge.proto.health.v1.HealthCheckResponse: + print("sup from check") + return await self.client._rpc_call( + rpc="check", + req=req, + service=self.service, + resp_type=temporalio.bridge.proto.health.v1.HealthCheckResponse, + retry=retry, + metadata=metadata, + timeout=timeout, + ) + + diff --git a/temporalio/service.py b/temporalio/service.py index 6d4d148c3..975daa94b 100644 --- a/temporalio/service.py +++ b/temporalio/service.py @@ -11,7 +11,7 @@ from dataclasses import dataclass, field from datetime import timedelta from enum import IntEnum -from typing import ClassVar, Generic, Mapping, Optional, Tuple, Type, TypeVar, Union +from typing import ClassVar, Mapping, Optional, Tuple, Type, TypeVar, Union import google.protobuf.empty_pb2 import google.protobuf.message @@ -23,6 +23,7 @@ import temporalio.api.workflowservice.v1 import temporalio.bridge.client import temporalio.bridge.proto.health.v1 +import temporalio.bridge.services_generated as svc_gen import temporalio.exceptions import temporalio.runtime @@ -220,12 +221,7 @@ def __init__(self, config: ConnectConfig) -> None: self.operator_service = OperatorService(self) self.cloud_service = CloudService(self) self.test_service = TestService(self) - self._check_health_call = self._new_call( - "check", - temporalio.bridge.proto.health.v1.HealthCheckRequest, - temporalio.bridge.proto.health.v1.HealthCheckResponse, - service="health", - ) + self.health_service = HealthService(self) async def check_health( self, @@ -246,12 +242,14 @@ async def check_health( is unavailable (rare), or raises an error if server/service cannot be reached. """ - resp = await self._check_health_call( + + resp = await self.health_service.check( temporalio.bridge.proto.health.v1.HealthCheckRequest(service=service), retry=retry, metadata=metadata, timeout=timeout, ) + return ( resp.status == temporalio.bridge.proto.health.v1.HealthCheckResponse.ServingStatus.SERVING @@ -287,1003 +285,25 @@ async def _rpc_call( ) -> ServiceResponse: raise NotImplementedError - def _new_call( - self, - name: str, - req_type: Type[ServiceRequest], - resp_type: Type[ServiceResponse], - *, - service: str = "workflow", - ) -> ServiceCall[ServiceRequest, ServiceResponse]: - return ServiceCall(self, name, req_type, resp_type, service) - -class WorkflowService: +class WorkflowService(svc_gen.WorkflowService): """Client to the Temporal server's workflow service.""" - def __init__(self, client: ServiceClient) -> None: - """Initialize the workflow service.""" - wsv1 = temporalio.api.workflowservice.v1 - self.count_workflow_executions = client._new_call( - "count_workflow_executions", - wsv1.CountWorkflowExecutionsRequest, - wsv1.CountWorkflowExecutionsResponse, - ) - self.create_schedule = client._new_call( - "create_schedule", - wsv1.CreateScheduleRequest, - wsv1.CreateScheduleResponse, - ) - self.create_workflow_rule = client._new_call( - "create_workflow_rule", - wsv1.CreateWorkflowRuleRequest, - wsv1.CreateWorkflowRuleRequest, - ) - self.delete_schedule = client._new_call( - "delete_schedule", - wsv1.DeleteScheduleRequest, - wsv1.DeleteScheduleResponse, - ) - self.delete_worker_deployment = client._new_call( - "delete_worker_deployment", - wsv1.DeleteWorkerDeploymentRequest, - wsv1.DeleteWorkerDeploymentResponse, - ) - self.delete_worker_deployment_version = client._new_call( - "delete_worker_deployment_version", - wsv1.DeleteWorkerDeploymentVersionRequest, - wsv1.DeleteWorkerDeploymentVersionResponse, - ) - self.delete_workflow_execution = client._new_call( - "delete_workflow_execution", - wsv1.DeleteWorkflowExecutionRequest, - wsv1.DeleteWorkflowExecutionResponse, - ) - self.delete_workflow_rule = client._new_call( - "delete_workflow_rule", - wsv1.DeleteWorkflowRuleRequest, - wsv1.DeleteWorkflowRuleResponse, - ) - self.describe_batch_operation = client._new_call( - "describe_batch_operation", - wsv1.DescribeBatchOperationRequest, - wsv1.DescribeBatchOperationResponse, - ) - self.describe_deployment = client._new_call( - "describe_deployment", - wsv1.DescribeDeploymentRequest, - wsv1.DescribeDeploymentResponse, - ) - self.deprecate_namespace = client._new_call( - "deprecate_namespace", - wsv1.DeprecateNamespaceRequest, - wsv1.DeprecateNamespaceResponse, - ) - self.describe_namespace = client._new_call( - "describe_namespace", - wsv1.DescribeNamespaceRequest, - wsv1.DescribeNamespaceResponse, - ) - self.describe_schedule = client._new_call( - "describe_schedule", - wsv1.DescribeScheduleRequest, - wsv1.DescribeScheduleResponse, - ) - self.describe_task_queue = client._new_call( - "describe_task_queue", - wsv1.DescribeTaskQueueRequest, - wsv1.DescribeTaskQueueResponse, - ) - self.describe_worker_deployment = client._new_call( - "describe_worker_deployment", - wsv1.DescribeWorkerDeploymentRequest, - wsv1.DescribeWorkerDeploymentResponse, - ) - self.describe_worker_deployment_version = client._new_call( - "describe_worker_deployment_version", - wsv1.DescribeWorkerDeploymentVersionRequest, - wsv1.DescribeWorkerDeploymentVersionResponse, - ) - self.describe_workflow_execution = client._new_call( - "describe_workflow_execution", - wsv1.DescribeWorkflowExecutionRequest, - wsv1.DescribeWorkflowExecutionResponse, - ) - self.describe_workflow_rule = client._new_call( - "describe_workflow_rule", - wsv1.DescribeWorkflowRuleRequest, - wsv1.DescribeWorkflowRuleResponse, - ) - self.execute_multi_operation = client._new_call( - "execute_multi_operation", - wsv1.ExecuteMultiOperationRequest, - wsv1.ExecuteMultiOperationResponse, - ) - self.fetch_worker_config = client._new_call( - "fetch_worker_config", - wsv1.FetchWorkerConfigRequest, - wsv1.FetchWorkerConfigResponse, - ) - self.get_cluster_info = client._new_call( - "get_cluster_info", - wsv1.GetClusterInfoRequest, - wsv1.GetClusterInfoResponse, - ) - self.get_current_deployment = client._new_call( - "get_current_deployment", - wsv1.GetCurrentDeploymentRequest, - wsv1.GetCurrentDeploymentResponse, - ) - self.get_deployment_reachability = client._new_call( - "get_deployment_reachability", - wsv1.GetDeploymentReachabilityRequest, - wsv1.GetDeploymentReachabilityResponse, - ) - self.get_search_attributes = client._new_call( - "get_search_attributes", - wsv1.GetSearchAttributesRequest, - wsv1.GetSearchAttributesResponse, - ) - self.get_system_info = client._new_call( - "get_system_info", - wsv1.GetSystemInfoRequest, - wsv1.GetSystemInfoResponse, - ) - self.get_worker_build_id_compatibility = client._new_call( - "get_worker_build_id_compatibility", - wsv1.GetWorkerBuildIdCompatibilityRequest, - wsv1.GetWorkerBuildIdCompatibilityResponse, - ) - self.get_worker_task_reachability = client._new_call( - "get_worker_task_reachability", - wsv1.GetWorkerTaskReachabilityRequest, - wsv1.GetWorkerTaskReachabilityResponse, - ) - self.get_worker_versioning_rules = client._new_call( - "get_worker_versioning_rules", - wsv1.GetWorkerVersioningRulesRequest, - wsv1.GetWorkerVersioningRulesResponse, - ) - self.get_workflow_execution_history = client._new_call( - "get_workflow_execution_history", - wsv1.GetWorkflowExecutionHistoryRequest, - wsv1.GetWorkflowExecutionHistoryResponse, - ) - self.get_workflow_execution_history_reverse = client._new_call( - "get_workflow_execution_history_reverse", - wsv1.GetWorkflowExecutionHistoryReverseRequest, - wsv1.GetWorkflowExecutionHistoryReverseResponse, - ) - self.list_archived_workflow_executions = client._new_call( - "list_archived_workflow_executions", - wsv1.ListArchivedWorkflowExecutionsRequest, - wsv1.ListArchivedWorkflowExecutionsResponse, - ) - self.list_batch_operations = client._new_call( - "list_batch_operations", - wsv1.ListBatchOperationsRequest, - wsv1.ListBatchOperationsResponse, - ) - self.list_closed_workflow_executions = client._new_call( - "list_closed_workflow_executions", - wsv1.ListClosedWorkflowExecutionsRequest, - wsv1.ListClosedWorkflowExecutionsResponse, - ) - self.list_deployments = client._new_call( - "list_deployments", - wsv1.ListDeploymentsRequest, - wsv1.ListDeploymentsResponse, - ) - self.list_namespaces = client._new_call( - "list_namespaces", - wsv1.ListNamespacesRequest, - wsv1.ListNamespacesResponse, - ) - self.list_open_workflow_executions = client._new_call( - "list_open_workflow_executions", - wsv1.ListOpenWorkflowExecutionsRequest, - wsv1.ListOpenWorkflowExecutionsResponse, - ) - self.list_schedule_matching_times = client._new_call( - "list_schedule_matching_times", - wsv1.ListScheduleMatchingTimesRequest, - wsv1.ListScheduleMatchingTimesResponse, - ) - self.list_schedules = client._new_call( - "list_schedules", - wsv1.ListSchedulesRequest, - wsv1.ListSchedulesResponse, - ) - self.list_task_queue_partitions = client._new_call( - "list_task_queue_partitions", - wsv1.ListTaskQueuePartitionsRequest, - wsv1.ListTaskQueuePartitionsResponse, - ) - self.list_worker_deployments = client._new_call( - "list_worker_deployments", - wsv1.ListWorkerDeploymentsRequest, - wsv1.ListWorkerDeploymentsResponse, - ) - self.list_workflow_executions = client._new_call( - "list_workflow_executions", - wsv1.ListWorkflowExecutionsRequest, - wsv1.ListWorkflowExecutionsResponse, - ) - self.list_workers = client._new_call( - "list_workers", - wsv1.ListWorkersRequest, - wsv1.ListWorkersResponse, - ) - self.list_workflow_rules = client._new_call( - "list_workflow_rules", - wsv1.ListWorkflowRulesRequest, - wsv1.ListWorkflowRulesResponse, - ) - self.patch_schedule = client._new_call( - "patch_schedule", - wsv1.PatchScheduleRequest, - wsv1.PatchScheduleResponse, - ) - self.pause_activity = client._new_call( - "pause_activity", - wsv1.PauseActivityRequest, - wsv1.PauseActivityResponse, - ) - self.poll_activity_task_queue = client._new_call( - "poll_activity_task_queue", - wsv1.PollActivityTaskQueueRequest, - wsv1.PollActivityTaskQueueResponse, - ) - self.poll_nexus_task_queue = client._new_call( - "poll_nexus_task_queue", - wsv1.PollNexusTaskQueueRequest, - wsv1.PollNexusTaskQueueResponse, - ) - self.poll_workflow_execution_update = client._new_call( - "poll_workflow_execution_update", - wsv1.PollWorkflowExecutionUpdateRequest, - wsv1.PollWorkflowExecutionUpdateResponse, - ) - self.poll_workflow_task_queue = client._new_call( - "poll_workflow_task_queue", - wsv1.PollWorkflowTaskQueueRequest, - wsv1.PollWorkflowTaskQueueResponse, - ) - self.query_workflow = client._new_call( - "query_workflow", - wsv1.QueryWorkflowRequest, - wsv1.QueryWorkflowResponse, - ) - self.record_activity_task_heartbeat = client._new_call( - "record_activity_task_heartbeat", - wsv1.RecordActivityTaskHeartbeatRequest, - wsv1.RecordActivityTaskHeartbeatResponse, - ) - self.record_activity_task_heartbeat_by_id = client._new_call( - "record_activity_task_heartbeat_by_id", - wsv1.RecordActivityTaskHeartbeatByIdRequest, - wsv1.RecordActivityTaskHeartbeatByIdResponse, - ) - self.record_worker_heartbeat = client._new_call( - "record_worker_heartbeat", - wsv1.RecordWorkerHeartbeatRequest, - wsv1.RecordWorkerHeartbeatResponse, - ) - self.register_namespace = client._new_call( - "register_namespace", - wsv1.RegisterNamespaceRequest, - wsv1.RegisterNamespaceResponse, - ) - self.request_cancel_workflow_execution = client._new_call( - "request_cancel_workflow_execution", - wsv1.RequestCancelWorkflowExecutionRequest, - wsv1.RequestCancelWorkflowExecutionResponse, - ) - self.reset_activity = client._new_call( - "reset_activity", - wsv1.ResetActivityRequest, - wsv1.ResetActivityResponse, - ) - self.reset_sticky_task_queue = client._new_call( - "reset_sticky_task_queue", - wsv1.ResetStickyTaskQueueRequest, - wsv1.ResetStickyTaskQueueResponse, - ) - self.reset_workflow_execution = client._new_call( - "reset_workflow_execution", - wsv1.ResetWorkflowExecutionRequest, - wsv1.ResetWorkflowExecutionResponse, - ) - self.respond_activity_task_canceled = client._new_call( - "respond_activity_task_canceled", - wsv1.RespondActivityTaskCanceledRequest, - wsv1.RespondActivityTaskCanceledResponse, - ) - self.respond_activity_task_canceled_by_id = client._new_call( - "respond_activity_task_canceled_by_id", - wsv1.RespondActivityTaskCanceledByIdRequest, - wsv1.RespondActivityTaskCanceledByIdResponse, - ) - self.respond_activity_task_completed = client._new_call( - "respond_activity_task_completed", - wsv1.RespondActivityTaskCompletedRequest, - wsv1.RespondActivityTaskCompletedResponse, - ) - self.respond_activity_task_completed_by_id = client._new_call( - "respond_activity_task_completed_by_id", - wsv1.RespondActivityTaskCompletedByIdRequest, - wsv1.RespondActivityTaskCompletedByIdResponse, - ) - self.respond_activity_task_failed = client._new_call( - "respond_activity_task_failed", - wsv1.RespondActivityTaskFailedRequest, - wsv1.RespondActivityTaskFailedResponse, - ) - self.respond_activity_task_failed_by_id = client._new_call( - "respond_activity_task_failed_by_id", - wsv1.RespondActivityTaskFailedByIdRequest, - wsv1.RespondActivityTaskFailedByIdResponse, - ) - self.respond_nexus_task_completed = client._new_call( - "respond_nexus_task_completed", - wsv1.RespondNexusTaskCompletedRequest, - wsv1.RespondNexusTaskCompletedResponse, - ) - self.respond_nexus_task_failed = client._new_call( - "respond_nexus_task_failed", - wsv1.RespondNexusTaskFailedRequest, - wsv1.RespondNexusTaskFailedResponse, - ) - self.respond_query_task_completed = client._new_call( - "respond_query_task_completed", - wsv1.RespondQueryTaskCompletedRequest, - wsv1.RespondQueryTaskCompletedResponse, - ) - self.respond_workflow_task_completed = client._new_call( - "respond_workflow_task_completed", - wsv1.RespondWorkflowTaskCompletedRequest, - wsv1.RespondWorkflowTaskCompletedResponse, - ) - self.respond_workflow_task_failed = client._new_call( - "respond_workflow_task_failed", - wsv1.RespondWorkflowTaskFailedRequest, - wsv1.RespondWorkflowTaskFailedResponse, - ) - self.scan_workflow_executions = client._new_call( - "scan_workflow_executions", - wsv1.ScanWorkflowExecutionsRequest, - wsv1.ScanWorkflowExecutionsResponse, - ) - self.set_current_deployment = client._new_call( - "set_current_deployment", - wsv1.SetCurrentDeploymentRequest, - wsv1.SetCurrentDeploymentResponse, - ) - self.set_worker_deployment_current_version = client._new_call( - "set_worker_deployment_current_version", - wsv1.SetWorkerDeploymentCurrentVersionRequest, - wsv1.SetWorkerDeploymentCurrentVersionResponse, - ) - self.set_worker_deployment_ramping_version = client._new_call( - "set_worker_deployment_ramping_version", - wsv1.SetWorkerDeploymentRampingVersionRequest, - wsv1.SetWorkerDeploymentRampingVersionResponse, - ) - self.shutdown_worker = client._new_call( - "shutdown_worker", - wsv1.ShutdownWorkerRequest, - wsv1.ShutdownWorkerResponse, - ) - self.signal_with_start_workflow_execution = client._new_call( - "signal_with_start_workflow_execution", - wsv1.SignalWithStartWorkflowExecutionRequest, - wsv1.SignalWithStartWorkflowExecutionResponse, - ) - self.signal_workflow_execution = client._new_call( - "signal_workflow_execution", - wsv1.SignalWorkflowExecutionRequest, - wsv1.SignalWorkflowExecutionResponse, - ) - self.start_batch_operation = client._new_call( - "start_batch_operation", - wsv1.StartBatchOperationRequest, - wsv1.StartBatchOperationResponse, - ) - self.start_workflow_execution = client._new_call( - "start_workflow_execution", - wsv1.StartWorkflowExecutionRequest, - wsv1.StartWorkflowExecutionResponse, - ) - self.stop_batch_operation = client._new_call( - "stop_batch_operation", - wsv1.StopBatchOperationRequest, - wsv1.StopBatchOperationResponse, - ) - self.terminate_workflow_execution = client._new_call( - "terminate_workflow_execution", - wsv1.TerminateWorkflowExecutionRequest, - wsv1.TerminateWorkflowExecutionResponse, - ) - self.trigger_workflow_rule = client._new_call( - "trigger_workflow_rule", - wsv1.TriggerWorkflowRuleRequest, - wsv1.TriggerWorkflowRuleResponse, - ) - self.unpause_activity = client._new_call( - "unpause_activity", - wsv1.UnpauseActivityRequest, - wsv1.UnpauseActivityResponse, - ) - self.update_activity_options = client._new_call( - "update_activity_options", - wsv1.UpdateActivityOptionsRequest, - wsv1.UpdateActivityOptionsResponse, - ) - self.update_namespace = client._new_call( - "update_namespace", - wsv1.UpdateNamespaceRequest, - wsv1.UpdateNamespaceResponse, - ) - self.update_schedule = client._new_call( - "update_schedule", - wsv1.UpdateScheduleRequest, - wsv1.UpdateScheduleResponse, - ) - self.update_task_queue_config = client._new_call( - "update_task_queue_config", - wsv1.UpdateTaskQueueConfigRequest, - wsv1.UpdateTaskQueueConfigResponse, - ) - self.update_worker_config = client._new_call( - "update_worker_config", - wsv1.UpdateWorkerConfigRequest, - wsv1.UpdateWorkerConfigResponse, - ) - self.update_worker_deployment_version_metadata = client._new_call( - "update_worker_deployment_version_metadata", - wsv1.UpdateWorkerDeploymentVersionMetadataRequest, - wsv1.UpdateWorkerDeploymentVersionMetadataResponse, - ) - self.update_worker_build_id_compatibility = client._new_call( - "update_worker_build_id_compatibility", - wsv1.UpdateWorkerBuildIdCompatibilityRequest, - wsv1.UpdateWorkerBuildIdCompatibilityResponse, - ) - self.update_worker_versioning_rules = client._new_call( - "update_worker_versioning_rules", - wsv1.UpdateWorkerVersioningRulesRequest, - wsv1.UpdateWorkerVersioningRulesResponse, - ) - self.update_workflow_execution = client._new_call( - "update_workflow_execution", - wsv1.UpdateWorkflowExecutionRequest, - wsv1.UpdateWorkflowExecutionResponse, - ) - self.update_workflow_execution_options = client._new_call( - "update_workflow_execution_options", - wsv1.UpdateWorkflowExecutionOptionsRequest, - wsv1.UpdateWorkflowExecutionOptionsResponse, - ) - -class OperatorService: +class OperatorService(svc_gen.OperatorService): """Client to the Temporal server's operator service.""" - def __init__(self, client: ServiceClient) -> None: - """Initialize the operator service.""" - osv1 = temporalio.api.operatorservice.v1 - self.add_or_update_remote_cluster = client._new_call( - "add_or_update_remote_cluster", - osv1.AddOrUpdateRemoteClusterRequest, - osv1.AddOrUpdateRemoteClusterResponse, - service="operator", - ) - self.add_search_attributes = client._new_call( - "add_search_attributes", - osv1.AddSearchAttributesRequest, - osv1.AddSearchAttributesResponse, - service="operator", - ) - self.create_nexus_endpoint = client._new_call( - "create_nexus_endpoint", - osv1.CreateNexusEndpointRequest, - osv1.CreateNexusEndpointResponse, - service="operator", - ) - self.delete_nexus_endpoint = client._new_call( - "delete_nexus_endpoint", - osv1.DeleteNexusEndpointRequest, - osv1.DeleteNexusEndpointResponse, - service="operator", - ) - self.delete_namespace = client._new_call( - "delete_namespace", - osv1.DeleteNamespaceRequest, - osv1.DeleteNamespaceResponse, - service="operator", - ) - self.get_nexus_endpoint = client._new_call( - "get_nexus_endpoint", - osv1.GetNexusEndpointRequest, - osv1.GetNexusEndpointResponse, - service="operator", - ) - self.list_clusters = client._new_call( - "list_clusters", - osv1.ListClustersRequest, - osv1.ListClustersResponse, - service="operator", - ) - self.list_nexus_endpoints = client._new_call( - "list_nexus_endpoints", - osv1.ListNexusEndpointsRequest, - osv1.ListNexusEndpointsResponse, - service="operator", - ) - self.list_search_attributes = client._new_call( - "list_search_attributes", - osv1.ListSearchAttributesRequest, - osv1.ListSearchAttributesResponse, - service="operator", - ) - self.remove_remote_cluster = client._new_call( - "remove_remote_cluster", - osv1.RemoveRemoteClusterRequest, - osv1.RemoveRemoteClusterResponse, - service="operator", - ) - self.remove_search_attributes = client._new_call( - "remove_search_attributes", - osv1.RemoveSearchAttributesRequest, - osv1.RemoveSearchAttributesResponse, - service="operator", - ) - self.update_nexus_endpoint = client._new_call( - "update_nexus_endpoint", - osv1.UpdateNexusEndpointRequest, - osv1.UpdateNexusEndpointResponse, - service="operator", - ) - -class CloudService: +class CloudService(svc_gen.CloudService): """Client to the Temporal server's cloud service.""" - def __init__(self, client: ServiceClient) -> None: - """Initialize the cloud service.""" - clv1 = temporalio.api.cloud.cloudservice.v1 - self.add_namespace_region = client._new_call( - "add_namespace_region", - clv1.AddNamespaceRegionRequest, - clv1.AddNamespaceRegionResponse, - service="cloud", - ) - self.add_user_group_member = client._new_call( - "add_user_group_member", - clv1.AddUserGroupMemberRequest, - clv1.AddUserGroupMemberResponse, - service="cloud", - ) - self.create_api_key = client._new_call( - "create_api_key", - clv1.CreateApiKeyRequest, - clv1.CreateApiKeyResponse, - service="cloud", - ) - self.create_connectivity_rule = client._new_call( - "create_connectivity_rule", - clv1.CreateConnectivityRuleRequest, - clv1.CreateConnectivityRuleResponse, - service="cloud", - ) - self.create_namespace = client._new_call( - "create_namespace", - clv1.CreateNamespaceRequest, - clv1.CreateNamespaceResponse, - service="cloud", - ) - self.create_namespace_export_sink = client._new_call( - "create_namespace_export_sink", - clv1.CreateNamespaceExportSinkRequest, - clv1.CreateNamespaceExportSinkResponse, - service="cloud", - ) - self.create_nexus_endpoint = client._new_call( - "create_nexus_endpoint", - clv1.CreateNexusEndpointRequest, - clv1.CreateNexusEndpointResponse, - service="cloud", - ) - self.create_service_account = client._new_call( - "create_service_account", - clv1.CreateServiceAccountRequest, - clv1.CreateServiceAccountResponse, - service="cloud", - ) - self.create_user_group = client._new_call( - "create_user_group", - clv1.CreateUserGroupRequest, - clv1.CreateUserGroupResponse, - service="cloud", - ) - self.create_user = client._new_call( - "create_user", - clv1.CreateUserRequest, - clv1.CreateUserResponse, - service="cloud", - ) - self.delete_api_key = client._new_call( - "delete_api_key", - clv1.DeleteApiKeyRequest, - clv1.DeleteApiKeyResponse, - service="cloud", - ) - self.delete_connectivity_rule = client._new_call( - "delete_connectivity_rule", - clv1.DeleteConnectivityRuleRequest, - clv1.DeleteConnectivityRuleResponse, - service="cloud", - ) - self.delete_namespace = client._new_call( - "delete_namespace", - clv1.DeleteNamespaceRequest, - clv1.DeleteNamespaceResponse, - service="cloud", - ) - self.delete_namespace_export_sink = client._new_call( - "delete_namespace_export_sink", - clv1.DeleteNamespaceExportSinkRequest, - clv1.DeleteNamespaceExportSinkResponse, - service="cloud", - ) - self.delete_namespace_region = client._new_call( - "delete_namespace_region", - clv1.DeleteNamespaceRegionRequest, - clv1.DeleteNamespaceRegionResponse, - service="cloud", - ) - self.delete_nexus_endpoint = client._new_call( - "delete_nexus_endpoint", - clv1.DeleteNexusEndpointRequest, - clv1.DeleteNexusEndpointResponse, - service="cloud", - ) - self.delete_service_account = client._new_call( - "delete_service_account", - clv1.DeleteServiceAccountRequest, - clv1.DeleteServiceAccountResponse, - service="cloud", - ) - self.delete_user_group = client._new_call( - "delete_user_group", - clv1.DeleteUserGroupRequest, - clv1.DeleteUserGroupResponse, - service="cloud", - ) - self.delete_user = client._new_call( - "delete_user", - clv1.DeleteUserRequest, - clv1.DeleteUserResponse, - service="cloud", - ) - self.failover_namespace_region = client._new_call( - "failover_namespace_region", - clv1.FailoverNamespaceRegionRequest, - clv1.FailoverNamespaceRegionResponse, - service="cloud", - ) - self.get_account = client._new_call( - "get_account", - clv1.GetAccountRequest, - clv1.GetAccountResponse, - service="cloud", - ) - self.get_api_key = client._new_call( - "get_api_key", - clv1.GetApiKeyRequest, - clv1.GetApiKeyResponse, - service="cloud", - ) - self.get_api_keys = client._new_call( - "get_api_keys", - clv1.GetApiKeysRequest, - clv1.GetApiKeysResponse, - service="cloud", - ) - self.get_async_operation = client._new_call( - "get_async_operation", - clv1.GetAsyncOperationRequest, - clv1.GetAsyncOperationResponse, - service="cloud", - ) - self.get_connectivity_rule = client._new_call( - "get_connectivity_rule", - clv1.GetConnectivityRuleRequest, - clv1.GetConnectivityRuleResponse, - service="cloud", - ) - self.get_connectivity_rules = client._new_call( - "get_connectivity_rules", - clv1.GetConnectivityRulesRequest, - clv1.GetConnectivityRulesResponse, - service="cloud", - ) - self.get_namespace = client._new_call( - "get_namespace", - clv1.GetNamespaceRequest, - clv1.GetNamespaceResponse, - service="cloud", - ) - self.get_namespaces = client._new_call( - "get_namespaces", - clv1.GetNamespacesRequest, - clv1.GetNamespacesResponse, - service="cloud", - ) - self.get_namespace_export_sink = client._new_call( - "get_namespace_export_sink", - clv1.GetNamespaceExportSinkRequest, - clv1.GetNamespaceExportSinkResponse, - service="cloud", - ) - self.get_namespace_export_sinks = client._new_call( - "get_namespace_export_sinks", - clv1.GetNamespaceExportSinksRequest, - clv1.GetNamespaceExportSinksResponse, - service="cloud", - ) - self.get_nexus_endpoint = client._new_call( - "get_nexus_endpoint", - clv1.GetNexusEndpointRequest, - clv1.GetNexusEndpointResponse, - service="cloud", - ) - self.get_nexus_endpoints = client._new_call( - "get_nexus_endpoints", - clv1.GetNexusEndpointsRequest, - clv1.GetNexusEndpointsResponse, - service="cloud", - ) - self.get_region = client._new_call( - "get_region", - clv1.GetRegionRequest, - clv1.GetRegionResponse, - service="cloud", - ) - self.get_regions = client._new_call( - "get_regions", - clv1.GetRegionsRequest, - clv1.GetRegionsResponse, - service="cloud", - ) - self.get_service_account = client._new_call( - "get_service_account", - clv1.GetServiceAccountRequest, - clv1.GetServiceAccountResponse, - service="cloud", - ) - self.get_service_accounts = client._new_call( - "get_service_accounts", - clv1.GetServiceAccountsRequest, - clv1.GetServiceAccountsResponse, - service="cloud", - ) - self.get_usage = client._new_call( - "get_usage", - clv1.GetUsageRequest, - clv1.GetUsageResponse, - service="cloud", - ) - self.get_user_group = client._new_call( - "get_user_group", - clv1.GetUserGroupRequest, - clv1.GetUserGroupResponse, - service="cloud", - ) - self.get_user_group_members = client._new_call( - "get_user_group_members", - clv1.GetUserGroupMembersRequest, - clv1.GetUserGroupMembersResponse, - service="cloud", - ) - self.get_user_groups = client._new_call( - "get_user_groups", - clv1.GetUserGroupsRequest, - clv1.GetUserGroupsResponse, - service="cloud", - ) - self.get_user = client._new_call( - "get_user", - clv1.GetUserRequest, - clv1.GetUserResponse, - service="cloud", - ) - self.get_users = client._new_call( - "get_users", - clv1.GetUsersRequest, - clv1.GetUsersResponse, - service="cloud", - ) - self.remove_user_group_member = client._new_call( - "remove_user_group_member", - clv1.RemoveUserGroupMemberRequest, - clv1.RemoveUserGroupMemberResponse, - service="cloud", - ) - self.rename_custom_search_attribute = client._new_call( - "rename_custom_search_attribute", - clv1.RenameCustomSearchAttributeRequest, - clv1.RenameCustomSearchAttributeResponse, - service="cloud", - ) - self.set_user_group_namespace_access = client._new_call( - "set_user_group_namespace_access", - clv1.SetUserGroupNamespaceAccessRequest, - clv1.SetUserGroupNamespaceAccessResponse, - service="cloud", - ) - self.set_user_namespace_access = client._new_call( - "set_user_namespace_access", - clv1.SetUserNamespaceAccessRequest, - clv1.SetUserNamespaceAccessResponse, - service="cloud", - ) - self.update_account = client._new_call( - "update_account", - clv1.UpdateAccountRequest, - clv1.UpdateAccountResponse, - service="cloud", - ) - self.update_api_key = client._new_call( - "update_api_key", - clv1.UpdateApiKeyRequest, - clv1.UpdateApiKeyResponse, - service="cloud", - ) - self.update_namespace = client._new_call( - "update_namespace", - clv1.UpdateNamespaceRequest, - clv1.UpdateNamespaceResponse, - service="cloud", - ) - self.update_namespace_export_sink = client._new_call( - "update_namespace_export_sink", - clv1.UpdateNamespaceExportSinkRequest, - clv1.UpdateNamespaceExportSinkResponse, - service="cloud", - ) - self.update_namespace_tags = client._new_call( - "update_namespace_tags", - clv1.UpdateNamespaceTagsRequest, - clv1.UpdateNamespaceTagsResponse, - service="cloud", - ) - self.update_nexus_endpoint = client._new_call( - "update_nexus_endpoint", - clv1.UpdateNexusEndpointRequest, - clv1.UpdateNexusEndpointResponse, - service="cloud", - ) - self.update_service_account = client._new_call( - "update_service_account", - clv1.UpdateServiceAccountRequest, - clv1.UpdateServiceAccountResponse, - service="cloud", - ) - self.update_user_group = client._new_call( - "update_user_group", - clv1.UpdateUserGroupRequest, - clv1.UpdateUserGroupResponse, - service="cloud", - ) - self.update_user = client._new_call( - "update_user", - clv1.UpdateUserRequest, - clv1.UpdateUserResponse, - service="cloud", - ) - self.validate_namespace_export_sink = client._new_call( - "validate_namespace_export_sink", - clv1.ValidateNamespaceExportSinkRequest, - clv1.ValidateNamespaceExportSinkResponse, - service="cloud", - ) - -class TestService: +class TestService(svc_gen.TestService): """Client to the Temporal test server's test service.""" - def __init__(self, client: ServiceClient) -> None: - """Initialize the test service.""" - tsv1 = temporalio.api.testservice.v1 - self.get_current_time = client._new_call( - "get_current_time", - google.protobuf.empty_pb2.Empty, - tsv1.GetCurrentTimeResponse, - service="test", - ) - self.lock_time_skipping = client._new_call( - "lock_time_skipping", - tsv1.LockTimeSkippingRequest, - tsv1.LockTimeSkippingResponse, - service="test", - ) - self.sleep_until = client._new_call( - "sleep_until", - tsv1.SleepUntilRequest, - tsv1.SleepResponse, - service="test", - ) - self.sleep = client._new_call( - "sleep", - tsv1.SleepRequest, - tsv1.SleepResponse, - service="test", - ) - self.unlock_time_skipping_with_sleep = client._new_call( - "unlock_time_skipping_with_sleep", - tsv1.SleepRequest, - tsv1.SleepResponse, - service="test", - ) - self.unlock_time_skipping = client._new_call( - "unlock_time_skipping", - tsv1.UnlockTimeSkippingRequest, - tsv1.UnlockTimeSkippingResponse, - service="test", - ) - - -class ServiceCall(Generic[ServiceRequest, ServiceResponse]): - """Callable RPC method for services.""" - - def __init__( - self, - service_client: ServiceClient, - name: str, - req_type: Type[ServiceRequest], - resp_type: Type[ServiceResponse], - service: str, - ) -> None: - """Initialize the service call.""" - self.service_client = service_client - self.name = name - self.req_type = req_type - self.resp_type = resp_type - self.service = service - - async def __call__( - self, - req: ServiceRequest, - *, - retry: bool = False, - metadata: Mapping[str, Union[str, bytes]] = {}, - timeout: Optional[timedelta] = None, - ) -> ServiceResponse: - """Invoke underlying client with the given request. - - Args: - req: Request for the call. - retry: If true, will use retry config to retry failed calls. - metadata: Headers used on the RPC call. Keys here override - client-level RPC metadata keys. - timeout: Optional RPC deadline to set for the RPC call. - - Returns: - RPC response. - Raises: - RPCError: Any RPC error that occurs during the call. - """ - return await self.service_client._rpc_call( - self.name, - req, - self.resp_type, - service=self.service, - retry=retry, - metadata=metadata, - timeout=timeout, - ) +class HealthService(svc_gen.HealthService): + """Client to the Temporal server's health service.""" class _BridgeServiceClient(ServiceClient): diff --git a/tests/test_client.py b/tests/test_client.py index e1df7258c..b94b38d33 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -88,7 +88,7 @@ ) from temporalio.converter import DataConverter from temporalio.exceptions import WorkflowAlreadyStartedError -from temporalio.service import ServiceCall + from temporalio.testing import WorkflowEnvironment from tests.helpers import ( assert_eq_eventually, @@ -299,12 +299,7 @@ async def test_terminate(client: Client, worker: ExternalWorker): async def test_rpc_already_exists_error_is_raised(client: Client): - class start_workflow_execution( - ServiceCall[ - temporalio.api.workflowservice.v1.StartWorkflowExecutionRequest, - temporalio.api.workflowservice.v1.StartWorkflowExecutionResponse, - ] - ): + class start_workflow_execution: already_exists_err = RPCError( "fake already exists error", RPCStatusCode.ALREADY_EXISTS, b"" ) diff --git a/tests/test_service.py b/tests/test_service.py index 374ae0869..6919ff590 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -33,19 +33,21 @@ def assert_all_calls_present( ] = {}, ) -> None: # Collect service calls - service_calls: Dict[str, Tuple[Type, Type]] = {} - for _, call in inspect.getmembers(service): - if isinstance(call, temporalio.service.ServiceCall): - service_calls[call.name] = (call.req_type, call.resp_type) + service_calls = set() + for name, call in inspect.getmembers(service): + # ignore private methods and non-rpc members "client" and "service" + if name[0] != "_" and name != "client" and name != "service": + print(name) + service_calls.add(name) # Collect gRPC service calls with a fake channel channel = CallCollectingChannel(package, custom_req_resp) new_stub(channel) # Confirm they are the same - missing = channel.calls.keys() - service_calls.keys() + missing = channel.calls.keys() - service_calls assert not missing - added = service_calls.keys() - channel.calls.keys() + added = service_calls - channel.calls.keys() assert not added assert_all_calls_present( diff --git a/tests/worker/test_update_with_start.py b/tests/worker/test_update_with_start.py index c2f4b76e1..c55ee6f70 100644 --- a/tests/worker/test_update_with_start.py +++ b/tests/worker/test_update_with_start.py @@ -27,7 +27,7 @@ WorkflowIDReusePolicy, ) from temporalio.exceptions import ApplicationError, WorkflowAlreadyStartedError -from temporalio.service import RPCError, RPCStatusCode, ServiceCall +from temporalio.service import RPCError, RPCStatusCode from temporalio.testing import WorkflowEnvironment from tests.helpers import ( new_worker, @@ -804,12 +804,7 @@ async def test_update_with_start_two_param(client: Client): # Verify correcting issue #791 async def test_start_update_with_start_empty_details(client: Client): - class execute_multi_operation( - ServiceCall[ - temporalio.api.workflowservice.v1.ExecuteMultiOperationRequest, - temporalio.api.workflowservice.v1.ExecuteMultiOperationResponse, - ] - ): + class execute_multi_operation: empty_details_err = RPCError("empty details", RPCStatusCode.INTERNAL, b"") # Set grpc_status with empty details empty_details_err._grpc_status = temporalio.api.common.v1.GrpcStatus(details=[]) From f43225af6bee423a1235a1efaec49b94a3f4d5a9 Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Mon, 29 Sep 2025 14:56:57 -0700 Subject: [PATCH 4/7] remove debug prints --- scripts/gen_bridge_client.py | 3 +- temporalio/bridge/services_generated.py | 167 ------------------------ 2 files changed, 1 insertion(+), 169 deletions(-) diff --git a/scripts/gen_bridge_client.py b/scripts/gen_bridge_client.py index a7fce165c..0528eb4f4 100644 --- a/scripts/gen_bridge_client.py +++ b/scripts/gen_bridge_client.py @@ -1,5 +1,5 @@ -from functools import partial import re +from functools import partial from string import Template from google.protobuf.descriptor import ( @@ -110,7 +110,6 @@ async def $method_name( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> $response_type: - print("sup from $method_name") return await self.client._rpc_call( rpc="$method_name", req=req, diff --git a/temporalio/bridge/services_generated.py b/temporalio/bridge/services_generated.py index 9863b7739..b860582e9 100644 --- a/temporalio/bridge/services_generated.py +++ b/temporalio/bridge/services_generated.py @@ -29,7 +29,6 @@ async def count_workflow_executions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.CountWorkflowExecutionsResponse: - print("sup from count_workflow_executions") return await self.client._rpc_call( rpc="count_workflow_executions", req=req, @@ -48,7 +47,6 @@ async def create_schedule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.CreateScheduleResponse: - print("sup from create_schedule") return await self.client._rpc_call( rpc="create_schedule", req=req, @@ -67,7 +65,6 @@ async def create_workflow_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.CreateWorkflowRuleResponse: - print("sup from create_workflow_rule") return await self.client._rpc_call( rpc="create_workflow_rule", req=req, @@ -86,7 +83,6 @@ async def delete_schedule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DeleteScheduleResponse: - print("sup from delete_schedule") return await self.client._rpc_call( rpc="delete_schedule", req=req, @@ -105,7 +101,6 @@ async def delete_worker_deployment( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DeleteWorkerDeploymentResponse: - print("sup from delete_worker_deployment") return await self.client._rpc_call( rpc="delete_worker_deployment", req=req, @@ -124,7 +119,6 @@ async def delete_worker_deployment_version( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DeleteWorkerDeploymentVersionResponse: - print("sup from delete_worker_deployment_version") return await self.client._rpc_call( rpc="delete_worker_deployment_version", req=req, @@ -143,7 +137,6 @@ async def delete_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DeleteWorkflowExecutionResponse: - print("sup from delete_workflow_execution") return await self.client._rpc_call( rpc="delete_workflow_execution", req=req, @@ -162,7 +155,6 @@ async def delete_workflow_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DeleteWorkflowRuleResponse: - print("sup from delete_workflow_rule") return await self.client._rpc_call( rpc="delete_workflow_rule", req=req, @@ -181,7 +173,6 @@ async def deprecate_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DeprecateNamespaceResponse: - print("sup from deprecate_namespace") return await self.client._rpc_call( rpc="deprecate_namespace", req=req, @@ -200,7 +191,6 @@ async def describe_batch_operation( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeBatchOperationResponse: - print("sup from describe_batch_operation") return await self.client._rpc_call( rpc="describe_batch_operation", req=req, @@ -219,7 +209,6 @@ async def describe_deployment( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeDeploymentResponse: - print("sup from describe_deployment") return await self.client._rpc_call( rpc="describe_deployment", req=req, @@ -238,7 +227,6 @@ async def describe_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeNamespaceResponse: - print("sup from describe_namespace") return await self.client._rpc_call( rpc="describe_namespace", req=req, @@ -257,7 +245,6 @@ async def describe_schedule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeScheduleResponse: - print("sup from describe_schedule") return await self.client._rpc_call( rpc="describe_schedule", req=req, @@ -276,7 +263,6 @@ async def describe_task_queue( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeTaskQueueResponse: - print("sup from describe_task_queue") return await self.client._rpc_call( rpc="describe_task_queue", req=req, @@ -295,7 +281,6 @@ async def describe_worker_deployment( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeWorkerDeploymentResponse: - print("sup from describe_worker_deployment") return await self.client._rpc_call( rpc="describe_worker_deployment", req=req, @@ -314,7 +299,6 @@ async def describe_worker_deployment_version( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeWorkerDeploymentVersionResponse: - print("sup from describe_worker_deployment_version") return await self.client._rpc_call( rpc="describe_worker_deployment_version", req=req, @@ -333,7 +317,6 @@ async def describe_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeWorkflowExecutionResponse: - print("sup from describe_workflow_execution") return await self.client._rpc_call( rpc="describe_workflow_execution", req=req, @@ -352,7 +335,6 @@ async def describe_workflow_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.DescribeWorkflowRuleResponse: - print("sup from describe_workflow_rule") return await self.client._rpc_call( rpc="describe_workflow_rule", req=req, @@ -371,7 +353,6 @@ async def execute_multi_operation( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ExecuteMultiOperationResponse: - print("sup from execute_multi_operation") return await self.client._rpc_call( rpc="execute_multi_operation", req=req, @@ -390,7 +371,6 @@ async def fetch_worker_config( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.FetchWorkerConfigResponse: - print("sup from fetch_worker_config") return await self.client._rpc_call( rpc="fetch_worker_config", req=req, @@ -409,7 +389,6 @@ async def get_cluster_info( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetClusterInfoResponse: - print("sup from get_cluster_info") return await self.client._rpc_call( rpc="get_cluster_info", req=req, @@ -428,7 +407,6 @@ async def get_current_deployment( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetCurrentDeploymentResponse: - print("sup from get_current_deployment") return await self.client._rpc_call( rpc="get_current_deployment", req=req, @@ -447,7 +425,6 @@ async def get_deployment_reachability( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetDeploymentReachabilityResponse: - print("sup from get_deployment_reachability") return await self.client._rpc_call( rpc="get_deployment_reachability", req=req, @@ -466,7 +443,6 @@ async def get_search_attributes( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetSearchAttributesResponse: - print("sup from get_search_attributes") return await self.client._rpc_call( rpc="get_search_attributes", req=req, @@ -485,7 +461,6 @@ async def get_system_info( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetSystemInfoResponse: - print("sup from get_system_info") return await self.client._rpc_call( rpc="get_system_info", req=req, @@ -504,7 +479,6 @@ async def get_worker_build_id_compatibility( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse: - print("sup from get_worker_build_id_compatibility") return await self.client._rpc_call( rpc="get_worker_build_id_compatibility", req=req, @@ -523,7 +497,6 @@ async def get_worker_task_reachability( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetWorkerTaskReachabilityResponse: - print("sup from get_worker_task_reachability") return await self.client._rpc_call( rpc="get_worker_task_reachability", req=req, @@ -542,7 +515,6 @@ async def get_worker_versioning_rules( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetWorkerVersioningRulesResponse: - print("sup from get_worker_versioning_rules") return await self.client._rpc_call( rpc="get_worker_versioning_rules", req=req, @@ -561,7 +533,6 @@ async def get_workflow_execution_history( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryResponse: - print("sup from get_workflow_execution_history") return await self.client._rpc_call( rpc="get_workflow_execution_history", req=req, @@ -580,7 +551,6 @@ async def get_workflow_execution_history_reverse( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseResponse: - print("sup from get_workflow_execution_history_reverse") return await self.client._rpc_call( rpc="get_workflow_execution_history_reverse", req=req, @@ -599,7 +569,6 @@ async def list_archived_workflow_executions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListArchivedWorkflowExecutionsResponse: - print("sup from list_archived_workflow_executions") return await self.client._rpc_call( rpc="list_archived_workflow_executions", req=req, @@ -618,7 +587,6 @@ async def list_batch_operations( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListBatchOperationsResponse: - print("sup from list_batch_operations") return await self.client._rpc_call( rpc="list_batch_operations", req=req, @@ -637,7 +605,6 @@ async def list_closed_workflow_executions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListClosedWorkflowExecutionsResponse: - print("sup from list_closed_workflow_executions") return await self.client._rpc_call( rpc="list_closed_workflow_executions", req=req, @@ -656,7 +623,6 @@ async def list_deployments( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListDeploymentsResponse: - print("sup from list_deployments") return await self.client._rpc_call( rpc="list_deployments", req=req, @@ -675,7 +641,6 @@ async def list_namespaces( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListNamespacesResponse: - print("sup from list_namespaces") return await self.client._rpc_call( rpc="list_namespaces", req=req, @@ -694,7 +659,6 @@ async def list_open_workflow_executions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListOpenWorkflowExecutionsResponse: - print("sup from list_open_workflow_executions") return await self.client._rpc_call( rpc="list_open_workflow_executions", req=req, @@ -713,7 +677,6 @@ async def list_schedule_matching_times( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListScheduleMatchingTimesResponse: - print("sup from list_schedule_matching_times") return await self.client._rpc_call( rpc="list_schedule_matching_times", req=req, @@ -732,7 +695,6 @@ async def list_schedules( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListSchedulesResponse: - print("sup from list_schedules") return await self.client._rpc_call( rpc="list_schedules", req=req, @@ -751,7 +713,6 @@ async def list_task_queue_partitions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListTaskQueuePartitionsResponse: - print("sup from list_task_queue_partitions") return await self.client._rpc_call( rpc="list_task_queue_partitions", req=req, @@ -770,7 +731,6 @@ async def list_worker_deployments( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListWorkerDeploymentsResponse: - print("sup from list_worker_deployments") return await self.client._rpc_call( rpc="list_worker_deployments", req=req, @@ -789,7 +749,6 @@ async def list_workers( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListWorkersResponse: - print("sup from list_workers") return await self.client._rpc_call( rpc="list_workers", req=req, @@ -808,7 +767,6 @@ async def list_workflow_executions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListWorkflowExecutionsResponse: - print("sup from list_workflow_executions") return await self.client._rpc_call( rpc="list_workflow_executions", req=req, @@ -827,7 +785,6 @@ async def list_workflow_rules( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ListWorkflowRulesResponse: - print("sup from list_workflow_rules") return await self.client._rpc_call( rpc="list_workflow_rules", req=req, @@ -846,7 +803,6 @@ async def patch_schedule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.PatchScheduleResponse: - print("sup from patch_schedule") return await self.client._rpc_call( rpc="patch_schedule", req=req, @@ -865,7 +821,6 @@ async def pause_activity( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.PauseActivityResponse: - print("sup from pause_activity") return await self.client._rpc_call( rpc="pause_activity", req=req, @@ -884,7 +839,6 @@ async def poll_activity_task_queue( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.PollActivityTaskQueueResponse: - print("sup from poll_activity_task_queue") return await self.client._rpc_call( rpc="poll_activity_task_queue", req=req, @@ -903,7 +857,6 @@ async def poll_nexus_task_queue( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.PollNexusTaskQueueResponse: - print("sup from poll_nexus_task_queue") return await self.client._rpc_call( rpc="poll_nexus_task_queue", req=req, @@ -922,7 +875,6 @@ async def poll_workflow_execution_update( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.PollWorkflowExecutionUpdateResponse: - print("sup from poll_workflow_execution_update") return await self.client._rpc_call( rpc="poll_workflow_execution_update", req=req, @@ -941,7 +893,6 @@ async def poll_workflow_task_queue( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.PollWorkflowTaskQueueResponse: - print("sup from poll_workflow_task_queue") return await self.client._rpc_call( rpc="poll_workflow_task_queue", req=req, @@ -960,7 +911,6 @@ async def query_workflow( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.QueryWorkflowResponse: - print("sup from query_workflow") return await self.client._rpc_call( rpc="query_workflow", req=req, @@ -979,7 +929,6 @@ async def record_activity_task_heartbeat( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatResponse: - print("sup from record_activity_task_heartbeat") return await self.client._rpc_call( rpc="record_activity_task_heartbeat", req=req, @@ -998,7 +947,6 @@ async def record_activity_task_heartbeat_by_id( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdResponse: - print("sup from record_activity_task_heartbeat_by_id") return await self.client._rpc_call( rpc="record_activity_task_heartbeat_by_id", req=req, @@ -1017,7 +965,6 @@ async def record_worker_heartbeat( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RecordWorkerHeartbeatResponse: - print("sup from record_worker_heartbeat") return await self.client._rpc_call( rpc="record_worker_heartbeat", req=req, @@ -1036,7 +983,6 @@ async def register_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RegisterNamespaceResponse: - print("sup from register_namespace") return await self.client._rpc_call( rpc="register_namespace", req=req, @@ -1055,7 +1001,6 @@ async def request_cancel_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse: - print("sup from request_cancel_workflow_execution") return await self.client._rpc_call( rpc="request_cancel_workflow_execution", req=req, @@ -1074,7 +1019,6 @@ async def reset_activity( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ResetActivityResponse: - print("sup from reset_activity") return await self.client._rpc_call( rpc="reset_activity", req=req, @@ -1093,7 +1037,6 @@ async def reset_sticky_task_queue( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ResetStickyTaskQueueResponse: - print("sup from reset_sticky_task_queue") return await self.client._rpc_call( rpc="reset_sticky_task_queue", req=req, @@ -1112,7 +1055,6 @@ async def reset_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ResetWorkflowExecutionResponse: - print("sup from reset_workflow_execution") return await self.client._rpc_call( rpc="reset_workflow_execution", req=req, @@ -1131,7 +1073,6 @@ async def respond_activity_task_canceled( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCanceledResponse: - print("sup from respond_activity_task_canceled") return await self.client._rpc_call( rpc="respond_activity_task_canceled", req=req, @@ -1150,7 +1091,6 @@ async def respond_activity_task_canceled_by_id( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCanceledByIdResponse: - print("sup from respond_activity_task_canceled_by_id") return await self.client._rpc_call( rpc="respond_activity_task_canceled_by_id", req=req, @@ -1169,7 +1109,6 @@ async def respond_activity_task_completed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCompletedResponse: - print("sup from respond_activity_task_completed") return await self.client._rpc_call( rpc="respond_activity_task_completed", req=req, @@ -1188,7 +1127,6 @@ async def respond_activity_task_completed_by_id( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondActivityTaskCompletedByIdResponse: - print("sup from respond_activity_task_completed_by_id") return await self.client._rpc_call( rpc="respond_activity_task_completed_by_id", req=req, @@ -1207,7 +1145,6 @@ async def respond_activity_task_failed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondActivityTaskFailedResponse: - print("sup from respond_activity_task_failed") return await self.client._rpc_call( rpc="respond_activity_task_failed", req=req, @@ -1226,7 +1163,6 @@ async def respond_activity_task_failed_by_id( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondActivityTaskFailedByIdResponse: - print("sup from respond_activity_task_failed_by_id") return await self.client._rpc_call( rpc="respond_activity_task_failed_by_id", req=req, @@ -1245,7 +1181,6 @@ async def respond_nexus_task_completed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondNexusTaskCompletedResponse: - print("sup from respond_nexus_task_completed") return await self.client._rpc_call( rpc="respond_nexus_task_completed", req=req, @@ -1264,7 +1199,6 @@ async def respond_nexus_task_failed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondNexusTaskFailedResponse: - print("sup from respond_nexus_task_failed") return await self.client._rpc_call( rpc="respond_nexus_task_failed", req=req, @@ -1283,7 +1217,6 @@ async def respond_query_task_completed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondQueryTaskCompletedResponse: - print("sup from respond_query_task_completed") return await self.client._rpc_call( rpc="respond_query_task_completed", req=req, @@ -1302,7 +1235,6 @@ async def respond_workflow_task_completed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondWorkflowTaskCompletedResponse: - print("sup from respond_workflow_task_completed") return await self.client._rpc_call( rpc="respond_workflow_task_completed", req=req, @@ -1321,7 +1253,6 @@ async def respond_workflow_task_failed( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.RespondWorkflowTaskFailedResponse: - print("sup from respond_workflow_task_failed") return await self.client._rpc_call( rpc="respond_workflow_task_failed", req=req, @@ -1340,7 +1271,6 @@ async def scan_workflow_executions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ScanWorkflowExecutionsResponse: - print("sup from scan_workflow_executions") return await self.client._rpc_call( rpc="scan_workflow_executions", req=req, @@ -1359,7 +1289,6 @@ async def set_current_deployment( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.SetCurrentDeploymentResponse: - print("sup from set_current_deployment") return await self.client._rpc_call( rpc="set_current_deployment", req=req, @@ -1378,7 +1307,6 @@ async def set_worker_deployment_current_version( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.SetWorkerDeploymentCurrentVersionResponse: - print("sup from set_worker_deployment_current_version") return await self.client._rpc_call( rpc="set_worker_deployment_current_version", req=req, @@ -1397,7 +1325,6 @@ async def set_worker_deployment_ramping_version( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.SetWorkerDeploymentRampingVersionResponse: - print("sup from set_worker_deployment_ramping_version") return await self.client._rpc_call( rpc="set_worker_deployment_ramping_version", req=req, @@ -1416,7 +1343,6 @@ async def shutdown_worker( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.ShutdownWorkerResponse: - print("sup from shutdown_worker") return await self.client._rpc_call( rpc="shutdown_worker", req=req, @@ -1435,7 +1361,6 @@ async def signal_with_start_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse: - print("sup from signal_with_start_workflow_execution") return await self.client._rpc_call( rpc="signal_with_start_workflow_execution", req=req, @@ -1454,7 +1379,6 @@ async def signal_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.SignalWorkflowExecutionResponse: - print("sup from signal_workflow_execution") return await self.client._rpc_call( rpc="signal_workflow_execution", req=req, @@ -1473,7 +1397,6 @@ async def start_batch_operation( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.StartBatchOperationResponse: - print("sup from start_batch_operation") return await self.client._rpc_call( rpc="start_batch_operation", req=req, @@ -1492,7 +1415,6 @@ async def start_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.StartWorkflowExecutionResponse: - print("sup from start_workflow_execution") return await self.client._rpc_call( rpc="start_workflow_execution", req=req, @@ -1511,7 +1433,6 @@ async def stop_batch_operation( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.StopBatchOperationResponse: - print("sup from stop_batch_operation") return await self.client._rpc_call( rpc="stop_batch_operation", req=req, @@ -1530,7 +1451,6 @@ async def terminate_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.TerminateWorkflowExecutionResponse: - print("sup from terminate_workflow_execution") return await self.client._rpc_call( rpc="terminate_workflow_execution", req=req, @@ -1549,7 +1469,6 @@ async def trigger_workflow_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.TriggerWorkflowRuleResponse: - print("sup from trigger_workflow_rule") return await self.client._rpc_call( rpc="trigger_workflow_rule", req=req, @@ -1568,7 +1487,6 @@ async def unpause_activity( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UnpauseActivityResponse: - print("sup from unpause_activity") return await self.client._rpc_call( rpc="unpause_activity", req=req, @@ -1587,7 +1505,6 @@ async def update_activity_options( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateActivityOptionsResponse: - print("sup from update_activity_options") return await self.client._rpc_call( rpc="update_activity_options", req=req, @@ -1606,7 +1523,6 @@ async def update_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateNamespaceResponse: - print("sup from update_namespace") return await self.client._rpc_call( rpc="update_namespace", req=req, @@ -1625,7 +1541,6 @@ async def update_schedule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateScheduleResponse: - print("sup from update_schedule") return await self.client._rpc_call( rpc="update_schedule", req=req, @@ -1644,7 +1559,6 @@ async def update_task_queue_config( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateTaskQueueConfigResponse: - print("sup from update_task_queue_config") return await self.client._rpc_call( rpc="update_task_queue_config", req=req, @@ -1663,7 +1577,6 @@ async def update_worker_build_id_compatibility( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityResponse: - print("sup from update_worker_build_id_compatibility") return await self.client._rpc_call( rpc="update_worker_build_id_compatibility", req=req, @@ -1682,7 +1595,6 @@ async def update_worker_config( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateWorkerConfigResponse: - print("sup from update_worker_config") return await self.client._rpc_call( rpc="update_worker_config", req=req, @@ -1701,7 +1613,6 @@ async def update_worker_deployment_version_metadata( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataResponse: - print("sup from update_worker_deployment_version_metadata") return await self.client._rpc_call( rpc="update_worker_deployment_version_metadata", req=req, @@ -1720,7 +1631,6 @@ async def update_worker_versioning_rules( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateWorkerVersioningRulesResponse: - print("sup from update_worker_versioning_rules") return await self.client._rpc_call( rpc="update_worker_versioning_rules", req=req, @@ -1739,7 +1649,6 @@ async def update_workflow_execution( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateWorkflowExecutionResponse: - print("sup from update_workflow_execution") return await self.client._rpc_call( rpc="update_workflow_execution", req=req, @@ -1758,7 +1667,6 @@ async def update_workflow_execution_options( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.workflowservice.v1.UpdateWorkflowExecutionOptionsResponse: - print("sup from update_workflow_execution_options") return await self.client._rpc_call( rpc="update_workflow_execution_options", req=req, @@ -1783,7 +1691,6 @@ async def add_or_update_remote_cluster( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.AddOrUpdateRemoteClusterResponse: - print("sup from add_or_update_remote_cluster") return await self.client._rpc_call( rpc="add_or_update_remote_cluster", req=req, @@ -1802,7 +1709,6 @@ async def add_search_attributes( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.AddSearchAttributesResponse: - print("sup from add_search_attributes") return await self.client._rpc_call( rpc="add_search_attributes", req=req, @@ -1821,7 +1727,6 @@ async def create_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.CreateNexusEndpointResponse: - print("sup from create_nexus_endpoint") return await self.client._rpc_call( rpc="create_nexus_endpoint", req=req, @@ -1840,7 +1745,6 @@ async def delete_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.DeleteNamespaceResponse: - print("sup from delete_namespace") return await self.client._rpc_call( rpc="delete_namespace", req=req, @@ -1859,7 +1763,6 @@ async def delete_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.DeleteNexusEndpointResponse: - print("sup from delete_nexus_endpoint") return await self.client._rpc_call( rpc="delete_nexus_endpoint", req=req, @@ -1878,7 +1781,6 @@ async def get_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.GetNexusEndpointResponse: - print("sup from get_nexus_endpoint") return await self.client._rpc_call( rpc="get_nexus_endpoint", req=req, @@ -1897,7 +1799,6 @@ async def list_clusters( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.ListClustersResponse: - print("sup from list_clusters") return await self.client._rpc_call( rpc="list_clusters", req=req, @@ -1916,7 +1817,6 @@ async def list_nexus_endpoints( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.ListNexusEndpointsResponse: - print("sup from list_nexus_endpoints") return await self.client._rpc_call( rpc="list_nexus_endpoints", req=req, @@ -1935,7 +1835,6 @@ async def list_search_attributes( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.ListSearchAttributesResponse: - print("sup from list_search_attributes") return await self.client._rpc_call( rpc="list_search_attributes", req=req, @@ -1954,7 +1853,6 @@ async def remove_remote_cluster( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.RemoveRemoteClusterResponse: - print("sup from remove_remote_cluster") return await self.client._rpc_call( rpc="remove_remote_cluster", req=req, @@ -1973,7 +1871,6 @@ async def remove_search_attributes( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.RemoveSearchAttributesResponse: - print("sup from remove_search_attributes") return await self.client._rpc_call( rpc="remove_search_attributes", req=req, @@ -1992,7 +1889,6 @@ async def update_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.operatorservice.v1.UpdateNexusEndpointResponse: - print("sup from update_nexus_endpoint") return await self.client._rpc_call( rpc="update_nexus_endpoint", req=req, @@ -2017,7 +1913,6 @@ async def add_namespace_region( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.AddNamespaceRegionResponse: - print("sup from add_namespace_region") return await self.client._rpc_call( rpc="add_namespace_region", req=req, @@ -2036,7 +1931,6 @@ async def add_user_group_member( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.AddUserGroupMemberResponse: - print("sup from add_user_group_member") return await self.client._rpc_call( rpc="add_user_group_member", req=req, @@ -2055,7 +1949,6 @@ async def create_api_key( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateApiKeyResponse: - print("sup from create_api_key") return await self.client._rpc_call( rpc="create_api_key", req=req, @@ -2074,7 +1967,6 @@ async def create_connectivity_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateConnectivityRuleResponse: - print("sup from create_connectivity_rule") return await self.client._rpc_call( rpc="create_connectivity_rule", req=req, @@ -2093,7 +1985,6 @@ async def create_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateNamespaceResponse: - print("sup from create_namespace") return await self.client._rpc_call( rpc="create_namespace", req=req, @@ -2112,7 +2003,6 @@ async def create_namespace_export_sink( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateNamespaceExportSinkResponse: - print("sup from create_namespace_export_sink") return await self.client._rpc_call( rpc="create_namespace_export_sink", req=req, @@ -2131,7 +2021,6 @@ async def create_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateNexusEndpointResponse: - print("sup from create_nexus_endpoint") return await self.client._rpc_call( rpc="create_nexus_endpoint", req=req, @@ -2150,7 +2039,6 @@ async def create_service_account( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateServiceAccountResponse: - print("sup from create_service_account") return await self.client._rpc_call( rpc="create_service_account", req=req, @@ -2169,7 +2057,6 @@ async def create_user( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateUserResponse: - print("sup from create_user") return await self.client._rpc_call( rpc="create_user", req=req, @@ -2188,7 +2075,6 @@ async def create_user_group( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.CreateUserGroupResponse: - print("sup from create_user_group") return await self.client._rpc_call( rpc="create_user_group", req=req, @@ -2207,7 +2093,6 @@ async def delete_api_key( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteApiKeyResponse: - print("sup from delete_api_key") return await self.client._rpc_call( rpc="delete_api_key", req=req, @@ -2226,7 +2111,6 @@ async def delete_connectivity_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteConnectivityRuleResponse: - print("sup from delete_connectivity_rule") return await self.client._rpc_call( rpc="delete_connectivity_rule", req=req, @@ -2245,7 +2129,6 @@ async def delete_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteNamespaceResponse: - print("sup from delete_namespace") return await self.client._rpc_call( rpc="delete_namespace", req=req, @@ -2264,7 +2147,6 @@ async def delete_namespace_export_sink( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteNamespaceExportSinkResponse: - print("sup from delete_namespace_export_sink") return await self.client._rpc_call( rpc="delete_namespace_export_sink", req=req, @@ -2283,7 +2165,6 @@ async def delete_namespace_region( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRegionResponse: - print("sup from delete_namespace_region") return await self.client._rpc_call( rpc="delete_namespace_region", req=req, @@ -2302,7 +2183,6 @@ async def delete_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteNexusEndpointResponse: - print("sup from delete_nexus_endpoint") return await self.client._rpc_call( rpc="delete_nexus_endpoint", req=req, @@ -2321,7 +2201,6 @@ async def delete_service_account( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteServiceAccountResponse: - print("sup from delete_service_account") return await self.client._rpc_call( rpc="delete_service_account", req=req, @@ -2340,7 +2219,6 @@ async def delete_user( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteUserResponse: - print("sup from delete_user") return await self.client._rpc_call( rpc="delete_user", req=req, @@ -2359,7 +2237,6 @@ async def delete_user_group( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.DeleteUserGroupResponse: - print("sup from delete_user_group") return await self.client._rpc_call( rpc="delete_user_group", req=req, @@ -2378,7 +2255,6 @@ async def failover_namespace_region( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.FailoverNamespaceRegionResponse: - print("sup from failover_namespace_region") return await self.client._rpc_call( rpc="failover_namespace_region", req=req, @@ -2397,7 +2273,6 @@ async def get_account( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetAccountResponse: - print("sup from get_account") return await self.client._rpc_call( rpc="get_account", req=req, @@ -2416,7 +2291,6 @@ async def get_api_key( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetApiKeyResponse: - print("sup from get_api_key") return await self.client._rpc_call( rpc="get_api_key", req=req, @@ -2435,7 +2309,6 @@ async def get_api_keys( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetApiKeysResponse: - print("sup from get_api_keys") return await self.client._rpc_call( rpc="get_api_keys", req=req, @@ -2454,7 +2327,6 @@ async def get_async_operation( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetAsyncOperationResponse: - print("sup from get_async_operation") return await self.client._rpc_call( rpc="get_async_operation", req=req, @@ -2473,7 +2345,6 @@ async def get_connectivity_rule( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetConnectivityRuleResponse: - print("sup from get_connectivity_rule") return await self.client._rpc_call( rpc="get_connectivity_rule", req=req, @@ -2492,7 +2363,6 @@ async def get_connectivity_rules( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetConnectivityRulesResponse: - print("sup from get_connectivity_rules") return await self.client._rpc_call( rpc="get_connectivity_rules", req=req, @@ -2511,7 +2381,6 @@ async def get_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetNamespaceResponse: - print("sup from get_namespace") return await self.client._rpc_call( rpc="get_namespace", req=req, @@ -2530,7 +2399,6 @@ async def get_namespace_export_sink( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinkResponse: - print("sup from get_namespace_export_sink") return await self.client._rpc_call( rpc="get_namespace_export_sink", req=req, @@ -2549,7 +2417,6 @@ async def get_namespace_export_sinks( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinksResponse: - print("sup from get_namespace_export_sinks") return await self.client._rpc_call( rpc="get_namespace_export_sinks", req=req, @@ -2568,7 +2435,6 @@ async def get_namespaces( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetNamespacesResponse: - print("sup from get_namespaces") return await self.client._rpc_call( rpc="get_namespaces", req=req, @@ -2587,7 +2453,6 @@ async def get_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetNexusEndpointResponse: - print("sup from get_nexus_endpoint") return await self.client._rpc_call( rpc="get_nexus_endpoint", req=req, @@ -2606,7 +2471,6 @@ async def get_nexus_endpoints( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetNexusEndpointsResponse: - print("sup from get_nexus_endpoints") return await self.client._rpc_call( rpc="get_nexus_endpoints", req=req, @@ -2625,7 +2489,6 @@ async def get_region( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetRegionResponse: - print("sup from get_region") return await self.client._rpc_call( rpc="get_region", req=req, @@ -2644,7 +2507,6 @@ async def get_regions( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetRegionsResponse: - print("sup from get_regions") return await self.client._rpc_call( rpc="get_regions", req=req, @@ -2663,7 +2525,6 @@ async def get_service_account( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetServiceAccountResponse: - print("sup from get_service_account") return await self.client._rpc_call( rpc="get_service_account", req=req, @@ -2682,7 +2543,6 @@ async def get_service_accounts( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetServiceAccountsResponse: - print("sup from get_service_accounts") return await self.client._rpc_call( rpc="get_service_accounts", req=req, @@ -2701,7 +2561,6 @@ async def get_usage( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetUsageResponse: - print("sup from get_usage") return await self.client._rpc_call( rpc="get_usage", req=req, @@ -2720,7 +2579,6 @@ async def get_user( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetUserResponse: - print("sup from get_user") return await self.client._rpc_call( rpc="get_user", req=req, @@ -2739,7 +2597,6 @@ async def get_user_group( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetUserGroupResponse: - print("sup from get_user_group") return await self.client._rpc_call( rpc="get_user_group", req=req, @@ -2758,7 +2615,6 @@ async def get_user_group_members( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetUserGroupMembersResponse: - print("sup from get_user_group_members") return await self.client._rpc_call( rpc="get_user_group_members", req=req, @@ -2777,7 +2633,6 @@ async def get_user_groups( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetUserGroupsResponse: - print("sup from get_user_groups") return await self.client._rpc_call( rpc="get_user_groups", req=req, @@ -2796,7 +2651,6 @@ async def get_users( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.GetUsersResponse: - print("sup from get_users") return await self.client._rpc_call( rpc="get_users", req=req, @@ -2815,7 +2669,6 @@ async def remove_user_group_member( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.RemoveUserGroupMemberResponse: - print("sup from remove_user_group_member") return await self.client._rpc_call( rpc="remove_user_group_member", req=req, @@ -2834,7 +2687,6 @@ async def rename_custom_search_attribute( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.RenameCustomSearchAttributeResponse: - print("sup from rename_custom_search_attribute") return await self.client._rpc_call( rpc="rename_custom_search_attribute", req=req, @@ -2853,7 +2705,6 @@ async def set_user_group_namespace_access( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.SetUserGroupNamespaceAccessResponse: - print("sup from set_user_group_namespace_access") return await self.client._rpc_call( rpc="set_user_group_namespace_access", req=req, @@ -2872,7 +2723,6 @@ async def set_user_namespace_access( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.SetUserNamespaceAccessResponse: - print("sup from set_user_namespace_access") return await self.client._rpc_call( rpc="set_user_namespace_access", req=req, @@ -2891,7 +2741,6 @@ async def update_account( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateAccountResponse: - print("sup from update_account") return await self.client._rpc_call( rpc="update_account", req=req, @@ -2910,7 +2759,6 @@ async def update_api_key( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateApiKeyResponse: - print("sup from update_api_key") return await self.client._rpc_call( rpc="update_api_key", req=req, @@ -2929,7 +2777,6 @@ async def update_namespace( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateNamespaceResponse: - print("sup from update_namespace") return await self.client._rpc_call( rpc="update_namespace", req=req, @@ -2948,7 +2795,6 @@ async def update_namespace_export_sink( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateNamespaceExportSinkResponse: - print("sup from update_namespace_export_sink") return await self.client._rpc_call( rpc="update_namespace_export_sink", req=req, @@ -2967,7 +2813,6 @@ async def update_namespace_tags( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateNamespaceTagsResponse: - print("sup from update_namespace_tags") return await self.client._rpc_call( rpc="update_namespace_tags", req=req, @@ -2986,7 +2831,6 @@ async def update_nexus_endpoint( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateNexusEndpointResponse: - print("sup from update_nexus_endpoint") return await self.client._rpc_call( rpc="update_nexus_endpoint", req=req, @@ -3005,7 +2849,6 @@ async def update_service_account( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateServiceAccountResponse: - print("sup from update_service_account") return await self.client._rpc_call( rpc="update_service_account", req=req, @@ -3024,7 +2867,6 @@ async def update_user( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateUserResponse: - print("sup from update_user") return await self.client._rpc_call( rpc="update_user", req=req, @@ -3043,7 +2885,6 @@ async def update_user_group( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.UpdateUserGroupResponse: - print("sup from update_user_group") return await self.client._rpc_call( rpc="update_user_group", req=req, @@ -3062,7 +2903,6 @@ async def validate_namespace_export_sink( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.cloud.cloudservice.v1.ValidateNamespaceExportSinkResponse: - print("sup from validate_namespace_export_sink") return await self.client._rpc_call( rpc="validate_namespace_export_sink", req=req, @@ -3087,7 +2927,6 @@ async def get_current_time( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.testservice.v1.GetCurrentTimeResponse: - print("sup from get_current_time") return await self.client._rpc_call( rpc="get_current_time", req=req, @@ -3106,7 +2945,6 @@ async def lock_time_skipping( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.testservice.v1.LockTimeSkippingResponse: - print("sup from lock_time_skipping") return await self.client._rpc_call( rpc="lock_time_skipping", req=req, @@ -3125,7 +2963,6 @@ async def sleep( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.testservice.v1.SleepResponse: - print("sup from sleep") return await self.client._rpc_call( rpc="sleep", req=req, @@ -3144,7 +2981,6 @@ async def sleep_until( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.testservice.v1.SleepResponse: - print("sup from sleep_until") return await self.client._rpc_call( rpc="sleep_until", req=req, @@ -3163,7 +2999,6 @@ async def unlock_time_skipping( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.testservice.v1.UnlockTimeSkippingResponse: - print("sup from unlock_time_skipping") return await self.client._rpc_call( rpc="unlock_time_skipping", req=req, @@ -3182,7 +3017,6 @@ async def unlock_time_skipping_with_sleep( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.api.testservice.v1.SleepResponse: - print("sup from unlock_time_skipping_with_sleep") return await self.client._rpc_call( rpc="unlock_time_skipping_with_sleep", req=req, @@ -3207,7 +3041,6 @@ async def check( metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, ) -> temporalio.bridge.proto.health.v1.HealthCheckResponse: - print("sup from check") return await self.client._rpc_call( rpc="check", req=req, From 77c4dd8e727fa2fd801cfb68eb5717b8ec7f385d Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Mon, 29 Sep 2025 15:05:01 -0700 Subject: [PATCH 5/7] run format after generating files --- scripts/gen_protos_docker.py | 3 +- temporalio/bridge/services_generated.py | 180 +----------------------- tests/test_client.py | 1 - 3 files changed, 9 insertions(+), 175 deletions(-) diff --git a/scripts/gen_protos_docker.py b/scripts/gen_protos_docker.py index 64ff81600..94731bda2 100644 --- a/scripts/gen_protos_docker.py +++ b/scripts/gen_protos_docker.py @@ -30,7 +30,6 @@ ], check=True, ) -subprocess.run(["uv", "run", "poe", "format"], check=True) subprocess.run( ["uv", "run", os.path.join(os.getcwd(), "scripts", "gen_payload_visitor.py")], @@ -41,3 +40,5 @@ ["uv", "run", os.path.join(os.getcwd(), "scripts", "gen_bridge_client.py")], check=True, ) + +subprocess.run(["uv", "run", "poe", "format"], check=True) diff --git a/temporalio/bridge/services_generated.py b/temporalio/bridge/services_generated.py index b860582e9..e0841d382 100644 --- a/temporalio/bridge/services_generated.py +++ b/temporalio/bridge/services_generated.py @@ -3,16 +3,16 @@ from __future__ import annotations from datetime import timedelta -from typing import Mapping, Optional, Union, TYPE_CHECKING +from typing import TYPE_CHECKING, Mapping, Optional, Union + import google.protobuf.empty_pb2 -import temporalio.api.workflowservice.v1 -import temporalio.api.operatorservice.v1 import temporalio.api.cloud.cloudservice.v1 +import temporalio.api.operatorservice.v1 import temporalio.api.testservice.v1 +import temporalio.api.workflowservice.v1 import temporalio.bridge.proto.health.v1 - if TYPE_CHECKING: from temporalio.service import ServiceClient @@ -39,7 +39,6 @@ async def count_workflow_executions( timeout=timeout, ) - async def create_schedule( self, req: temporalio.api.workflowservice.v1.CreateScheduleRequest, @@ -57,7 +56,6 @@ async def create_schedule( timeout=timeout, ) - async def create_workflow_rule( self, req: temporalio.api.workflowservice.v1.CreateWorkflowRuleRequest, @@ -75,7 +73,6 @@ async def create_workflow_rule( timeout=timeout, ) - async def delete_schedule( self, req: temporalio.api.workflowservice.v1.DeleteScheduleRequest, @@ -93,7 +90,6 @@ async def delete_schedule( timeout=timeout, ) - async def delete_worker_deployment( self, req: temporalio.api.workflowservice.v1.DeleteWorkerDeploymentRequest, @@ -111,7 +107,6 @@ async def delete_worker_deployment( timeout=timeout, ) - async def delete_worker_deployment_version( self, req: temporalio.api.workflowservice.v1.DeleteWorkerDeploymentVersionRequest, @@ -129,7 +124,6 @@ async def delete_worker_deployment_version( timeout=timeout, ) - async def delete_workflow_execution( self, req: temporalio.api.workflowservice.v1.DeleteWorkflowExecutionRequest, @@ -147,7 +141,6 @@ async def delete_workflow_execution( timeout=timeout, ) - async def delete_workflow_rule( self, req: temporalio.api.workflowservice.v1.DeleteWorkflowRuleRequest, @@ -165,7 +158,6 @@ async def delete_workflow_rule( timeout=timeout, ) - async def deprecate_namespace( self, req: temporalio.api.workflowservice.v1.DeprecateNamespaceRequest, @@ -183,7 +175,6 @@ async def deprecate_namespace( timeout=timeout, ) - async def describe_batch_operation( self, req: temporalio.api.workflowservice.v1.DescribeBatchOperationRequest, @@ -201,7 +192,6 @@ async def describe_batch_operation( timeout=timeout, ) - async def describe_deployment( self, req: temporalio.api.workflowservice.v1.DescribeDeploymentRequest, @@ -219,7 +209,6 @@ async def describe_deployment( timeout=timeout, ) - async def describe_namespace( self, req: temporalio.api.workflowservice.v1.DescribeNamespaceRequest, @@ -237,7 +226,6 @@ async def describe_namespace( timeout=timeout, ) - async def describe_schedule( self, req: temporalio.api.workflowservice.v1.DescribeScheduleRequest, @@ -255,7 +243,6 @@ async def describe_schedule( timeout=timeout, ) - async def describe_task_queue( self, req: temporalio.api.workflowservice.v1.DescribeTaskQueueRequest, @@ -273,7 +260,6 @@ async def describe_task_queue( timeout=timeout, ) - async def describe_worker_deployment( self, req: temporalio.api.workflowservice.v1.DescribeWorkerDeploymentRequest, @@ -291,7 +277,6 @@ async def describe_worker_deployment( timeout=timeout, ) - async def describe_worker_deployment_version( self, req: temporalio.api.workflowservice.v1.DescribeWorkerDeploymentVersionRequest, @@ -309,7 +294,6 @@ async def describe_worker_deployment_version( timeout=timeout, ) - async def describe_workflow_execution( self, req: temporalio.api.workflowservice.v1.DescribeWorkflowExecutionRequest, @@ -327,7 +311,6 @@ async def describe_workflow_execution( timeout=timeout, ) - async def describe_workflow_rule( self, req: temporalio.api.workflowservice.v1.DescribeWorkflowRuleRequest, @@ -345,7 +328,6 @@ async def describe_workflow_rule( timeout=timeout, ) - async def execute_multi_operation( self, req: temporalio.api.workflowservice.v1.ExecuteMultiOperationRequest, @@ -363,7 +345,6 @@ async def execute_multi_operation( timeout=timeout, ) - async def fetch_worker_config( self, req: temporalio.api.workflowservice.v1.FetchWorkerConfigRequest, @@ -381,7 +362,6 @@ async def fetch_worker_config( timeout=timeout, ) - async def get_cluster_info( self, req: temporalio.api.workflowservice.v1.GetClusterInfoRequest, @@ -399,7 +379,6 @@ async def get_cluster_info( timeout=timeout, ) - async def get_current_deployment( self, req: temporalio.api.workflowservice.v1.GetCurrentDeploymentRequest, @@ -417,7 +396,6 @@ async def get_current_deployment( timeout=timeout, ) - async def get_deployment_reachability( self, req: temporalio.api.workflowservice.v1.GetDeploymentReachabilityRequest, @@ -435,7 +413,6 @@ async def get_deployment_reachability( timeout=timeout, ) - async def get_search_attributes( self, req: temporalio.api.workflowservice.v1.GetSearchAttributesRequest, @@ -453,7 +430,6 @@ async def get_search_attributes( timeout=timeout, ) - async def get_system_info( self, req: temporalio.api.workflowservice.v1.GetSystemInfoRequest, @@ -471,7 +447,6 @@ async def get_system_info( timeout=timeout, ) - async def get_worker_build_id_compatibility( self, req: temporalio.api.workflowservice.v1.GetWorkerBuildIdCompatibilityRequest, @@ -489,7 +464,6 @@ async def get_worker_build_id_compatibility( timeout=timeout, ) - async def get_worker_task_reachability( self, req: temporalio.api.workflowservice.v1.GetWorkerTaskReachabilityRequest, @@ -507,7 +481,6 @@ async def get_worker_task_reachability( timeout=timeout, ) - async def get_worker_versioning_rules( self, req: temporalio.api.workflowservice.v1.GetWorkerVersioningRulesRequest, @@ -525,7 +498,6 @@ async def get_worker_versioning_rules( timeout=timeout, ) - async def get_workflow_execution_history( self, req: temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryRequest, @@ -543,7 +515,6 @@ async def get_workflow_execution_history( timeout=timeout, ) - async def get_workflow_execution_history_reverse( self, req: temporalio.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseRequest, @@ -561,7 +532,6 @@ async def get_workflow_execution_history_reverse( timeout=timeout, ) - async def list_archived_workflow_executions( self, req: temporalio.api.workflowservice.v1.ListArchivedWorkflowExecutionsRequest, @@ -579,7 +549,6 @@ async def list_archived_workflow_executions( timeout=timeout, ) - async def list_batch_operations( self, req: temporalio.api.workflowservice.v1.ListBatchOperationsRequest, @@ -597,7 +566,6 @@ async def list_batch_operations( timeout=timeout, ) - async def list_closed_workflow_executions( self, req: temporalio.api.workflowservice.v1.ListClosedWorkflowExecutionsRequest, @@ -615,7 +583,6 @@ async def list_closed_workflow_executions( timeout=timeout, ) - async def list_deployments( self, req: temporalio.api.workflowservice.v1.ListDeploymentsRequest, @@ -633,7 +600,6 @@ async def list_deployments( timeout=timeout, ) - async def list_namespaces( self, req: temporalio.api.workflowservice.v1.ListNamespacesRequest, @@ -651,7 +617,6 @@ async def list_namespaces( timeout=timeout, ) - async def list_open_workflow_executions( self, req: temporalio.api.workflowservice.v1.ListOpenWorkflowExecutionsRequest, @@ -669,7 +634,6 @@ async def list_open_workflow_executions( timeout=timeout, ) - async def list_schedule_matching_times( self, req: temporalio.api.workflowservice.v1.ListScheduleMatchingTimesRequest, @@ -687,7 +651,6 @@ async def list_schedule_matching_times( timeout=timeout, ) - async def list_schedules( self, req: temporalio.api.workflowservice.v1.ListSchedulesRequest, @@ -705,7 +668,6 @@ async def list_schedules( timeout=timeout, ) - async def list_task_queue_partitions( self, req: temporalio.api.workflowservice.v1.ListTaskQueuePartitionsRequest, @@ -723,7 +685,6 @@ async def list_task_queue_partitions( timeout=timeout, ) - async def list_worker_deployments( self, req: temporalio.api.workflowservice.v1.ListWorkerDeploymentsRequest, @@ -741,7 +702,6 @@ async def list_worker_deployments( timeout=timeout, ) - async def list_workers( self, req: temporalio.api.workflowservice.v1.ListWorkersRequest, @@ -759,7 +719,6 @@ async def list_workers( timeout=timeout, ) - async def list_workflow_executions( self, req: temporalio.api.workflowservice.v1.ListWorkflowExecutionsRequest, @@ -777,7 +736,6 @@ async def list_workflow_executions( timeout=timeout, ) - async def list_workflow_rules( self, req: temporalio.api.workflowservice.v1.ListWorkflowRulesRequest, @@ -795,7 +753,6 @@ async def list_workflow_rules( timeout=timeout, ) - async def patch_schedule( self, req: temporalio.api.workflowservice.v1.PatchScheduleRequest, @@ -813,7 +770,6 @@ async def patch_schedule( timeout=timeout, ) - async def pause_activity( self, req: temporalio.api.workflowservice.v1.PauseActivityRequest, @@ -831,7 +787,6 @@ async def pause_activity( timeout=timeout, ) - async def poll_activity_task_queue( self, req: temporalio.api.workflowservice.v1.PollActivityTaskQueueRequest, @@ -849,7 +804,6 @@ async def poll_activity_task_queue( timeout=timeout, ) - async def poll_nexus_task_queue( self, req: temporalio.api.workflowservice.v1.PollNexusTaskQueueRequest, @@ -867,7 +821,6 @@ async def poll_nexus_task_queue( timeout=timeout, ) - async def poll_workflow_execution_update( self, req: temporalio.api.workflowservice.v1.PollWorkflowExecutionUpdateRequest, @@ -885,7 +838,6 @@ async def poll_workflow_execution_update( timeout=timeout, ) - async def poll_workflow_task_queue( self, req: temporalio.api.workflowservice.v1.PollWorkflowTaskQueueRequest, @@ -903,7 +855,6 @@ async def poll_workflow_task_queue( timeout=timeout, ) - async def query_workflow( self, req: temporalio.api.workflowservice.v1.QueryWorkflowRequest, @@ -921,7 +872,6 @@ async def query_workflow( timeout=timeout, ) - async def record_activity_task_heartbeat( self, req: temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatRequest, @@ -939,7 +889,6 @@ async def record_activity_task_heartbeat( timeout=timeout, ) - async def record_activity_task_heartbeat_by_id( self, req: temporalio.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdRequest, @@ -957,7 +906,6 @@ async def record_activity_task_heartbeat_by_id( timeout=timeout, ) - async def record_worker_heartbeat( self, req: temporalio.api.workflowservice.v1.RecordWorkerHeartbeatRequest, @@ -975,7 +923,6 @@ async def record_worker_heartbeat( timeout=timeout, ) - async def register_namespace( self, req: temporalio.api.workflowservice.v1.RegisterNamespaceRequest, @@ -993,7 +940,6 @@ async def register_namespace( timeout=timeout, ) - async def request_cancel_workflow_execution( self, req: temporalio.api.workflowservice.v1.RequestCancelWorkflowExecutionRequest, @@ -1011,7 +957,6 @@ async def request_cancel_workflow_execution( timeout=timeout, ) - async def reset_activity( self, req: temporalio.api.workflowservice.v1.ResetActivityRequest, @@ -1029,7 +974,6 @@ async def reset_activity( timeout=timeout, ) - async def reset_sticky_task_queue( self, req: temporalio.api.workflowservice.v1.ResetStickyTaskQueueRequest, @@ -1047,7 +991,6 @@ async def reset_sticky_task_queue( timeout=timeout, ) - async def reset_workflow_execution( self, req: temporalio.api.workflowservice.v1.ResetWorkflowExecutionRequest, @@ -1065,7 +1008,6 @@ async def reset_workflow_execution( timeout=timeout, ) - async def respond_activity_task_canceled( self, req: temporalio.api.workflowservice.v1.RespondActivityTaskCanceledRequest, @@ -1083,7 +1025,6 @@ async def respond_activity_task_canceled( timeout=timeout, ) - async def respond_activity_task_canceled_by_id( self, req: temporalio.api.workflowservice.v1.RespondActivityTaskCanceledByIdRequest, @@ -1101,7 +1042,6 @@ async def respond_activity_task_canceled_by_id( timeout=timeout, ) - async def respond_activity_task_completed( self, req: temporalio.api.workflowservice.v1.RespondActivityTaskCompletedRequest, @@ -1119,7 +1059,6 @@ async def respond_activity_task_completed( timeout=timeout, ) - async def respond_activity_task_completed_by_id( self, req: temporalio.api.workflowservice.v1.RespondActivityTaskCompletedByIdRequest, @@ -1137,7 +1076,6 @@ async def respond_activity_task_completed_by_id( timeout=timeout, ) - async def respond_activity_task_failed( self, req: temporalio.api.workflowservice.v1.RespondActivityTaskFailedRequest, @@ -1155,7 +1093,6 @@ async def respond_activity_task_failed( timeout=timeout, ) - async def respond_activity_task_failed_by_id( self, req: temporalio.api.workflowservice.v1.RespondActivityTaskFailedByIdRequest, @@ -1173,7 +1110,6 @@ async def respond_activity_task_failed_by_id( timeout=timeout, ) - async def respond_nexus_task_completed( self, req: temporalio.api.workflowservice.v1.RespondNexusTaskCompletedRequest, @@ -1191,7 +1127,6 @@ async def respond_nexus_task_completed( timeout=timeout, ) - async def respond_nexus_task_failed( self, req: temporalio.api.workflowservice.v1.RespondNexusTaskFailedRequest, @@ -1209,7 +1144,6 @@ async def respond_nexus_task_failed( timeout=timeout, ) - async def respond_query_task_completed( self, req: temporalio.api.workflowservice.v1.RespondQueryTaskCompletedRequest, @@ -1227,7 +1161,6 @@ async def respond_query_task_completed( timeout=timeout, ) - async def respond_workflow_task_completed( self, req: temporalio.api.workflowservice.v1.RespondWorkflowTaskCompletedRequest, @@ -1245,7 +1178,6 @@ async def respond_workflow_task_completed( timeout=timeout, ) - async def respond_workflow_task_failed( self, req: temporalio.api.workflowservice.v1.RespondWorkflowTaskFailedRequest, @@ -1263,7 +1195,6 @@ async def respond_workflow_task_failed( timeout=timeout, ) - async def scan_workflow_executions( self, req: temporalio.api.workflowservice.v1.ScanWorkflowExecutionsRequest, @@ -1281,7 +1212,6 @@ async def scan_workflow_executions( timeout=timeout, ) - async def set_current_deployment( self, req: temporalio.api.workflowservice.v1.SetCurrentDeploymentRequest, @@ -1299,7 +1229,6 @@ async def set_current_deployment( timeout=timeout, ) - async def set_worker_deployment_current_version( self, req: temporalio.api.workflowservice.v1.SetWorkerDeploymentCurrentVersionRequest, @@ -1317,7 +1246,6 @@ async def set_worker_deployment_current_version( timeout=timeout, ) - async def set_worker_deployment_ramping_version( self, req: temporalio.api.workflowservice.v1.SetWorkerDeploymentRampingVersionRequest, @@ -1335,7 +1263,6 @@ async def set_worker_deployment_ramping_version( timeout=timeout, ) - async def shutdown_worker( self, req: temporalio.api.workflowservice.v1.ShutdownWorkerRequest, @@ -1353,7 +1280,6 @@ async def shutdown_worker( timeout=timeout, ) - async def signal_with_start_workflow_execution( self, req: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest, @@ -1371,7 +1297,6 @@ async def signal_with_start_workflow_execution( timeout=timeout, ) - async def signal_workflow_execution( self, req: temporalio.api.workflowservice.v1.SignalWorkflowExecutionRequest, @@ -1389,7 +1314,6 @@ async def signal_workflow_execution( timeout=timeout, ) - async def start_batch_operation( self, req: temporalio.api.workflowservice.v1.StartBatchOperationRequest, @@ -1407,7 +1331,6 @@ async def start_batch_operation( timeout=timeout, ) - async def start_workflow_execution( self, req: temporalio.api.workflowservice.v1.StartWorkflowExecutionRequest, @@ -1425,7 +1348,6 @@ async def start_workflow_execution( timeout=timeout, ) - async def stop_batch_operation( self, req: temporalio.api.workflowservice.v1.StopBatchOperationRequest, @@ -1443,7 +1365,6 @@ async def stop_batch_operation( timeout=timeout, ) - async def terminate_workflow_execution( self, req: temporalio.api.workflowservice.v1.TerminateWorkflowExecutionRequest, @@ -1461,7 +1382,6 @@ async def terminate_workflow_execution( timeout=timeout, ) - async def trigger_workflow_rule( self, req: temporalio.api.workflowservice.v1.TriggerWorkflowRuleRequest, @@ -1479,7 +1399,6 @@ async def trigger_workflow_rule( timeout=timeout, ) - async def unpause_activity( self, req: temporalio.api.workflowservice.v1.UnpauseActivityRequest, @@ -1497,7 +1416,6 @@ async def unpause_activity( timeout=timeout, ) - async def update_activity_options( self, req: temporalio.api.workflowservice.v1.UpdateActivityOptionsRequest, @@ -1515,7 +1433,6 @@ async def update_activity_options( timeout=timeout, ) - async def update_namespace( self, req: temporalio.api.workflowservice.v1.UpdateNamespaceRequest, @@ -1533,7 +1450,6 @@ async def update_namespace( timeout=timeout, ) - async def update_schedule( self, req: temporalio.api.workflowservice.v1.UpdateScheduleRequest, @@ -1551,7 +1467,6 @@ async def update_schedule( timeout=timeout, ) - async def update_task_queue_config( self, req: temporalio.api.workflowservice.v1.UpdateTaskQueueConfigRequest, @@ -1569,7 +1484,6 @@ async def update_task_queue_config( timeout=timeout, ) - async def update_worker_build_id_compatibility( self, req: temporalio.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest, @@ -1587,7 +1501,6 @@ async def update_worker_build_id_compatibility( timeout=timeout, ) - async def update_worker_config( self, req: temporalio.api.workflowservice.v1.UpdateWorkerConfigRequest, @@ -1605,14 +1518,15 @@ async def update_worker_config( timeout=timeout, ) - async def update_worker_deployment_version_metadata( self, req: temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataRequest, retry: bool = False, metadata: Mapping[str, Union[str, bytes]] = {}, timeout: Optional[timedelta] = None, - ) -> temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataResponse: + ) -> ( + temporalio.api.workflowservice.v1.UpdateWorkerDeploymentVersionMetadataResponse + ): return await self.client._rpc_call( rpc="update_worker_deployment_version_metadata", req=req, @@ -1623,7 +1537,6 @@ async def update_worker_deployment_version_metadata( timeout=timeout, ) - async def update_worker_versioning_rules( self, req: temporalio.api.workflowservice.v1.UpdateWorkerVersioningRulesRequest, @@ -1641,7 +1554,6 @@ async def update_worker_versioning_rules( timeout=timeout, ) - async def update_workflow_execution( self, req: temporalio.api.workflowservice.v1.UpdateWorkflowExecutionRequest, @@ -1659,7 +1571,6 @@ async def update_workflow_execution( timeout=timeout, ) - async def update_workflow_execution_options( self, req: temporalio.api.workflowservice.v1.UpdateWorkflowExecutionOptionsRequest, @@ -1678,7 +1589,6 @@ async def update_workflow_execution_options( ) - class OperatorService: def __init__(self, client: ServiceClient): self.client = client @@ -1701,7 +1611,6 @@ async def add_or_update_remote_cluster( timeout=timeout, ) - async def add_search_attributes( self, req: temporalio.api.operatorservice.v1.AddSearchAttributesRequest, @@ -1719,7 +1628,6 @@ async def add_search_attributes( timeout=timeout, ) - async def create_nexus_endpoint( self, req: temporalio.api.operatorservice.v1.CreateNexusEndpointRequest, @@ -1737,7 +1645,6 @@ async def create_nexus_endpoint( timeout=timeout, ) - async def delete_namespace( self, req: temporalio.api.operatorservice.v1.DeleteNamespaceRequest, @@ -1755,7 +1662,6 @@ async def delete_namespace( timeout=timeout, ) - async def delete_nexus_endpoint( self, req: temporalio.api.operatorservice.v1.DeleteNexusEndpointRequest, @@ -1773,7 +1679,6 @@ async def delete_nexus_endpoint( timeout=timeout, ) - async def get_nexus_endpoint( self, req: temporalio.api.operatorservice.v1.GetNexusEndpointRequest, @@ -1791,7 +1696,6 @@ async def get_nexus_endpoint( timeout=timeout, ) - async def list_clusters( self, req: temporalio.api.operatorservice.v1.ListClustersRequest, @@ -1809,7 +1713,6 @@ async def list_clusters( timeout=timeout, ) - async def list_nexus_endpoints( self, req: temporalio.api.operatorservice.v1.ListNexusEndpointsRequest, @@ -1827,7 +1730,6 @@ async def list_nexus_endpoints( timeout=timeout, ) - async def list_search_attributes( self, req: temporalio.api.operatorservice.v1.ListSearchAttributesRequest, @@ -1845,7 +1747,6 @@ async def list_search_attributes( timeout=timeout, ) - async def remove_remote_cluster( self, req: temporalio.api.operatorservice.v1.RemoveRemoteClusterRequest, @@ -1863,7 +1764,6 @@ async def remove_remote_cluster( timeout=timeout, ) - async def remove_search_attributes( self, req: temporalio.api.operatorservice.v1.RemoveSearchAttributesRequest, @@ -1881,7 +1781,6 @@ async def remove_search_attributes( timeout=timeout, ) - async def update_nexus_endpoint( self, req: temporalio.api.operatorservice.v1.UpdateNexusEndpointRequest, @@ -1900,7 +1799,6 @@ async def update_nexus_endpoint( ) - class CloudService: def __init__(self, client: ServiceClient): self.client = client @@ -1923,7 +1821,6 @@ async def add_namespace_region( timeout=timeout, ) - async def add_user_group_member( self, req: temporalio.api.cloud.cloudservice.v1.AddUserGroupMemberRequest, @@ -1941,7 +1838,6 @@ async def add_user_group_member( timeout=timeout, ) - async def create_api_key( self, req: temporalio.api.cloud.cloudservice.v1.CreateApiKeyRequest, @@ -1959,7 +1855,6 @@ async def create_api_key( timeout=timeout, ) - async def create_connectivity_rule( self, req: temporalio.api.cloud.cloudservice.v1.CreateConnectivityRuleRequest, @@ -1977,7 +1872,6 @@ async def create_connectivity_rule( timeout=timeout, ) - async def create_namespace( self, req: temporalio.api.cloud.cloudservice.v1.CreateNamespaceRequest, @@ -1995,7 +1889,6 @@ async def create_namespace( timeout=timeout, ) - async def create_namespace_export_sink( self, req: temporalio.api.cloud.cloudservice.v1.CreateNamespaceExportSinkRequest, @@ -2013,7 +1906,6 @@ async def create_namespace_export_sink( timeout=timeout, ) - async def create_nexus_endpoint( self, req: temporalio.api.cloud.cloudservice.v1.CreateNexusEndpointRequest, @@ -2031,7 +1923,6 @@ async def create_nexus_endpoint( timeout=timeout, ) - async def create_service_account( self, req: temporalio.api.cloud.cloudservice.v1.CreateServiceAccountRequest, @@ -2049,7 +1940,6 @@ async def create_service_account( timeout=timeout, ) - async def create_user( self, req: temporalio.api.cloud.cloudservice.v1.CreateUserRequest, @@ -2067,7 +1957,6 @@ async def create_user( timeout=timeout, ) - async def create_user_group( self, req: temporalio.api.cloud.cloudservice.v1.CreateUserGroupRequest, @@ -2085,7 +1974,6 @@ async def create_user_group( timeout=timeout, ) - async def delete_api_key( self, req: temporalio.api.cloud.cloudservice.v1.DeleteApiKeyRequest, @@ -2103,7 +1991,6 @@ async def delete_api_key( timeout=timeout, ) - async def delete_connectivity_rule( self, req: temporalio.api.cloud.cloudservice.v1.DeleteConnectivityRuleRequest, @@ -2121,7 +2008,6 @@ async def delete_connectivity_rule( timeout=timeout, ) - async def delete_namespace( self, req: temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRequest, @@ -2139,7 +2025,6 @@ async def delete_namespace( timeout=timeout, ) - async def delete_namespace_export_sink( self, req: temporalio.api.cloud.cloudservice.v1.DeleteNamespaceExportSinkRequest, @@ -2157,7 +2042,6 @@ async def delete_namespace_export_sink( timeout=timeout, ) - async def delete_namespace_region( self, req: temporalio.api.cloud.cloudservice.v1.DeleteNamespaceRegionRequest, @@ -2175,7 +2059,6 @@ async def delete_namespace_region( timeout=timeout, ) - async def delete_nexus_endpoint( self, req: temporalio.api.cloud.cloudservice.v1.DeleteNexusEndpointRequest, @@ -2193,7 +2076,6 @@ async def delete_nexus_endpoint( timeout=timeout, ) - async def delete_service_account( self, req: temporalio.api.cloud.cloudservice.v1.DeleteServiceAccountRequest, @@ -2211,7 +2093,6 @@ async def delete_service_account( timeout=timeout, ) - async def delete_user( self, req: temporalio.api.cloud.cloudservice.v1.DeleteUserRequest, @@ -2229,7 +2110,6 @@ async def delete_user( timeout=timeout, ) - async def delete_user_group( self, req: temporalio.api.cloud.cloudservice.v1.DeleteUserGroupRequest, @@ -2247,7 +2127,6 @@ async def delete_user_group( timeout=timeout, ) - async def failover_namespace_region( self, req: temporalio.api.cloud.cloudservice.v1.FailoverNamespaceRegionRequest, @@ -2265,7 +2144,6 @@ async def failover_namespace_region( timeout=timeout, ) - async def get_account( self, req: temporalio.api.cloud.cloudservice.v1.GetAccountRequest, @@ -2283,7 +2161,6 @@ async def get_account( timeout=timeout, ) - async def get_api_key( self, req: temporalio.api.cloud.cloudservice.v1.GetApiKeyRequest, @@ -2301,7 +2178,6 @@ async def get_api_key( timeout=timeout, ) - async def get_api_keys( self, req: temporalio.api.cloud.cloudservice.v1.GetApiKeysRequest, @@ -2319,7 +2195,6 @@ async def get_api_keys( timeout=timeout, ) - async def get_async_operation( self, req: temporalio.api.cloud.cloudservice.v1.GetAsyncOperationRequest, @@ -2337,7 +2212,6 @@ async def get_async_operation( timeout=timeout, ) - async def get_connectivity_rule( self, req: temporalio.api.cloud.cloudservice.v1.GetConnectivityRuleRequest, @@ -2355,7 +2229,6 @@ async def get_connectivity_rule( timeout=timeout, ) - async def get_connectivity_rules( self, req: temporalio.api.cloud.cloudservice.v1.GetConnectivityRulesRequest, @@ -2373,7 +2246,6 @@ async def get_connectivity_rules( timeout=timeout, ) - async def get_namespace( self, req: temporalio.api.cloud.cloudservice.v1.GetNamespaceRequest, @@ -2391,7 +2263,6 @@ async def get_namespace( timeout=timeout, ) - async def get_namespace_export_sink( self, req: temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinkRequest, @@ -2409,7 +2280,6 @@ async def get_namespace_export_sink( timeout=timeout, ) - async def get_namespace_export_sinks( self, req: temporalio.api.cloud.cloudservice.v1.GetNamespaceExportSinksRequest, @@ -2427,7 +2297,6 @@ async def get_namespace_export_sinks( timeout=timeout, ) - async def get_namespaces( self, req: temporalio.api.cloud.cloudservice.v1.GetNamespacesRequest, @@ -2445,7 +2314,6 @@ async def get_namespaces( timeout=timeout, ) - async def get_nexus_endpoint( self, req: temporalio.api.cloud.cloudservice.v1.GetNexusEndpointRequest, @@ -2463,7 +2331,6 @@ async def get_nexus_endpoint( timeout=timeout, ) - async def get_nexus_endpoints( self, req: temporalio.api.cloud.cloudservice.v1.GetNexusEndpointsRequest, @@ -2481,7 +2348,6 @@ async def get_nexus_endpoints( timeout=timeout, ) - async def get_region( self, req: temporalio.api.cloud.cloudservice.v1.GetRegionRequest, @@ -2499,7 +2365,6 @@ async def get_region( timeout=timeout, ) - async def get_regions( self, req: temporalio.api.cloud.cloudservice.v1.GetRegionsRequest, @@ -2517,7 +2382,6 @@ async def get_regions( timeout=timeout, ) - async def get_service_account( self, req: temporalio.api.cloud.cloudservice.v1.GetServiceAccountRequest, @@ -2535,7 +2399,6 @@ async def get_service_account( timeout=timeout, ) - async def get_service_accounts( self, req: temporalio.api.cloud.cloudservice.v1.GetServiceAccountsRequest, @@ -2553,7 +2416,6 @@ async def get_service_accounts( timeout=timeout, ) - async def get_usage( self, req: temporalio.api.cloud.cloudservice.v1.GetUsageRequest, @@ -2571,7 +2433,6 @@ async def get_usage( timeout=timeout, ) - async def get_user( self, req: temporalio.api.cloud.cloudservice.v1.GetUserRequest, @@ -2589,7 +2450,6 @@ async def get_user( timeout=timeout, ) - async def get_user_group( self, req: temporalio.api.cloud.cloudservice.v1.GetUserGroupRequest, @@ -2607,7 +2467,6 @@ async def get_user_group( timeout=timeout, ) - async def get_user_group_members( self, req: temporalio.api.cloud.cloudservice.v1.GetUserGroupMembersRequest, @@ -2625,7 +2484,6 @@ async def get_user_group_members( timeout=timeout, ) - async def get_user_groups( self, req: temporalio.api.cloud.cloudservice.v1.GetUserGroupsRequest, @@ -2643,7 +2501,6 @@ async def get_user_groups( timeout=timeout, ) - async def get_users( self, req: temporalio.api.cloud.cloudservice.v1.GetUsersRequest, @@ -2661,7 +2518,6 @@ async def get_users( timeout=timeout, ) - async def remove_user_group_member( self, req: temporalio.api.cloud.cloudservice.v1.RemoveUserGroupMemberRequest, @@ -2679,7 +2535,6 @@ async def remove_user_group_member( timeout=timeout, ) - async def rename_custom_search_attribute( self, req: temporalio.api.cloud.cloudservice.v1.RenameCustomSearchAttributeRequest, @@ -2697,7 +2552,6 @@ async def rename_custom_search_attribute( timeout=timeout, ) - async def set_user_group_namespace_access( self, req: temporalio.api.cloud.cloudservice.v1.SetUserGroupNamespaceAccessRequest, @@ -2715,7 +2569,6 @@ async def set_user_group_namespace_access( timeout=timeout, ) - async def set_user_namespace_access( self, req: temporalio.api.cloud.cloudservice.v1.SetUserNamespaceAccessRequest, @@ -2733,7 +2586,6 @@ async def set_user_namespace_access( timeout=timeout, ) - async def update_account( self, req: temporalio.api.cloud.cloudservice.v1.UpdateAccountRequest, @@ -2751,7 +2603,6 @@ async def update_account( timeout=timeout, ) - async def update_api_key( self, req: temporalio.api.cloud.cloudservice.v1.UpdateApiKeyRequest, @@ -2769,7 +2620,6 @@ async def update_api_key( timeout=timeout, ) - async def update_namespace( self, req: temporalio.api.cloud.cloudservice.v1.UpdateNamespaceRequest, @@ -2787,7 +2637,6 @@ async def update_namespace( timeout=timeout, ) - async def update_namespace_export_sink( self, req: temporalio.api.cloud.cloudservice.v1.UpdateNamespaceExportSinkRequest, @@ -2805,7 +2654,6 @@ async def update_namespace_export_sink( timeout=timeout, ) - async def update_namespace_tags( self, req: temporalio.api.cloud.cloudservice.v1.UpdateNamespaceTagsRequest, @@ -2823,7 +2671,6 @@ async def update_namespace_tags( timeout=timeout, ) - async def update_nexus_endpoint( self, req: temporalio.api.cloud.cloudservice.v1.UpdateNexusEndpointRequest, @@ -2841,7 +2688,6 @@ async def update_nexus_endpoint( timeout=timeout, ) - async def update_service_account( self, req: temporalio.api.cloud.cloudservice.v1.UpdateServiceAccountRequest, @@ -2859,7 +2705,6 @@ async def update_service_account( timeout=timeout, ) - async def update_user( self, req: temporalio.api.cloud.cloudservice.v1.UpdateUserRequest, @@ -2877,7 +2722,6 @@ async def update_user( timeout=timeout, ) - async def update_user_group( self, req: temporalio.api.cloud.cloudservice.v1.UpdateUserGroupRequest, @@ -2895,7 +2739,6 @@ async def update_user_group( timeout=timeout, ) - async def validate_namespace_export_sink( self, req: temporalio.api.cloud.cloudservice.v1.ValidateNamespaceExportSinkRequest, @@ -2914,7 +2757,6 @@ async def validate_namespace_export_sink( ) - class TestService: def __init__(self, client: ServiceClient): self.client = client @@ -2937,7 +2779,6 @@ async def get_current_time( timeout=timeout, ) - async def lock_time_skipping( self, req: temporalio.api.testservice.v1.LockTimeSkippingRequest, @@ -2955,7 +2796,6 @@ async def lock_time_skipping( timeout=timeout, ) - async def sleep( self, req: temporalio.api.testservice.v1.SleepRequest, @@ -2973,7 +2813,6 @@ async def sleep( timeout=timeout, ) - async def sleep_until( self, req: temporalio.api.testservice.v1.SleepUntilRequest, @@ -2991,7 +2830,6 @@ async def sleep_until( timeout=timeout, ) - async def unlock_time_skipping( self, req: temporalio.api.testservice.v1.UnlockTimeSkippingRequest, @@ -3009,7 +2847,6 @@ async def unlock_time_skipping( timeout=timeout, ) - async def unlock_time_skipping_with_sleep( self, req: temporalio.api.testservice.v1.SleepRequest, @@ -3028,7 +2865,6 @@ async def unlock_time_skipping_with_sleep( ) - class HealthService: def __init__(self, client: ServiceClient): self.client = client @@ -3050,5 +2886,3 @@ async def check( metadata=metadata, timeout=timeout, ) - - diff --git a/tests/test_client.py b/tests/test_client.py index b94b38d33..3c399f315 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -88,7 +88,6 @@ ) from temporalio.converter import DataConverter from temporalio.exceptions import WorkflowAlreadyStartedError - from temporalio.testing import WorkflowEnvironment from tests.helpers import ( assert_eq_eventually, From d34886b62380235b4affcb0020eba4ca2315f703 Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Mon, 29 Sep 2025 15:18:30 -0700 Subject: [PATCH 6/7] Remove debug print. Remove unused imports. Fully qualify generated import in service.py --- temporalio/service.py | 17 ++++++----------- tests/test_service.py | 1 - 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/temporalio/service.py b/temporalio/service.py index 975daa94b..3bb6fd38c 100644 --- a/temporalio/service.py +++ b/temporalio/service.py @@ -13,17 +13,12 @@ from enum import IntEnum from typing import ClassVar, Mapping, Optional, Tuple, Type, TypeVar, Union -import google.protobuf.empty_pb2 import google.protobuf.message -import temporalio.api.cloud.cloudservice.v1 import temporalio.api.common.v1 -import temporalio.api.operatorservice.v1 -import temporalio.api.testservice.v1 -import temporalio.api.workflowservice.v1 import temporalio.bridge.client import temporalio.bridge.proto.health.v1 -import temporalio.bridge.services_generated as svc_gen +import temporalio.bridge.services_generated import temporalio.exceptions import temporalio.runtime @@ -286,23 +281,23 @@ async def _rpc_call( raise NotImplementedError -class WorkflowService(svc_gen.WorkflowService): +class WorkflowService(temporalio.bridge.services_generated.WorkflowService): """Client to the Temporal server's workflow service.""" -class OperatorService(svc_gen.OperatorService): +class OperatorService(temporalio.bridge.services_generated.OperatorService): """Client to the Temporal server's operator service.""" -class CloudService(svc_gen.CloudService): +class CloudService(temporalio.bridge.services_generated.CloudService): """Client to the Temporal server's cloud service.""" -class TestService(svc_gen.TestService): +class TestService(temporalio.bridge.services_generated.TestService): """Client to the Temporal test server's test service.""" -class HealthService(svc_gen.HealthService): +class HealthService(temporalio.bridge.services_generated.HealthService): """Client to the Temporal server's health service.""" diff --git a/tests/test_service.py b/tests/test_service.py index 6919ff590..ba3fc5b1d 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -37,7 +37,6 @@ def assert_all_calls_present( for name, call in inspect.getmembers(service): # ignore private methods and non-rpc members "client" and "service" if name[0] != "_" and name != "client" and name != "service": - print(name) service_calls.add(name) # Collect gRPC service calls with a fake channel From 2812a80834ade9585de22e01ea8c70e85912280e Mon Sep 17 00:00:00 2001 From: Alex Mazzeo Date: Mon, 29 Sep 2025 15:52:19 -0700 Subject: [PATCH 7/7] add call to cargo fmt after generation. Move generated python services to a generated directory to allow pydocstyle exclusion. Add linter ignore rule on tests/worker/test_workflow.py:4840 to avoid a linter rule about method assignment. --- pyproject.toml | 93 +- scripts/gen_bridge_client.py | 2 +- scripts/gen_protos_docker.py | 6 + .../{ => generated}/services_generated.py | 0 temporalio/bridge/src/client_rpc_generated.rs | 1483 ++++++++++------- temporalio/bridge/src/envconfig.rs | 15 +- temporalio/bridge/src/metric.rs | 26 +- temporalio/bridge/src/runtime.rs | 5 +- temporalio/bridge/src/worker.rs | 9 +- temporalio/service.py | 13 +- tests/worker/test_workflow.py | 2 +- 11 files changed, 966 insertions(+), 688 deletions(-) rename temporalio/bridge/{ => generated}/services_generated.py (100%) diff --git a/pyproject.toml b/pyproject.toml index 0fb39c55e..47513f02c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,29 +6,23 @@ authors = [{ name = "Temporal Technologies Inc", email = "sdk@temporal.io" }] requires-python = ">=3.9" readme = "README.md" license = { file = "LICENSE" } -keywords = [ - "temporal", - "workflow", -] +keywords = ["temporal", "workflow"] dependencies = [ - "nexus-rpc==1.1.0", - "protobuf>=3.20,<7.0.0", - "python-dateutil>=2.8.2,<3 ; python_version < '3.11'", - "types-protobuf>=3.20", - "typing-extensions>=4.2.0,<5", + "nexus-rpc==1.1.0", + "protobuf>=3.20,<7.0.0", + "python-dateutil>=2.8.2,<3 ; python_version < '3.11'", + "types-protobuf>=3.20", + "typing-extensions>=4.2.0,<5", ] [project.optional-dependencies] grpc = ["grpcio>=1.48.2,<2"] -opentelemetry = [ - "opentelemetry-api>=1.11.1,<2", - "opentelemetry-sdk>=1.11.1,<2", -] +opentelemetry = ["opentelemetry-api>=1.11.1,<2", "opentelemetry-sdk>=1.11.1,<2"] pydantic = ["pydantic>=2.0.0,<3"] openai-agents = [ - "openai-agents>=0.3,<0.4", - "eval-type-backport>=0.2.2; python_version < '3.10'", - "mcp>=1.9.4, <2; python_version >= '3.10'", + "openai-agents>=0.3,<0.4", + "eval-type-backport>=0.2.2; python_version < '3.10'", + "mcp>=1.9.4, <2; python_version >= '3.10'", ] [project.urls] @@ -39,48 +33,50 @@ Documentation = "https://docs.temporal.io/docs/python" [dependency-groups] dev = [ - "cibuildwheel>=2.22.0,<3", - "grpcio-tools>=1.48.2,<2", - "mypy==1.4.1", - "mypy-protobuf>=3.3.0,<4", - "psutil>=5.9.3,<6", - "pydocstyle>=6.3.0,<7", - "pydoctor>=24.11.1,<25", - "pyright==1.1.403", - "pytest~=7.4", - "pytest-asyncio>=0.21,<0.22", - "pytest-timeout~=2.2", - "ruff>=0.5.0,<0.6", - "toml>=0.10.2,<0.11", - "twine>=4.0.1,<5", - "ruff>=0.5.0,<0.6", - "maturin>=1.8.2", - "pytest-cov>=6.1.1", - "httpx>=0.28.1", - "pytest-pretty>=1.3.0", - "openai-agents[litellm]>=0.3,<0.4" + "cibuildwheel>=2.22.0,<3", + "grpcio-tools>=1.48.2,<2", + "mypy==1.4.1", + "mypy-protobuf>=3.3.0,<4", + "psutil>=5.9.3,<6", + "pydocstyle>=6.3.0,<7", + "pydoctor>=24.11.1,<25", + "pyright==1.1.403", + "pytest~=7.4", + "pytest-asyncio>=0.21,<0.22", + "pytest-timeout~=2.2", + "ruff>=0.5.0,<0.6", + "toml>=0.10.2,<0.11", + "twine>=4.0.1,<5", + "maturin>=1.8.2", + "pytest-cov>=6.1.1", + "httpx>=0.28.1", + "pytest-pretty>=1.3.0", + "openai-agents[litellm]>=0.3,<0.4", ] [tool.poe.tasks] build-develop = "uv run maturin develop --uv" build-develop-with-release = { cmd = "uv run maturin develop --release --uv" } -format = [{cmd = "uv run ruff check --select I --fix"}, {cmd = "uv run ruff format"}, ] +format = [ + { cmd = "uv run ruff check --select I --fix" }, + { cmd = "uv run ruff format" }, +] gen-docs = "uv run scripts/gen_docs.py" gen-protos = "uv run scripts/gen_protos.py" gen-protos-docker = "uv run scripts/gen_protos_docker.py" lint = [ - {cmd = "uv run ruff check --select I"}, - {cmd = "uv run ruff format --check"}, - {ref = "lint-types"}, - {ref = "lint-docs"}, + { cmd = "uv run ruff check --select I" }, + { cmd = "uv run ruff format --check" }, + { ref = "lint-types" }, + { ref = "lint-docs" }, ] bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" } # TODO(cretz): Why does pydocstyle complain about @overload missing docs after # https://github.com/PyCQA/pydocstyle/pull/511? lint-docs = "uv run pydocstyle --ignore-decorators=overload" lint-types = [ - { cmd = "uv run pyright"}, - { cmd = "uv run mypy --namespace-packages --check-untyped-defs ."}, + { cmd = "uv run pyright" }, + { cmd = "uv run mypy --namespace-packages --check-untyped-defs ." }, ] run-bench = "uv run python scripts/run_bench.py" test = "uv run pytest" @@ -120,17 +116,18 @@ ignore_missing_imports = true exclude = [ # Ignore generated code 'temporalio/api', - 'temporalio/bridge/proto' + 'temporalio/bridge/proto', ] [tool.pydocstyle] convention = "google" # https://github.com/PyCQA/pydocstyle/issues/363#issuecomment-625563088 -match_dir = "^(?!(docs|scripts|tests|api|proto|\\.)).*" +match_dir = "^(?!(docs|scripts|tests|api|proto|generated|\\.)).*" add_ignore = [ # We like to wrap at a certain number of chars, even long summary sentences. # https://github.com/PyCQA/pydocstyle/issues/184 - "D205", "D415" + "D205", + "D415", ] [tool.pydoctor] @@ -226,9 +223,7 @@ manifest-path = "temporalio/bridge/Cargo.toml" module-name = "temporalio.bridge.temporal_sdk_bridge" python-packages = ["temporalio"] include = ["LICENSE"] -exclude = [ - "temporalio/bridge/target/**/*", -] +exclude = ["temporalio/bridge/target/**/*"] [tool.uv] # Prevent uv commands from building the package by default diff --git a/scripts/gen_bridge_client.py b/scripts/gen_bridge_client.py index 0528eb4f4..40b9744d0 100644 --- a/scripts/gen_bridge_client.py +++ b/scripts/gen_bridge_client.py @@ -17,7 +17,7 @@ def generate_python_services( file_descriptors: list[FileDescriptor], - output_file: str = "temporalio/bridge/services_generated.py", + output_file: str = "temporalio/bridge/generated/services_generated.py", ): print("generating python services") diff --git a/scripts/gen_protos_docker.py b/scripts/gen_protos_docker.py index 94731bda2..e354cc646 100644 --- a/scripts/gen_protos_docker.py +++ b/scripts/gen_protos_docker.py @@ -42,3 +42,9 @@ ) subprocess.run(["uv", "run", "poe", "format"], check=True) + +subprocess.run( + ["cargo", "fmt"], + check=True, + cwd=os.path.join(os.getcwd(), "temporalio", "bridge"), +) diff --git a/temporalio/bridge/services_generated.py b/temporalio/bridge/generated/services_generated.py similarity index 100% rename from temporalio/bridge/services_generated.py rename to temporalio/bridge/generated/services_generated.py diff --git a/temporalio/bridge/src/client_rpc_generated.rs b/temporalio/bridge/src/client_rpc_generated.rs index 6de23d1d5..659f5d8cf 100644 --- a/temporalio/bridge/src/client_rpc_generated.rs +++ b/temporalio/bridge/src/client_rpc_generated.rs @@ -10,605 +10,892 @@ use super::{ #[pymethods] impl ClientRef { + fn call_workflow_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::WorkflowService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "count_workflow_executions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + count_workflow_executions + ) + } + "create_schedule" => { + rpc_call!(retry_client, call, WorkflowService, create_schedule) + } + "create_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, create_workflow_rule) + } + "delete_schedule" => { + rpc_call!(retry_client, call, WorkflowService, delete_schedule) + } + "delete_worker_deployment" => { + rpc_call!( + retry_client, + call, + WorkflowService, + delete_worker_deployment + ) + } + "delete_worker_deployment_version" => { + rpc_call!( + retry_client, + call, + WorkflowService, + delete_worker_deployment_version + ) + } + "delete_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + delete_workflow_execution + ) + } + "delete_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, delete_workflow_rule) + } + "deprecate_namespace" => { + rpc_call!(retry_client, call, WorkflowService, deprecate_namespace) + } + "describe_batch_operation" => { + rpc_call!( + retry_client, + call, + WorkflowService, + describe_batch_operation + ) + } + "describe_deployment" => { + rpc_call!(retry_client, call, WorkflowService, describe_deployment) + } + "describe_namespace" => { + rpc_call!(retry_client, call, WorkflowService, describe_namespace) + } + "describe_schedule" => { + rpc_call!(retry_client, call, WorkflowService, describe_schedule) + } + "describe_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, describe_task_queue) + } + "describe_worker_deployment" => { + rpc_call!( + retry_client, + call, + WorkflowService, + describe_worker_deployment + ) + } + "describe_worker_deployment_version" => { + rpc_call!( + retry_client, + call, + WorkflowService, + describe_worker_deployment_version + ) + } + "describe_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + describe_workflow_execution + ) + } + "describe_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, describe_workflow_rule) + } + "execute_multi_operation" => { + rpc_call!(retry_client, call, WorkflowService, execute_multi_operation) + } + "fetch_worker_config" => { + rpc_call!(retry_client, call, WorkflowService, fetch_worker_config) + } + "get_cluster_info" => { + rpc_call!(retry_client, call, WorkflowService, get_cluster_info) + } + "get_current_deployment" => { + rpc_call!(retry_client, call, WorkflowService, get_current_deployment) + } + "get_deployment_reachability" => { + rpc_call!( + retry_client, + call, + WorkflowService, + get_deployment_reachability + ) + } + "get_search_attributes" => { + rpc_call!(retry_client, call, WorkflowService, get_search_attributes) + } + "get_system_info" => { + rpc_call!(retry_client, call, WorkflowService, get_system_info) + } + "get_worker_build_id_compatibility" => { + rpc_call!( + retry_client, + call, + WorkflowService, + get_worker_build_id_compatibility + ) + } + "get_worker_task_reachability" => { + rpc_call!( + retry_client, + call, + WorkflowService, + get_worker_task_reachability + ) + } + "get_worker_versioning_rules" => { + rpc_call!( + retry_client, + call, + WorkflowService, + get_worker_versioning_rules + ) + } + "get_workflow_execution_history" => { + rpc_call!( + retry_client, + call, + WorkflowService, + get_workflow_execution_history + ) + } + "get_workflow_execution_history_reverse" => { + rpc_call!( + retry_client, + call, + WorkflowService, + get_workflow_execution_history_reverse + ) + } + "list_archived_workflow_executions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + list_archived_workflow_executions + ) + } + "list_batch_operations" => { + rpc_call!(retry_client, call, WorkflowService, list_batch_operations) + } + "list_closed_workflow_executions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + list_closed_workflow_executions + ) + } + "list_deployments" => { + rpc_call!(retry_client, call, WorkflowService, list_deployments) + } + "list_namespaces" => { + rpc_call!(retry_client, call, WorkflowService, list_namespaces) + } + "list_open_workflow_executions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + list_open_workflow_executions + ) + } + "list_schedule_matching_times" => { + rpc_call!( + retry_client, + call, + WorkflowService, + list_schedule_matching_times + ) + } + "list_schedules" => { + rpc_call!(retry_client, call, WorkflowService, list_schedules) + } + "list_task_queue_partitions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + list_task_queue_partitions + ) + } + "list_worker_deployments" => { + rpc_call!(retry_client, call, WorkflowService, list_worker_deployments) + } + "list_workers" => { + rpc_call!(retry_client, call, WorkflowService, list_workers) + } + "list_workflow_executions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + list_workflow_executions + ) + } + "list_workflow_rules" => { + rpc_call!(retry_client, call, WorkflowService, list_workflow_rules) + } + "patch_schedule" => { + rpc_call!(retry_client, call, WorkflowService, patch_schedule) + } + "pause_activity" => { + rpc_call!(retry_client, call, WorkflowService, pause_activity) + } + "poll_activity_task_queue" => { + rpc_call!( + retry_client, + call, + WorkflowService, + poll_activity_task_queue + ) + } + "poll_nexus_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, poll_nexus_task_queue) + } + "poll_workflow_execution_update" => { + rpc_call!( + retry_client, + call, + WorkflowService, + poll_workflow_execution_update + ) + } + "poll_workflow_task_queue" => { + rpc_call!( + retry_client, + call, + WorkflowService, + poll_workflow_task_queue + ) + } + "query_workflow" => { + rpc_call!(retry_client, call, WorkflowService, query_workflow) + } + "record_activity_task_heartbeat" => { + rpc_call!( + retry_client, + call, + WorkflowService, + record_activity_task_heartbeat + ) + } + "record_activity_task_heartbeat_by_id" => { + rpc_call!( + retry_client, + call, + WorkflowService, + record_activity_task_heartbeat_by_id + ) + } + "record_worker_heartbeat" => { + rpc_call!(retry_client, call, WorkflowService, record_worker_heartbeat) + } + "register_namespace" => { + rpc_call!(retry_client, call, WorkflowService, register_namespace) + } + "request_cancel_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + request_cancel_workflow_execution + ) + } + "reset_activity" => { + rpc_call!(retry_client, call, WorkflowService, reset_activity) + } + "reset_sticky_task_queue" => { + rpc_call!(retry_client, call, WorkflowService, reset_sticky_task_queue) + } + "reset_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + reset_workflow_execution + ) + } + "respond_activity_task_canceled" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_activity_task_canceled + ) + } + "respond_activity_task_canceled_by_id" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_activity_task_canceled_by_id + ) + } + "respond_activity_task_completed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_activity_task_completed + ) + } + "respond_activity_task_completed_by_id" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_activity_task_completed_by_id + ) + } + "respond_activity_task_failed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_activity_task_failed + ) + } + "respond_activity_task_failed_by_id" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_activity_task_failed_by_id + ) + } + "respond_nexus_task_completed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_nexus_task_completed + ) + } + "respond_nexus_task_failed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_nexus_task_failed + ) + } + "respond_query_task_completed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_query_task_completed + ) + } + "respond_workflow_task_completed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_workflow_task_completed + ) + } + "respond_workflow_task_failed" => { + rpc_call!( + retry_client, + call, + WorkflowService, + respond_workflow_task_failed + ) + } + "scan_workflow_executions" => { + rpc_call!( + retry_client, + call, + WorkflowService, + scan_workflow_executions + ) + } + "set_current_deployment" => { + rpc_call!(retry_client, call, WorkflowService, set_current_deployment) + } + "set_worker_deployment_current_version" => { + rpc_call!( + retry_client, + call, + WorkflowService, + set_worker_deployment_current_version + ) + } + "set_worker_deployment_ramping_version" => { + rpc_call!( + retry_client, + call, + WorkflowService, + set_worker_deployment_ramping_version + ) + } + "shutdown_worker" => { + rpc_call!(retry_client, call, WorkflowService, shutdown_worker) + } + "signal_with_start_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + signal_with_start_workflow_execution + ) + } + "signal_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + signal_workflow_execution + ) + } + "start_batch_operation" => { + rpc_call!(retry_client, call, WorkflowService, start_batch_operation) + } + "start_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + start_workflow_execution + ) + } + "stop_batch_operation" => { + rpc_call!(retry_client, call, WorkflowService, stop_batch_operation) + } + "terminate_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + terminate_workflow_execution + ) + } + "trigger_workflow_rule" => { + rpc_call!(retry_client, call, WorkflowService, trigger_workflow_rule) + } + "unpause_activity" => { + rpc_call!(retry_client, call, WorkflowService, unpause_activity) + } + "update_activity_options" => { + rpc_call!(retry_client, call, WorkflowService, update_activity_options) + } + "update_namespace" => { + rpc_call!(retry_client, call, WorkflowService, update_namespace) + } + "update_schedule" => { + rpc_call!(retry_client, call, WorkflowService, update_schedule) + } + "update_task_queue_config" => { + rpc_call!( + retry_client, + call, + WorkflowService, + update_task_queue_config + ) + } + "update_worker_build_id_compatibility" => { + rpc_call!( + retry_client, + call, + WorkflowService, + update_worker_build_id_compatibility + ) + } + "update_worker_config" => { + rpc_call!(retry_client, call, WorkflowService, update_worker_config) + } + "update_worker_deployment_version_metadata" => { + rpc_call!( + retry_client, + call, + WorkflowService, + update_worker_deployment_version_metadata + ) + } + "update_worker_versioning_rules" => { + rpc_call!( + retry_client, + call, + WorkflowService, + update_worker_versioning_rules + ) + } + "update_workflow_execution" => { + rpc_call!( + retry_client, + call, + WorkflowService, + update_workflow_execution + ) + } + "update_workflow_execution_options" => { + rpc_call!( + retry_client, + call, + WorkflowService, + update_workflow_execution_options + ) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } -fn call_workflow_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - use temporal_client::WorkflowService; - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "count_workflow_executions" => { - rpc_call!(retry_client, call, WorkflowService, count_workflow_executions) - } - "create_schedule" => { - rpc_call!(retry_client, call, WorkflowService, create_schedule) - } - "create_workflow_rule" => { - rpc_call!(retry_client, call, WorkflowService, create_workflow_rule) - } - "delete_schedule" => { - rpc_call!(retry_client, call, WorkflowService, delete_schedule) - } - "delete_worker_deployment" => { - rpc_call!(retry_client, call, WorkflowService, delete_worker_deployment) - } - "delete_worker_deployment_version" => { - rpc_call!(retry_client, call, WorkflowService, delete_worker_deployment_version) - } - "delete_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, delete_workflow_execution) - } - "delete_workflow_rule" => { - rpc_call!(retry_client, call, WorkflowService, delete_workflow_rule) - } - "deprecate_namespace" => { - rpc_call!(retry_client, call, WorkflowService, deprecate_namespace) - } - "describe_batch_operation" => { - rpc_call!(retry_client, call, WorkflowService, describe_batch_operation) - } - "describe_deployment" => { - rpc_call!(retry_client, call, WorkflowService, describe_deployment) - } - "describe_namespace" => { - rpc_call!(retry_client, call, WorkflowService, describe_namespace) - } - "describe_schedule" => { - rpc_call!(retry_client, call, WorkflowService, describe_schedule) - } - "describe_task_queue" => { - rpc_call!(retry_client, call, WorkflowService, describe_task_queue) - } - "describe_worker_deployment" => { - rpc_call!(retry_client, call, WorkflowService, describe_worker_deployment) - } - "describe_worker_deployment_version" => { - rpc_call!(retry_client, call, WorkflowService, describe_worker_deployment_version) - } - "describe_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, describe_workflow_execution) - } - "describe_workflow_rule" => { - rpc_call!(retry_client, call, WorkflowService, describe_workflow_rule) - } - "execute_multi_operation" => { - rpc_call!(retry_client, call, WorkflowService, execute_multi_operation) - } - "fetch_worker_config" => { - rpc_call!(retry_client, call, WorkflowService, fetch_worker_config) - } - "get_cluster_info" => { - rpc_call!(retry_client, call, WorkflowService, get_cluster_info) - } - "get_current_deployment" => { - rpc_call!(retry_client, call, WorkflowService, get_current_deployment) - } - "get_deployment_reachability" => { - rpc_call!(retry_client, call, WorkflowService, get_deployment_reachability) - } - "get_search_attributes" => { - rpc_call!(retry_client, call, WorkflowService, get_search_attributes) - } - "get_system_info" => { - rpc_call!(retry_client, call, WorkflowService, get_system_info) - } - "get_worker_build_id_compatibility" => { - rpc_call!(retry_client, call, WorkflowService, get_worker_build_id_compatibility) - } - "get_worker_task_reachability" => { - rpc_call!(retry_client, call, WorkflowService, get_worker_task_reachability) - } - "get_worker_versioning_rules" => { - rpc_call!(retry_client, call, WorkflowService, get_worker_versioning_rules) - } - "get_workflow_execution_history" => { - rpc_call!(retry_client, call, WorkflowService, get_workflow_execution_history) - } - "get_workflow_execution_history_reverse" => { - rpc_call!(retry_client, call, WorkflowService, get_workflow_execution_history_reverse) - } - "list_archived_workflow_executions" => { - rpc_call!(retry_client, call, WorkflowService, list_archived_workflow_executions) - } - "list_batch_operations" => { - rpc_call!(retry_client, call, WorkflowService, list_batch_operations) - } - "list_closed_workflow_executions" => { - rpc_call!(retry_client, call, WorkflowService, list_closed_workflow_executions) - } - "list_deployments" => { - rpc_call!(retry_client, call, WorkflowService, list_deployments) - } - "list_namespaces" => { - rpc_call!(retry_client, call, WorkflowService, list_namespaces) - } - "list_open_workflow_executions" => { - rpc_call!(retry_client, call, WorkflowService, list_open_workflow_executions) - } - "list_schedule_matching_times" => { - rpc_call!(retry_client, call, WorkflowService, list_schedule_matching_times) - } - "list_schedules" => { - rpc_call!(retry_client, call, WorkflowService, list_schedules) - } - "list_task_queue_partitions" => { - rpc_call!(retry_client, call, WorkflowService, list_task_queue_partitions) - } - "list_worker_deployments" => { - rpc_call!(retry_client, call, WorkflowService, list_worker_deployments) - } - "list_workers" => { - rpc_call!(retry_client, call, WorkflowService, list_workers) - } - "list_workflow_executions" => { - rpc_call!(retry_client, call, WorkflowService, list_workflow_executions) - } - "list_workflow_rules" => { - rpc_call!(retry_client, call, WorkflowService, list_workflow_rules) - } - "patch_schedule" => { - rpc_call!(retry_client, call, WorkflowService, patch_schedule) - } - "pause_activity" => { - rpc_call!(retry_client, call, WorkflowService, pause_activity) - } - "poll_activity_task_queue" => { - rpc_call!(retry_client, call, WorkflowService, poll_activity_task_queue) - } - "poll_nexus_task_queue" => { - rpc_call!(retry_client, call, WorkflowService, poll_nexus_task_queue) - } - "poll_workflow_execution_update" => { - rpc_call!(retry_client, call, WorkflowService, poll_workflow_execution_update) - } - "poll_workflow_task_queue" => { - rpc_call!(retry_client, call, WorkflowService, poll_workflow_task_queue) - } - "query_workflow" => { - rpc_call!(retry_client, call, WorkflowService, query_workflow) - } - "record_activity_task_heartbeat" => { - rpc_call!(retry_client, call, WorkflowService, record_activity_task_heartbeat) - } - "record_activity_task_heartbeat_by_id" => { - rpc_call!(retry_client, call, WorkflowService, record_activity_task_heartbeat_by_id) - } - "record_worker_heartbeat" => { - rpc_call!(retry_client, call, WorkflowService, record_worker_heartbeat) - } - "register_namespace" => { - rpc_call!(retry_client, call, WorkflowService, register_namespace) - } - "request_cancel_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, request_cancel_workflow_execution) - } - "reset_activity" => { - rpc_call!(retry_client, call, WorkflowService, reset_activity) - } - "reset_sticky_task_queue" => { - rpc_call!(retry_client, call, WorkflowService, reset_sticky_task_queue) - } - "reset_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, reset_workflow_execution) - } - "respond_activity_task_canceled" => { - rpc_call!(retry_client, call, WorkflowService, respond_activity_task_canceled) - } - "respond_activity_task_canceled_by_id" => { - rpc_call!(retry_client, call, WorkflowService, respond_activity_task_canceled_by_id) - } - "respond_activity_task_completed" => { - rpc_call!(retry_client, call, WorkflowService, respond_activity_task_completed) - } - "respond_activity_task_completed_by_id" => { - rpc_call!(retry_client, call, WorkflowService, respond_activity_task_completed_by_id) - } - "respond_activity_task_failed" => { - rpc_call!(retry_client, call, WorkflowService, respond_activity_task_failed) - } - "respond_activity_task_failed_by_id" => { - rpc_call!(retry_client, call, WorkflowService, respond_activity_task_failed_by_id) - } - "respond_nexus_task_completed" => { - rpc_call!(retry_client, call, WorkflowService, respond_nexus_task_completed) - } - "respond_nexus_task_failed" => { - rpc_call!(retry_client, call, WorkflowService, respond_nexus_task_failed) - } - "respond_query_task_completed" => { - rpc_call!(retry_client, call, WorkflowService, respond_query_task_completed) - } - "respond_workflow_task_completed" => { - rpc_call!(retry_client, call, WorkflowService, respond_workflow_task_completed) - } - "respond_workflow_task_failed" => { - rpc_call!(retry_client, call, WorkflowService, respond_workflow_task_failed) - } - "scan_workflow_executions" => { - rpc_call!(retry_client, call, WorkflowService, scan_workflow_executions) - } - "set_current_deployment" => { - rpc_call!(retry_client, call, WorkflowService, set_current_deployment) - } - "set_worker_deployment_current_version" => { - rpc_call!(retry_client, call, WorkflowService, set_worker_deployment_current_version) - } - "set_worker_deployment_ramping_version" => { - rpc_call!(retry_client, call, WorkflowService, set_worker_deployment_ramping_version) - } - "shutdown_worker" => { - rpc_call!(retry_client, call, WorkflowService, shutdown_worker) - } - "signal_with_start_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, signal_with_start_workflow_execution) - } - "signal_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, signal_workflow_execution) - } - "start_batch_operation" => { - rpc_call!(retry_client, call, WorkflowService, start_batch_operation) - } - "start_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, start_workflow_execution) - } - "stop_batch_operation" => { - rpc_call!(retry_client, call, WorkflowService, stop_batch_operation) - } - "terminate_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, terminate_workflow_execution) - } - "trigger_workflow_rule" => { - rpc_call!(retry_client, call, WorkflowService, trigger_workflow_rule) - } - "unpause_activity" => { - rpc_call!(retry_client, call, WorkflowService, unpause_activity) - } - "update_activity_options" => { - rpc_call!(retry_client, call, WorkflowService, update_activity_options) - } - "update_namespace" => { - rpc_call!(retry_client, call, WorkflowService, update_namespace) - } - "update_schedule" => { - rpc_call!(retry_client, call, WorkflowService, update_schedule) - } - "update_task_queue_config" => { - rpc_call!(retry_client, call, WorkflowService, update_task_queue_config) - } - "update_worker_build_id_compatibility" => { - rpc_call!(retry_client, call, WorkflowService, update_worker_build_id_compatibility) - } - "update_worker_config" => { - rpc_call!(retry_client, call, WorkflowService, update_worker_config) - } - "update_worker_deployment_version_metadata" => { - rpc_call!(retry_client, call, WorkflowService, update_worker_deployment_version_metadata) - } - "update_worker_versioning_rules" => { - rpc_call!(retry_client, call, WorkflowService, update_worker_versioning_rules) - } - "update_workflow_execution" => { - rpc_call!(retry_client, call, WorkflowService, update_workflow_execution) - } - "update_workflow_execution_options" => { - rpc_call!(retry_client, call, WorkflowService, update_workflow_execution_options) - } - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } + fn call_operator_service<'p>( + &self, + py: Python<'p>, + call: RpcCall, + ) -> PyResult> { + use temporal_client::OperatorService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "add_or_update_remote_cluster" => { + rpc_call!( + retry_client, + call, + OperatorService, + add_or_update_remote_cluster + ) + } + "add_search_attributes" => { + rpc_call!(retry_client, call, OperatorService, add_search_attributes) + } + "create_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, create_nexus_endpoint) + } + "delete_namespace" => { + rpc_call!(retry_client, call, OperatorService, delete_namespace) + } + "delete_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, delete_nexus_endpoint) + } + "get_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, get_nexus_endpoint) + } + "list_clusters" => { + rpc_call!(retry_client, call, OperatorService, list_clusters) + } + "list_nexus_endpoints" => { + rpc_call!(retry_client, call, OperatorService, list_nexus_endpoints) + } + "list_search_attributes" => { + rpc_call!(retry_client, call, OperatorService, list_search_attributes) + } + "remove_remote_cluster" => { + rpc_call!(retry_client, call, OperatorService, remove_remote_cluster) + } + "remove_search_attributes" => { + rpc_call!( + retry_client, + call, + OperatorService, + remove_search_attributes + ) + } + "update_nexus_endpoint" => { + rpc_call!(retry_client, call, OperatorService, update_nexus_endpoint) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } -fn call_operator_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - use temporal_client::OperatorService; - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "add_or_update_remote_cluster" => { - rpc_call!(retry_client, call, OperatorService, add_or_update_remote_cluster) - } - "add_search_attributes" => { - rpc_call!(retry_client, call, OperatorService, add_search_attributes) - } - "create_nexus_endpoint" => { - rpc_call!(retry_client, call, OperatorService, create_nexus_endpoint) - } - "delete_namespace" => { - rpc_call!(retry_client, call, OperatorService, delete_namespace) - } - "delete_nexus_endpoint" => { - rpc_call!(retry_client, call, OperatorService, delete_nexus_endpoint) - } - "get_nexus_endpoint" => { - rpc_call!(retry_client, call, OperatorService, get_nexus_endpoint) - } - "list_clusters" => { - rpc_call!(retry_client, call, OperatorService, list_clusters) - } - "list_nexus_endpoints" => { - rpc_call!(retry_client, call, OperatorService, list_nexus_endpoints) - } - "list_search_attributes" => { - rpc_call!(retry_client, call, OperatorService, list_search_attributes) - } - "remove_remote_cluster" => { - rpc_call!(retry_client, call, OperatorService, remove_remote_cluster) - } - "remove_search_attributes" => { - rpc_call!(retry_client, call, OperatorService, remove_search_attributes) - } - "update_nexus_endpoint" => { - rpc_call!(retry_client, call, OperatorService, update_nexus_endpoint) - } - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } + fn call_cloud_service<'p>(&self, py: Python<'p>, call: RpcCall) -> PyResult> { + use temporal_client::CloudService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "add_namespace_region" => { + rpc_call!(retry_client, call, CloudService, add_namespace_region) + } + "add_user_group_member" => { + rpc_call!(retry_client, call, CloudService, add_user_group_member) + } + "create_api_key" => { + rpc_call!(retry_client, call, CloudService, create_api_key) + } + "create_connectivity_rule" => { + rpc_call!(retry_client, call, CloudService, create_connectivity_rule) + } + "create_namespace" => { + rpc_call!(retry_client, call, CloudService, create_namespace) + } + "create_namespace_export_sink" => { + rpc_call!( + retry_client, + call, + CloudService, + create_namespace_export_sink + ) + } + "create_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, create_nexus_endpoint) + } + "create_service_account" => { + rpc_call!(retry_client, call, CloudService, create_service_account) + } + "create_user" => { + rpc_call!(retry_client, call, CloudService, create_user) + } + "create_user_group" => { + rpc_call!(retry_client, call, CloudService, create_user_group) + } + "delete_api_key" => { + rpc_call!(retry_client, call, CloudService, delete_api_key) + } + "delete_connectivity_rule" => { + rpc_call!(retry_client, call, CloudService, delete_connectivity_rule) + } + "delete_namespace" => { + rpc_call!(retry_client, call, CloudService, delete_namespace) + } + "delete_namespace_export_sink" => { + rpc_call!( + retry_client, + call, + CloudService, + delete_namespace_export_sink + ) + } + "delete_namespace_region" => { + rpc_call!(retry_client, call, CloudService, delete_namespace_region) + } + "delete_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, delete_nexus_endpoint) + } + "delete_service_account" => { + rpc_call!(retry_client, call, CloudService, delete_service_account) + } + "delete_user" => { + rpc_call!(retry_client, call, CloudService, delete_user) + } + "delete_user_group" => { + rpc_call!(retry_client, call, CloudService, delete_user_group) + } + "failover_namespace_region" => { + rpc_call!(retry_client, call, CloudService, failover_namespace_region) + } + "get_account" => { + rpc_call!(retry_client, call, CloudService, get_account) + } + "get_api_key" => { + rpc_call!(retry_client, call, CloudService, get_api_key) + } + "get_api_keys" => { + rpc_call!(retry_client, call, CloudService, get_api_keys) + } + "get_async_operation" => { + rpc_call!(retry_client, call, CloudService, get_async_operation) + } + "get_connectivity_rule" => { + rpc_call!(retry_client, call, CloudService, get_connectivity_rule) + } + "get_connectivity_rules" => { + rpc_call!(retry_client, call, CloudService, get_connectivity_rules) + } + "get_namespace" => { + rpc_call!(retry_client, call, CloudService, get_namespace) + } + "get_namespace_export_sink" => { + rpc_call!(retry_client, call, CloudService, get_namespace_export_sink) + } + "get_namespace_export_sinks" => { + rpc_call!(retry_client, call, CloudService, get_namespace_export_sinks) + } + "get_namespaces" => { + rpc_call!(retry_client, call, CloudService, get_namespaces) + } + "get_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, get_nexus_endpoint) + } + "get_nexus_endpoints" => { + rpc_call!(retry_client, call, CloudService, get_nexus_endpoints) + } + "get_region" => { + rpc_call!(retry_client, call, CloudService, get_region) + } + "get_regions" => { + rpc_call!(retry_client, call, CloudService, get_regions) + } + "get_service_account" => { + rpc_call!(retry_client, call, CloudService, get_service_account) + } + "get_service_accounts" => { + rpc_call!(retry_client, call, CloudService, get_service_accounts) + } + "get_usage" => { + rpc_call!(retry_client, call, CloudService, get_usage) + } + "get_user" => { + rpc_call!(retry_client, call, CloudService, get_user) + } + "get_user_group" => { + rpc_call!(retry_client, call, CloudService, get_user_group) + } + "get_user_group_members" => { + rpc_call!(retry_client, call, CloudService, get_user_group_members) + } + "get_user_groups" => { + rpc_call!(retry_client, call, CloudService, get_user_groups) + } + "get_users" => { + rpc_call!(retry_client, call, CloudService, get_users) + } + "remove_user_group_member" => { + rpc_call!(retry_client, call, CloudService, remove_user_group_member) + } + "rename_custom_search_attribute" => { + rpc_call!( + retry_client, + call, + CloudService, + rename_custom_search_attribute + ) + } + "set_user_group_namespace_access" => { + rpc_call!( + retry_client, + call, + CloudService, + set_user_group_namespace_access + ) + } + "set_user_namespace_access" => { + rpc_call!(retry_client, call, CloudService, set_user_namespace_access) + } + "update_account" => { + rpc_call!(retry_client, call, CloudService, update_account) + } + "update_api_key" => { + rpc_call!(retry_client, call, CloudService, update_api_key) + } + "update_namespace" => { + rpc_call!(retry_client, call, CloudService, update_namespace) + } + "update_namespace_export_sink" => { + rpc_call!( + retry_client, + call, + CloudService, + update_namespace_export_sink + ) + } + "update_namespace_tags" => { + rpc_call!(retry_client, call, CloudService, update_namespace_tags) + } + "update_nexus_endpoint" => { + rpc_call!(retry_client, call, CloudService, update_nexus_endpoint) + } + "update_service_account" => { + rpc_call!(retry_client, call, CloudService, update_service_account) + } + "update_user" => { + rpc_call!(retry_client, call, CloudService, update_user) + } + "update_user_group" => { + rpc_call!(retry_client, call, CloudService, update_user_group) + } + "validate_namespace_export_sink" => { + rpc_call!( + retry_client, + call, + CloudService, + validate_namespace_export_sink + ) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } -fn call_cloud_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - use temporal_client::CloudService; - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "add_namespace_region" => { - rpc_call!(retry_client, call, CloudService, add_namespace_region) - } - "add_user_group_member" => { - rpc_call!(retry_client, call, CloudService, add_user_group_member) - } - "create_api_key" => { - rpc_call!(retry_client, call, CloudService, create_api_key) - } - "create_connectivity_rule" => { - rpc_call!(retry_client, call, CloudService, create_connectivity_rule) - } - "create_namespace" => { - rpc_call!(retry_client, call, CloudService, create_namespace) - } - "create_namespace_export_sink" => { - rpc_call!(retry_client, call, CloudService, create_namespace_export_sink) - } - "create_nexus_endpoint" => { - rpc_call!(retry_client, call, CloudService, create_nexus_endpoint) - } - "create_service_account" => { - rpc_call!(retry_client, call, CloudService, create_service_account) - } - "create_user" => { - rpc_call!(retry_client, call, CloudService, create_user) - } - "create_user_group" => { - rpc_call!(retry_client, call, CloudService, create_user_group) - } - "delete_api_key" => { - rpc_call!(retry_client, call, CloudService, delete_api_key) - } - "delete_connectivity_rule" => { - rpc_call!(retry_client, call, CloudService, delete_connectivity_rule) - } - "delete_namespace" => { - rpc_call!(retry_client, call, CloudService, delete_namespace) - } - "delete_namespace_export_sink" => { - rpc_call!(retry_client, call, CloudService, delete_namespace_export_sink) - } - "delete_namespace_region" => { - rpc_call!(retry_client, call, CloudService, delete_namespace_region) - } - "delete_nexus_endpoint" => { - rpc_call!(retry_client, call, CloudService, delete_nexus_endpoint) - } - "delete_service_account" => { - rpc_call!(retry_client, call, CloudService, delete_service_account) - } - "delete_user" => { - rpc_call!(retry_client, call, CloudService, delete_user) - } - "delete_user_group" => { - rpc_call!(retry_client, call, CloudService, delete_user_group) - } - "failover_namespace_region" => { - rpc_call!(retry_client, call, CloudService, failover_namespace_region) - } - "get_account" => { - rpc_call!(retry_client, call, CloudService, get_account) - } - "get_api_key" => { - rpc_call!(retry_client, call, CloudService, get_api_key) - } - "get_api_keys" => { - rpc_call!(retry_client, call, CloudService, get_api_keys) - } - "get_async_operation" => { - rpc_call!(retry_client, call, CloudService, get_async_operation) - } - "get_connectivity_rule" => { - rpc_call!(retry_client, call, CloudService, get_connectivity_rule) - } - "get_connectivity_rules" => { - rpc_call!(retry_client, call, CloudService, get_connectivity_rules) - } - "get_namespace" => { - rpc_call!(retry_client, call, CloudService, get_namespace) - } - "get_namespace_export_sink" => { - rpc_call!(retry_client, call, CloudService, get_namespace_export_sink) - } - "get_namespace_export_sinks" => { - rpc_call!(retry_client, call, CloudService, get_namespace_export_sinks) - } - "get_namespaces" => { - rpc_call!(retry_client, call, CloudService, get_namespaces) - } - "get_nexus_endpoint" => { - rpc_call!(retry_client, call, CloudService, get_nexus_endpoint) - } - "get_nexus_endpoints" => { - rpc_call!(retry_client, call, CloudService, get_nexus_endpoints) - } - "get_region" => { - rpc_call!(retry_client, call, CloudService, get_region) - } - "get_regions" => { - rpc_call!(retry_client, call, CloudService, get_regions) - } - "get_service_account" => { - rpc_call!(retry_client, call, CloudService, get_service_account) - } - "get_service_accounts" => { - rpc_call!(retry_client, call, CloudService, get_service_accounts) - } - "get_usage" => { - rpc_call!(retry_client, call, CloudService, get_usage) - } - "get_user" => { - rpc_call!(retry_client, call, CloudService, get_user) - } - "get_user_group" => { - rpc_call!(retry_client, call, CloudService, get_user_group) - } - "get_user_group_members" => { - rpc_call!(retry_client, call, CloudService, get_user_group_members) - } - "get_user_groups" => { - rpc_call!(retry_client, call, CloudService, get_user_groups) - } - "get_users" => { - rpc_call!(retry_client, call, CloudService, get_users) - } - "remove_user_group_member" => { - rpc_call!(retry_client, call, CloudService, remove_user_group_member) - } - "rename_custom_search_attribute" => { - rpc_call!(retry_client, call, CloudService, rename_custom_search_attribute) - } - "set_user_group_namespace_access" => { - rpc_call!(retry_client, call, CloudService, set_user_group_namespace_access) - } - "set_user_namespace_access" => { - rpc_call!(retry_client, call, CloudService, set_user_namespace_access) - } - "update_account" => { - rpc_call!(retry_client, call, CloudService, update_account) - } - "update_api_key" => { - rpc_call!(retry_client, call, CloudService, update_api_key) - } - "update_namespace" => { - rpc_call!(retry_client, call, CloudService, update_namespace) - } - "update_namespace_export_sink" => { - rpc_call!(retry_client, call, CloudService, update_namespace_export_sink) - } - "update_namespace_tags" => { - rpc_call!(retry_client, call, CloudService, update_namespace_tags) - } - "update_nexus_endpoint" => { - rpc_call!(retry_client, call, CloudService, update_nexus_endpoint) - } - "update_service_account" => { - rpc_call!(retry_client, call, CloudService, update_service_account) - } - "update_user" => { - rpc_call!(retry_client, call, CloudService, update_user) - } - "update_user_group" => { - rpc_call!(retry_client, call, CloudService, update_user_group) - } - "validate_namespace_export_sink" => { - rpc_call!(retry_client, call, CloudService, validate_namespace_export_sink) - } - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } + fn call_test_service<'p>(&self, py: Python<'p>, call: RpcCall) -> PyResult> { + use temporal_client::TestService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "get_current_time" => { + rpc_call!(retry_client, call, TestService, get_current_time) + } + "lock_time_skipping" => { + rpc_call!(retry_client, call, TestService, lock_time_skipping) + } + "sleep" => { + rpc_call!(retry_client, call, TestService, sleep) + } + "sleep_until" => { + rpc_call!(retry_client, call, TestService, sleep_until) + } + "unlock_time_skipping" => { + rpc_call!(retry_client, call, TestService, unlock_time_skipping) + } + "unlock_time_skipping_with_sleep" => { + rpc_call!( + retry_client, + call, + TestService, + unlock_time_skipping_with_sleep + ) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } -fn call_test_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - use temporal_client::TestService; - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "get_current_time" => { - rpc_call!(retry_client, call, TestService, get_current_time) - } - "lock_time_skipping" => { - rpc_call!(retry_client, call, TestService, lock_time_skipping) - } - "sleep" => { - rpc_call!(retry_client, call, TestService, sleep) - } - "sleep_until" => { - rpc_call!(retry_client, call, TestService, sleep_until) - } - "unlock_time_skipping" => { - rpc_call!(retry_client, call, TestService, unlock_time_skipping) - } - "unlock_time_skipping_with_sleep" => { - rpc_call!(retry_client, call, TestService, unlock_time_skipping_with_sleep) - } - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } - -fn call_health_service<'p>( - &self, - py: Python<'p>, - call: RpcCall, - ) -> PyResult> { - use temporal_client::HealthService; - let mut retry_client = self.retry_client.clone(); - self.runtime.future_into_py(py, async move { - let bytes = match call.rpc.as_str() { - "check" => { - rpc_call!(retry_client, call, HealthService, check) - } - _ => { - return Err(PyValueError::new_err(format!( - "Unknown RPC call {}", - call.rpc - ))) - } - }?; - Ok(bytes) - }) - } -} \ No newline at end of file + fn call_health_service<'p>(&self, py: Python<'p>, call: RpcCall) -> PyResult> { + use temporal_client::HealthService; + let mut retry_client = self.retry_client.clone(); + self.runtime.future_into_py(py, async move { + let bytes = match call.rpc.as_str() { + "check" => { + rpc_call!(retry_client, call, HealthService, check) + } + _ => { + return Err(PyValueError::new_err(format!( + "Unknown RPC call {}", + call.rpc + ))) + } + }?; + Ok(bytes) + }) + } +} diff --git a/temporalio/bridge/src/envconfig.rs b/temporalio/bridge/src/envconfig.rs index da93586c7..9277a4588 100644 --- a/temporalio/bridge/src/envconfig.rs +++ b/temporalio/bridge/src/envconfig.rs @@ -7,9 +7,9 @@ use std::collections::HashMap; use temporal_sdk_core_api::envconfig::{ load_client_config as core_load_client_config, load_client_config_profile as core_load_client_config_profile, - ClientConfig as CoreClientConfig, ClientConfigCodec, ClientConfigProfile as CoreClientConfigProfile, - ClientConfigTLS as CoreClientConfigTLS, DataSource, LoadClientConfigOptions, - LoadClientConfigProfileOptions, + ClientConfig as CoreClientConfig, ClientConfigCodec, + ClientConfigProfile as CoreClientConfigProfile, ClientConfigTLS as CoreClientConfigTLS, + DataSource, LoadClientConfigOptions, LoadClientConfigProfileOptions, }; pyo3::create_exception!(temporal_sdk_bridge, ConfigError, PyRuntimeError); @@ -143,12 +143,7 @@ pub fn load_client_config( )) } }; - load_client_config_inner( - py, - config_source, - config_file_strict, - env_vars, - ) + load_client_config_inner(py, config_source, config_file_strict, env_vars) } #[pyfunction] @@ -183,4 +178,4 @@ pub fn load_client_connect_config( config_file_strict, env_vars, ) -} \ No newline at end of file +} diff --git a/temporalio/bridge/src/metric.rs b/temporalio/bridge/src/metric.rs index 3b24d5974..bc516a08a 100644 --- a/temporalio/bridge/src/metric.rs +++ b/temporalio/bridge/src/metric.rs @@ -107,14 +107,11 @@ impl MetricMeterRef { unit: Option, ) -> MetricHistogramFloatRef { MetricHistogramFloatRef { - histogram: self - .meter - .inner - .histogram_f64(build_metric_parameters( - name, - description, - unit, - )), + histogram: self.meter.inner.histogram_f64(build_metric_parameters( + name, + description, + unit, + )), } } @@ -125,14 +122,11 @@ impl MetricMeterRef { unit: Option, ) -> MetricHistogramDurationRef { MetricHistogramDurationRef { - histogram: self - .meter - .inner - .histogram_duration(build_metric_parameters( - name, - description, - unit, - )), + histogram: self.meter.inner.histogram_duration(build_metric_parameters( + name, + description, + unit, + )), } } diff --git a/temporalio/bridge/src/runtime.rs b/temporalio/bridge/src/runtime.rs index 84ec2ca42..72cc905ae 100644 --- a/temporalio/bridge/src/runtime.rs +++ b/temporalio/bridge/src/runtime.rs @@ -313,9 +313,8 @@ impl TryFrom for Arc { let mut build = OtelCollectorOptionsBuilder::default(); build .url( - Url::parse(&otel_conf.url).map_err(|err| { - PyValueError::new_err(format!("Invalid OTel URL: {err}")) - })?, + Url::parse(&otel_conf.url) + .map_err(|err| PyValueError::new_err(format!("Invalid OTel URL: {err}")))?, ) .headers(otel_conf.headers) .use_seconds_for_durations(otel_conf.durations_as_seconds); diff --git a/temporalio/bridge/src/worker.rs b/temporalio/bridge/src/worker.rs index ce0103fac..92b43f356 100644 --- a/temporalio/bridge/src/worker.rs +++ b/temporalio/bridge/src/worker.rs @@ -19,7 +19,9 @@ use temporal_sdk_core_api::worker::{ }; use temporal_sdk_core_api::Worker; use temporal_sdk_core_protos::coresdk::workflow_completion::WorkflowActivationCompletion; -use temporal_sdk_core_protos::coresdk::{ActivityHeartbeat, ActivityTaskCompletion, nexus::NexusTaskCompletion}; +use temporal_sdk_core_protos::coresdk::{ + nexus::NexusTaskCompletion, ActivityHeartbeat, ActivityTaskCompletion, +}; use temporal_sdk_core_protos::temporal::api::history::v1::History; use tokio::sync::mpsc::{channel, Sender}; use tokio_stream::wrappers::ReceiverStream; @@ -605,10 +607,11 @@ impl WorkerRef { }) } - fn complete_nexus_task<'p>(&self, + fn complete_nexus_task<'p>( + &self, py: Python<'p>, proto: &Bound<'_, PyBytes>, -) -> PyResult> { + ) -> PyResult> { let worker = self.worker.as_ref().unwrap().clone(); let completion = NexusTaskCompletion::decode(proto.as_bytes()) .map_err(|err| PyValueError::new_err(format!("Invalid proto: {err}")))?; diff --git a/temporalio/service.py b/temporalio/service.py index 3bb6fd38c..c77ddbb76 100644 --- a/temporalio/service.py +++ b/temporalio/service.py @@ -17,8 +17,8 @@ import temporalio.api.common.v1 import temporalio.bridge.client +import temporalio.bridge.generated.services_generated import temporalio.bridge.proto.health.v1 -import temporalio.bridge.services_generated import temporalio.exceptions import temporalio.runtime @@ -237,7 +237,6 @@ async def check_health( is unavailable (rare), or raises an error if server/service cannot be reached. """ - resp = await self.health_service.check( temporalio.bridge.proto.health.v1.HealthCheckRequest(service=service), retry=retry, @@ -281,23 +280,23 @@ async def _rpc_call( raise NotImplementedError -class WorkflowService(temporalio.bridge.services_generated.WorkflowService): +class WorkflowService(temporalio.bridge.generated.services_generated.WorkflowService): """Client to the Temporal server's workflow service.""" -class OperatorService(temporalio.bridge.services_generated.OperatorService): +class OperatorService(temporalio.bridge.generated.services_generated.OperatorService): """Client to the Temporal server's operator service.""" -class CloudService(temporalio.bridge.services_generated.CloudService): +class CloudService(temporalio.bridge.generated.services_generated.CloudService): """Client to the Temporal server's cloud service.""" -class TestService(temporalio.bridge.services_generated.TestService): +class TestService(temporalio.bridge.generated.services_generated.TestService): """Client to the Temporal test server's test service.""" -class HealthService(temporalio.bridge.services_generated.HealthService): +class HealthService(temporalio.bridge.generated.services_generated.HealthService): """Client to the Temporal server's health service.""" diff --git a/tests/worker/test_workflow.py b/tests/worker/test_workflow.py index 9661ad7cc..0f05d5af5 100644 --- a/tests/worker/test_workflow.py +++ b/tests/worker/test_workflow.py @@ -4838,7 +4838,7 @@ async def patched_call( try: await called.wait() finally: - client.workflow_service.poll_workflow_execution_update = unpatched_call + client.workflow_service.poll_workflow_execution_update = unpatched_call # type: ignore result_task.cancel() with pytest.raises(WorkflowUpdateRPCTimeoutOrCancelledError): await result_task