@temporalio/core-bridge 1.13.0 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/Cargo.lock +239 -382
  2. package/Cargo.toml +11 -11
  3. package/lib/native.d.ts +10 -3
  4. package/package.json +3 -3
  5. package/releases/aarch64-apple-darwin/index.node +0 -0
  6. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  7. package/releases/x86_64-apple-darwin/index.node +0 -0
  8. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  9. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  10. package/sdk-core/.cargo/config.toml +71 -11
  11. package/sdk-core/.clippy.toml +1 -0
  12. package/sdk-core/.github/workflows/heavy.yml +2 -0
  13. package/sdk-core/.github/workflows/per-pr.yml +50 -18
  14. package/sdk-core/ARCHITECTURE.md +44 -48
  15. package/sdk-core/Cargo.toml +26 -7
  16. package/sdk-core/README.md +4 -0
  17. package/sdk-core/arch_docs/diagrams/TimerMachine_Coverage.puml +14 -0
  18. package/sdk-core/arch_docs/diagrams/initial_event_history.png +0 -0
  19. package/sdk-core/arch_docs/sdks_intro.md +299 -0
  20. package/sdk-core/client/Cargo.toml +8 -7
  21. package/sdk-core/client/src/callback_based.rs +1 -2
  22. package/sdk-core/client/src/lib.rs +485 -299
  23. package/sdk-core/client/src/metrics.rs +32 -8
  24. package/sdk-core/client/src/proxy.rs +124 -5
  25. package/sdk-core/client/src/raw.rs +598 -307
  26. package/sdk-core/client/src/replaceable.rs +253 -0
  27. package/sdk-core/client/src/retry.rs +9 -6
  28. package/sdk-core/client/src/worker_registry/mod.rs +19 -3
  29. package/sdk-core/client/src/workflow_handle/mod.rs +20 -17
  30. package/sdk-core/core/Cargo.toml +100 -31
  31. package/sdk-core/core/src/core_tests/activity_tasks.rs +55 -225
  32. package/sdk-core/core/src/core_tests/mod.rs +2 -8
  33. package/sdk-core/core/src/core_tests/queries.rs +3 -5
  34. package/sdk-core/core/src/core_tests/replay_flag.rs +3 -62
  35. package/sdk-core/core/src/core_tests/updates.rs +4 -5
  36. package/sdk-core/core/src/core_tests/workers.rs +4 -3
  37. package/sdk-core/core/src/core_tests/workflow_cancels.rs +10 -7
  38. package/sdk-core/core/src/core_tests/workflow_tasks.rs +28 -291
  39. package/sdk-core/core/src/ephemeral_server/mod.rs +15 -3
  40. package/sdk-core/core/src/internal_flags.rs +11 -1
  41. package/sdk-core/core/src/lib.rs +50 -36
  42. package/sdk-core/core/src/pollers/mod.rs +5 -5
  43. package/sdk-core/core/src/pollers/poll_buffer.rs +2 -2
  44. package/sdk-core/core/src/protosext/mod.rs +13 -5
  45. package/sdk-core/core/src/protosext/protocol_messages.rs +4 -11
  46. package/sdk-core/core/src/retry_logic.rs +256 -108
  47. package/sdk-core/core/src/telemetry/metrics.rs +1 -0
  48. package/sdk-core/core/src/telemetry/mod.rs +8 -2
  49. package/sdk-core/core/src/telemetry/prometheus_meter.rs +2 -2
  50. package/sdk-core/core/src/test_help/integ_helpers.rs +971 -0
  51. package/sdk-core/core/src/test_help/mod.rs +10 -1100
  52. package/sdk-core/core/src/test_help/unit_helpers.rs +218 -0
  53. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +42 -6
  54. package/sdk-core/core/src/worker/activities/local_activities.rs +19 -19
  55. package/sdk-core/core/src/worker/activities.rs +10 -3
  56. package/sdk-core/core/src/worker/client/mocks.rs +3 -3
  57. package/sdk-core/core/src/worker/client.rs +130 -93
  58. package/sdk-core/core/src/worker/heartbeat.rs +12 -13
  59. package/sdk-core/core/src/worker/mod.rs +31 -21
  60. package/sdk-core/core/src/worker/nexus.rs +14 -3
  61. package/sdk-core/core/src/worker/slot_provider.rs +9 -0
  62. package/sdk-core/core/src/worker/tuner.rs +159 -0
  63. package/sdk-core/core/src/worker/workflow/history_update.rs +3 -265
  64. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +1 -54
  65. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +0 -82
  66. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +0 -67
  67. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -192
  68. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +0 -43
  69. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +6 -554
  70. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +0 -71
  71. package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +102 -3
  72. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +10 -539
  73. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +0 -139
  74. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +1 -119
  75. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +6 -63
  76. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +9 -4
  77. package/sdk-core/core/src/worker/workflow/mod.rs +5 -1
  78. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +8 -3
  79. package/sdk-core/core-api/Cargo.toml +4 -4
  80. package/sdk-core/core-api/src/envconfig.rs +153 -54
  81. package/sdk-core/core-api/src/lib.rs +68 -0
  82. package/sdk-core/core-api/src/telemetry/metrics.rs +2 -1
  83. package/sdk-core/core-api/src/telemetry.rs +13 -0
  84. package/sdk-core/core-c-bridge/Cargo.toml +13 -8
  85. package/sdk-core/core-c-bridge/include/temporal-sdk-core-c-bridge.h +184 -22
  86. package/sdk-core/core-c-bridge/src/client.rs +462 -184
  87. package/sdk-core/core-c-bridge/src/envconfig.rs +314 -0
  88. package/sdk-core/core-c-bridge/src/lib.rs +1 -0
  89. package/sdk-core/core-c-bridge/src/random.rs +4 -4
  90. package/sdk-core/core-c-bridge/src/runtime.rs +22 -23
  91. package/sdk-core/core-c-bridge/src/testing.rs +1 -4
  92. package/sdk-core/core-c-bridge/src/tests/context.rs +31 -31
  93. package/sdk-core/core-c-bridge/src/tests/mod.rs +32 -28
  94. package/sdk-core/core-c-bridge/src/tests/utils.rs +7 -7
  95. package/sdk-core/core-c-bridge/src/worker.rs +319 -66
  96. package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +6 -1
  97. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +5 -5
  98. package/sdk-core/sdk/Cargo.toml +8 -2
  99. package/sdk-core/sdk/src/activity_context.rs +1 -1
  100. package/sdk-core/sdk/src/app_data.rs +1 -1
  101. package/sdk-core/sdk/src/interceptors.rs +1 -4
  102. package/sdk-core/sdk/src/lib.rs +1 -5
  103. package/sdk-core/sdk/src/workflow_context/options.rs +10 -1
  104. package/sdk-core/sdk/src/workflow_future.rs +1 -1
  105. package/sdk-core/sdk-core-protos/Cargo.toml +6 -6
  106. package/sdk-core/sdk-core-protos/build.rs +10 -23
  107. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/create-release.yml +9 -1
  108. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +254 -5
  109. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +234 -5
  110. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +1 -1
  111. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +6 -0
  112. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto +6 -2
  113. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +60 -2
  114. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +30 -6
  115. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +2 -0
  116. package/sdk-core/{test-utils → sdk-core-protos}/src/canned_histories.rs +5 -5
  117. package/sdk-core/sdk-core-protos/src/history_builder.rs +2 -2
  118. package/sdk-core/sdk-core-protos/src/lib.rs +25 -9
  119. package/sdk-core/sdk-core-protos/src/test_utils.rs +89 -0
  120. package/sdk-core/sdk-core-protos/src/utilities.rs +14 -5
  121. package/sdk-core/tests/c_bridge_smoke_test.c +10 -0
  122. package/sdk-core/tests/cloud_tests.rs +10 -8
  123. package/sdk-core/tests/common/http_proxy.rs +134 -0
  124. package/sdk-core/{test-utils/src/lib.rs → tests/common/mod.rs} +214 -281
  125. package/sdk-core/{test-utils/src → tests/common}/workflows.rs +4 -3
  126. package/sdk-core/tests/fuzzy_workflow.rs +1 -1
  127. package/sdk-core/tests/global_metric_tests.rs +8 -7
  128. package/sdk-core/tests/heavy_tests.rs +7 -3
  129. package/sdk-core/tests/integ_tests/client_tests.rs +111 -24
  130. package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +14 -9
  131. package/sdk-core/tests/integ_tests/heartbeat_tests.rs +4 -4
  132. package/sdk-core/tests/integ_tests/metrics_tests.rs +114 -14
  133. package/sdk-core/tests/integ_tests/pagination_tests.rs +273 -0
  134. package/sdk-core/tests/integ_tests/polling_tests.rs +311 -93
  135. package/sdk-core/tests/integ_tests/queries_tests.rs +4 -4
  136. package/sdk-core/tests/integ_tests/update_tests.rs +13 -7
  137. package/sdk-core/tests/integ_tests/visibility_tests.rs +26 -9
  138. package/sdk-core/tests/integ_tests/worker_tests.rs +668 -13
  139. package/sdk-core/tests/integ_tests/worker_versioning_tests.rs +40 -24
  140. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +244 -11
  141. package/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +1 -1
  142. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +78 -2
  143. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +61 -2
  144. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +465 -7
  145. package/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +41 -2
  146. package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +315 -3
  147. package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +1 -1
  148. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1990 -14
  149. package/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +65 -2
  150. package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +123 -23
  151. package/sdk-core/tests/integ_tests/workflow_tests/patches.rs +525 -3
  152. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +65 -16
  153. package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +32 -23
  154. package/sdk-core/tests/integ_tests/workflow_tests/signals.rs +126 -5
  155. package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +1 -2
  156. package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +124 -8
  157. package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +62 -2
  158. package/sdk-core/tests/integ_tests/workflow_tests.rs +67 -8
  159. package/sdk-core/tests/main.rs +26 -17
  160. package/sdk-core/tests/manual_tests.rs +5 -1
  161. package/sdk-core/tests/runner.rs +22 -40
  162. package/sdk-core/tests/shared_tests/mod.rs +1 -1
  163. package/sdk-core/tests/shared_tests/priority.rs +1 -1
  164. package/sdk-core/{core/benches/workflow_replay.rs → tests/workflow_replay_bench.rs} +10 -5
  165. package/src/client.rs +97 -20
  166. package/src/helpers/callbacks.rs +4 -4
  167. package/src/helpers/errors.rs +7 -1
  168. package/src/helpers/handles.rs +1 -0
  169. package/src/helpers/try_from_js.rs +4 -3
  170. package/src/lib.rs +3 -2
  171. package/src/metrics.rs +3 -0
  172. package/src/runtime.rs +5 -2
  173. package/src/worker.rs +9 -12
  174. package/ts/native.ts +13 -3
  175. package/sdk-core/arch_docs/diagrams/workflow_internals.svg +0 -1
  176. package/sdk-core/core/src/core_tests/child_workflows.rs +0 -281
  177. package/sdk-core/core/src/core_tests/determinism.rs +0 -318
  178. package/sdk-core/core/src/core_tests/local_activities.rs +0 -1442
  179. package/sdk-core/test-utils/Cargo.toml +0 -38
  180. package/sdk-core/test-utils/src/histfetch.rs +0 -28
  181. package/sdk-core/test-utils/src/interceptors.rs +0 -46
@@ -4,17 +4,20 @@ use crate::{
4
4
 
5
5
  use futures_util::FutureExt;
6
6
  use prost::bytes::Bytes;
7
- use std::cell::OnceCell;
8
- use std::str::FromStr;
9
- use std::sync::Arc;
10
- use std::sync::atomic::AtomicBool;
11
- use std::sync::atomic::Ordering;
12
- use std::time::Duration;
7
+ use std::{
8
+ cell::OnceCell,
9
+ str::FromStr,
10
+ sync::{
11
+ Arc,
12
+ atomic::{AtomicBool, Ordering},
13
+ },
14
+ time::Duration,
15
+ };
13
16
  use temporal_client::{
14
17
  ClientKeepAliveConfig, ClientOptions as CoreClientOptions, ClientOptionsBuilder,
15
18
  ClientTlsConfig, CloudService, ConfiguredClient, HealthService, HttpConnectProxyOptions,
16
- OperatorService, RetryClient, RetryConfig, TemporalServiceClientWithMetrics, TestService,
17
- TlsConfig, WorkflowService, callback_based,
19
+ OperatorService, RetryClient, RetryConfig, TemporalServiceClient, TestService, TlsConfig,
20
+ WorkflowService, callback_based,
18
21
  };
19
22
  use tokio::sync::oneshot;
20
23
  use tonic::metadata::MetadataKey;
@@ -76,7 +79,7 @@ pub struct ClientHttpConnectProxyOptions {
76
79
  pub password: ByteArrayRef,
77
80
  }
78
81
 
79
- type CoreClient = RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>;
82
+ type CoreClient = RetryClient<ConfiguredClient<TemporalServiceClient>>;
80
83
 
81
84
  pub struct Client {
82
85
  pub(crate) runtime: Runtime,
@@ -240,7 +243,7 @@ pub extern "C" fn temporal_core_client_update_metadata(
240
243
  metadata: ByteArrayRef,
241
244
  ) {
242
245
  let client = unsafe { &*client };
243
- client
246
+ let _result = client
244
247
  .core
245
248
  .get_client()
246
249
  .set_headers(metadata.to_string_map_on_newlines());
@@ -525,16 +528,6 @@ pub extern "C" fn temporal_core_client_rpc_call(
525
528
  });
526
529
  }
527
530
 
528
- macro_rules! rpc_call {
529
- ($client:ident, $call:ident, $call_name:ident) => {
530
- if $call.retry {
531
- rpc_resp($client.$call_name(rpc_req($call)?).await)
532
- } else {
533
- rpc_resp($client.into_inner().$call_name(rpc_req($call)?).await)
534
- }
535
- };
536
- }
537
-
538
531
  macro_rules! rpc_call_on_trait {
539
532
  ($client:ident, $call:ident, $trait:tt, $call_name:ident) => {
540
533
  if $call.retry {
@@ -552,115 +545,313 @@ async fn call_workflow_service(
552
545
  let rpc = call.rpc.to_str();
553
546
  let mut client = client.clone();
554
547
  match rpc {
555
- "CountWorkflowExecutions" => rpc_call!(client, call, count_workflow_executions),
556
- "CreateSchedule" => rpc_call!(client, call, create_schedule),
557
- "CreateWorkflowRule" => rpc_call!(client, call, create_workflow_rule),
558
- "DeleteSchedule" => rpc_call!(client, call, delete_schedule),
559
- "DeleteWorkerDeployment" => rpc_call!(client, call, delete_worker_deployment),
548
+ "CountWorkflowExecutions" => {
549
+ rpc_call_on_trait!(client, call, WorkflowService, count_workflow_executions)
550
+ }
551
+ "CreateSchedule" => rpc_call_on_trait!(client, call, WorkflowService, create_schedule),
552
+ "CreateWorkflowRule" => {
553
+ rpc_call_on_trait!(client, call, WorkflowService, create_workflow_rule)
554
+ }
555
+ "DeleteSchedule" => rpc_call_on_trait!(client, call, WorkflowService, delete_schedule),
556
+ "DeleteWorkerDeployment" => {
557
+ rpc_call_on_trait!(client, call, WorkflowService, delete_worker_deployment)
558
+ }
560
559
  "DeleteWorkerDeploymentVersion" => {
561
- rpc_call!(client, call, delete_worker_deployment_version)
562
- }
563
- "DeleteWorkflowExecution" => rpc_call!(client, call, delete_workflow_execution),
564
- "DeleteWorkflowRule" => rpc_call!(client, call, delete_workflow_rule),
565
- "DeprecateNamespace" => rpc_call!(client, call, deprecate_namespace),
566
- "DescribeBatchOperation" => rpc_call!(client, call, describe_batch_operation),
567
- "DescribeDeployment" => rpc_call!(client, call, describe_deployment),
568
- "DescribeNamespace" => rpc_call!(client, call, describe_namespace),
569
- "DescribeSchedule" => rpc_call!(client, call, describe_schedule),
570
- "DescribeTaskQueue" => rpc_call!(client, call, describe_task_queue),
571
- "DescribeWorkerDeployment" => rpc_call!(client, call, describe_worker_deployment),
560
+ rpc_call_on_trait!(
561
+ client,
562
+ call,
563
+ WorkflowService,
564
+ delete_worker_deployment_version
565
+ )
566
+ }
567
+ "DeleteWorkflowExecution" => {
568
+ rpc_call_on_trait!(client, call, WorkflowService, delete_workflow_execution)
569
+ }
570
+ "DeleteWorkflowRule" => {
571
+ rpc_call_on_trait!(client, call, WorkflowService, delete_workflow_rule)
572
+ }
573
+ "DeprecateNamespace" => {
574
+ rpc_call_on_trait!(client, call, WorkflowService, deprecate_namespace)
575
+ }
576
+ "DescribeBatchOperation" => {
577
+ rpc_call_on_trait!(client, call, WorkflowService, describe_batch_operation)
578
+ }
579
+ "DescribeDeployment" => {
580
+ rpc_call_on_trait!(client, call, WorkflowService, describe_deployment)
581
+ }
582
+ "DescribeNamespace" => {
583
+ rpc_call_on_trait!(client, call, WorkflowService, describe_namespace)
584
+ }
585
+ "DescribeSchedule" => rpc_call_on_trait!(client, call, WorkflowService, describe_schedule),
586
+ "DescribeTaskQueue" => {
587
+ rpc_call_on_trait!(client, call, WorkflowService, describe_task_queue)
588
+ }
589
+ "DescribeWorker" => {
590
+ rpc_call_on_trait!(client, call, WorkflowService, describe_worker)
591
+ }
592
+ "DescribeWorkerDeployment" => {
593
+ rpc_call_on_trait!(client, call, WorkflowService, describe_worker_deployment)
594
+ }
572
595
  "DescribeWorkerDeploymentVersion" => {
573
- rpc_call!(client, call, describe_worker_deployment_version)
574
- }
575
- "DescribeWorkflowExecution" => rpc_call!(client, call, describe_workflow_execution),
576
- "DescribeWorkflowRule" => rpc_call!(client, call, describe_workflow_rule),
577
- "ExecuteMultiOperation" => rpc_call!(client, call, execute_multi_operation),
578
- "FetchWorkerConfig" => rpc_call!(client, call, fetch_worker_config),
579
- "GetClusterInfo" => rpc_call!(client, call, get_cluster_info),
580
- "GetCurrentDeployment" => rpc_call!(client, call, get_current_deployment),
581
- "GetDeploymentReachability" => rpc_call!(client, call, get_deployment_reachability),
582
- "GetSearchAttributes" => rpc_call!(client, call, get_search_attributes),
583
- "GetSystemInfo" => rpc_call!(client, call, get_system_info),
596
+ rpc_call_on_trait!(
597
+ client,
598
+ call,
599
+ WorkflowService,
600
+ describe_worker_deployment_version
601
+ )
602
+ }
603
+ "DescribeWorkflowExecution" => {
604
+ rpc_call_on_trait!(client, call, WorkflowService, describe_workflow_execution)
605
+ }
606
+ "DescribeWorkflowRule" => {
607
+ rpc_call_on_trait!(client, call, WorkflowService, describe_workflow_rule)
608
+ }
609
+ "ExecuteMultiOperation" => {
610
+ rpc_call_on_trait!(client, call, WorkflowService, execute_multi_operation)
611
+ }
612
+ "FetchWorkerConfig" => {
613
+ rpc_call_on_trait!(client, call, WorkflowService, fetch_worker_config)
614
+ }
615
+ "GetClusterInfo" => rpc_call_on_trait!(client, call, WorkflowService, get_cluster_info),
616
+ "GetCurrentDeployment" => {
617
+ rpc_call_on_trait!(client, call, WorkflowService, get_current_deployment)
618
+ }
619
+ "GetDeploymentReachability" => {
620
+ rpc_call_on_trait!(client, call, WorkflowService, get_deployment_reachability)
621
+ }
622
+ "GetSearchAttributes" => {
623
+ rpc_call_on_trait!(client, call, WorkflowService, get_search_attributes)
624
+ }
625
+ "GetSystemInfo" => rpc_call_on_trait!(client, call, WorkflowService, get_system_info),
584
626
  "GetWorkerBuildIdCompatibility" => {
585
- rpc_call!(client, call, get_worker_build_id_compatibility)
627
+ rpc_call_on_trait!(
628
+ client,
629
+ call,
630
+ WorkflowService,
631
+ get_worker_build_id_compatibility
632
+ )
586
633
  }
587
634
  "GetWorkerTaskReachability" => {
588
- rpc_call!(client, call, get_worker_task_reachability)
635
+ rpc_call_on_trait!(client, call, WorkflowService, get_worker_task_reachability)
589
636
  }
590
- "GetWorkerVersioningRules" => rpc_call!(client, call, get_worker_versioning_rules),
591
- "GetWorkflowExecutionHistory" => rpc_call!(client, call, get_workflow_execution_history),
637
+ "GetWorkerVersioningRules" => {
638
+ rpc_call_on_trait!(client, call, WorkflowService, get_worker_versioning_rules)
639
+ }
640
+ "GetWorkflowExecutionHistory" => rpc_call_on_trait!(
641
+ client,
642
+ call,
643
+ WorkflowService,
644
+ get_workflow_execution_history
645
+ ),
592
646
  "GetWorkflowExecutionHistoryReverse" => {
593
- rpc_call!(client, call, get_workflow_execution_history_reverse)
647
+ rpc_call_on_trait!(
648
+ client,
649
+ call,
650
+ WorkflowService,
651
+ get_workflow_execution_history_reverse
652
+ )
594
653
  }
595
654
  "ListArchivedWorkflowExecutions" => {
596
- rpc_call!(client, call, list_archived_workflow_executions)
597
- }
598
- "ListBatchOperations" => rpc_call!(client, call, list_batch_operations),
599
- "ListClosedWorkflowExecutions" => rpc_call!(client, call, list_closed_workflow_executions),
600
- "ListDeployments" => rpc_call!(client, call, list_deployments),
601
- "ListNamespaces" => rpc_call!(client, call, list_namespaces),
602
- "ListOpenWorkflowExecutions" => rpc_call!(client, call, list_open_workflow_executions),
603
- "ListScheduleMatchingTimes" => rpc_call!(client, call, list_schedule_matching_times),
604
- "ListSchedules" => rpc_call!(client, call, list_schedules),
605
- "ListTaskQueuePartitions" => rpc_call!(client, call, list_task_queue_partitions),
606
- "ListWorkerDeployments" => rpc_call!(client, call, list_worker_deployments),
607
- "ListWorkers" => rpc_call!(client, call, list_workers),
608
- "ListWorkflowExecutions" => rpc_call!(client, call, list_workflow_executions),
609
- "ListWorkflowRules" => rpc_call!(client, call, list_workflow_rules),
610
- "PatchSchedule" => rpc_call!(client, call, patch_schedule),
611
- "PauseActivity" => rpc_call!(client, call, pause_activity),
612
- "PollActivityTaskQueue" => rpc_call!(client, call, poll_activity_task_queue),
613
- "PollNexusTaskQueue" => rpc_call!(client, call, poll_nexus_task_queue),
614
- "PollWorkflowExecutionUpdate" => rpc_call!(client, call, poll_workflow_execution_update),
615
- "PollWorkflowTaskQueue" => rpc_call!(client, call, poll_workflow_task_queue),
616
- "QueryWorkflow" => rpc_call!(client, call, query_workflow),
617
- "RecordActivityTaskHeartbeat" => rpc_call!(client, call, record_activity_task_heartbeat),
655
+ rpc_call_on_trait!(
656
+ client,
657
+ call,
658
+ WorkflowService,
659
+ list_archived_workflow_executions
660
+ )
661
+ }
662
+ "ListBatchOperations" => {
663
+ rpc_call_on_trait!(client, call, WorkflowService, list_batch_operations)
664
+ }
665
+ "ListClosedWorkflowExecutions" => rpc_call_on_trait!(
666
+ client,
667
+ call,
668
+ WorkflowService,
669
+ list_closed_workflow_executions
670
+ ),
671
+ "ListDeployments" => rpc_call_on_trait!(client, call, WorkflowService, list_deployments),
672
+ "ListNamespaces" => rpc_call_on_trait!(client, call, WorkflowService, list_namespaces),
673
+ "ListOpenWorkflowExecutions" => {
674
+ rpc_call_on_trait!(client, call, WorkflowService, list_open_workflow_executions)
675
+ }
676
+ "ListScheduleMatchingTimes" => {
677
+ rpc_call_on_trait!(client, call, WorkflowService, list_schedule_matching_times)
678
+ }
679
+ "ListSchedules" => rpc_call_on_trait!(client, call, WorkflowService, list_schedules),
680
+ "ListTaskQueuePartitions" => {
681
+ rpc_call_on_trait!(client, call, WorkflowService, list_task_queue_partitions)
682
+ }
683
+ "ListWorkerDeployments" => {
684
+ rpc_call_on_trait!(client, call, WorkflowService, list_worker_deployments)
685
+ }
686
+ "ListWorkers" => rpc_call_on_trait!(client, call, WorkflowService, list_workers),
687
+ "ListWorkflowExecutions" => {
688
+ rpc_call_on_trait!(client, call, WorkflowService, list_workflow_executions)
689
+ }
690
+ "ListWorkflowRules" => {
691
+ rpc_call_on_trait!(client, call, WorkflowService, list_workflow_rules)
692
+ }
693
+ "PatchSchedule" => rpc_call_on_trait!(client, call, WorkflowService, patch_schedule),
694
+ "PauseActivity" => rpc_call_on_trait!(client, call, WorkflowService, pause_activity),
695
+ "PollActivityTaskQueue" => {
696
+ rpc_call_on_trait!(client, call, WorkflowService, poll_activity_task_queue)
697
+ }
698
+ "PollNexusTaskQueue" => {
699
+ rpc_call_on_trait!(client, call, WorkflowService, poll_nexus_task_queue)
700
+ }
701
+ "PollWorkflowExecutionUpdate" => rpc_call_on_trait!(
702
+ client,
703
+ call,
704
+ WorkflowService,
705
+ poll_workflow_execution_update
706
+ ),
707
+ "PollWorkflowTaskQueue" => {
708
+ rpc_call_on_trait!(client, call, WorkflowService, poll_workflow_task_queue)
709
+ }
710
+ "QueryWorkflow" => rpc_call_on_trait!(client, call, WorkflowService, query_workflow),
711
+ "RecordActivityTaskHeartbeat" => rpc_call_on_trait!(
712
+ client,
713
+ call,
714
+ WorkflowService,
715
+ record_activity_task_heartbeat
716
+ ),
618
717
  "RecordActivityTaskHeartbeatById" => {
619
- rpc_call!(client, call, record_activity_task_heartbeat_by_id)
718
+ rpc_call_on_trait!(
719
+ client,
720
+ call,
721
+ WorkflowService,
722
+ record_activity_task_heartbeat_by_id
723
+ )
724
+ }
725
+ "RecordWorkerHeartbeat" => {
726
+ rpc_call_on_trait!(client, call, WorkflowService, record_worker_heartbeat)
727
+ }
728
+ "RegisterNamespace" => {
729
+ rpc_call_on_trait!(client, call, WorkflowService, register_namespace)
620
730
  }
621
- "RecordWorkerHeartbeat" => rpc_call!(client, call, record_worker_heartbeat),
622
- "RegisterNamespace" => rpc_call!(client, call, register_namespace),
623
731
  "RequestCancelWorkflowExecution" => {
624
- rpc_call!(client, call, request_cancel_workflow_execution)
732
+ rpc_call_on_trait!(
733
+ client,
734
+ call,
735
+ WorkflowService,
736
+ request_cancel_workflow_execution
737
+ )
738
+ }
739
+ "ResetActivity" => rpc_call_on_trait!(client, call, WorkflowService, reset_activity),
740
+ "ResetStickyTaskQueue" => {
741
+ rpc_call_on_trait!(client, call, WorkflowService, reset_sticky_task_queue)
625
742
  }
626
- "ResetActivity" => rpc_call!(client, call, reset_activity),
627
- "ResetStickyTaskQueue" => rpc_call!(client, call, reset_sticky_task_queue),
628
- "ResetWorkflowExecution" => rpc_call!(client, call, reset_workflow_execution),
629
- "RespondActivityTaskCanceled" => rpc_call!(client, call, respond_activity_task_canceled),
743
+ "ResetWorkflowExecution" => {
744
+ rpc_call_on_trait!(client, call, WorkflowService, reset_workflow_execution)
745
+ }
746
+ "RespondActivityTaskCanceled" => rpc_call_on_trait!(
747
+ client,
748
+ call,
749
+ WorkflowService,
750
+ respond_activity_task_canceled
751
+ ),
630
752
  "RespondActivityTaskCanceledById" => {
631
- rpc_call!(client, call, respond_activity_task_canceled_by_id)
753
+ rpc_call_on_trait!(
754
+ client,
755
+ call,
756
+ WorkflowService,
757
+ respond_activity_task_canceled_by_id
758
+ )
632
759
  }
633
- "RespondActivityTaskCompleted" => rpc_call!(client, call, respond_activity_task_completed),
760
+ "RespondActivityTaskCompleted" => rpc_call_on_trait!(
761
+ client,
762
+ call,
763
+ WorkflowService,
764
+ respond_activity_task_completed
765
+ ),
634
766
  "RespondActivityTaskCompletedById" => {
635
- rpc_call!(client, call, respond_activity_task_completed_by_id)
767
+ rpc_call_on_trait!(
768
+ client,
769
+ call,
770
+ WorkflowService,
771
+ respond_activity_task_completed_by_id
772
+ )
773
+ }
774
+ "RespondActivityTaskFailed" => {
775
+ rpc_call_on_trait!(client, call, WorkflowService, respond_activity_task_failed)
636
776
  }
637
- "RespondActivityTaskFailed" => rpc_call!(client, call, respond_activity_task_failed),
638
777
  "RespondActivityTaskFailedById" => {
639
- rpc_call!(client, call, respond_activity_task_failed_by_id)
640
- }
641
- "RespondNexusTaskCompleted" => rpc_call!(client, call, respond_nexus_task_completed),
642
- "RespondNexusTaskFailed" => rpc_call!(client, call, respond_nexus_task_failed),
643
- "RespondQueryTaskCompleted" => rpc_call!(client, call, respond_query_task_completed),
644
- "RespondWorkflowTaskCompleted" => rpc_call!(client, call, respond_workflow_task_completed),
645
- "RespondWorkflowTaskFailed" => rpc_call!(client, call, respond_workflow_task_failed),
646
- "ScanWorkflowExecutions" => rpc_call!(client, call, scan_workflow_executions),
647
- "SetCurrentDeployment" => rpc_call!(client, call, set_current_deployment),
778
+ rpc_call_on_trait!(
779
+ client,
780
+ call,
781
+ WorkflowService,
782
+ respond_activity_task_failed_by_id
783
+ )
784
+ }
785
+ "RespondNexusTaskCompleted" => {
786
+ rpc_call_on_trait!(client, call, WorkflowService, respond_nexus_task_completed)
787
+ }
788
+ "RespondNexusTaskFailed" => {
789
+ rpc_call_on_trait!(client, call, WorkflowService, respond_nexus_task_failed)
790
+ }
791
+ "RespondQueryTaskCompleted" => {
792
+ rpc_call_on_trait!(client, call, WorkflowService, respond_query_task_completed)
793
+ }
794
+ "RespondWorkflowTaskCompleted" => rpc_call_on_trait!(
795
+ client,
796
+ call,
797
+ WorkflowService,
798
+ respond_workflow_task_completed
799
+ ),
800
+ "RespondWorkflowTaskFailed" => {
801
+ rpc_call_on_trait!(client, call, WorkflowService, respond_workflow_task_failed)
802
+ }
803
+ "ScanWorkflowExecutions" => {
804
+ rpc_call_on_trait!(client, call, WorkflowService, scan_workflow_executions)
805
+ }
806
+ "SetCurrentDeployment" => {
807
+ rpc_call_on_trait!(client, call, WorkflowService, set_current_deployment)
808
+ }
648
809
  "SetWorkerDeploymentCurrentVersion" => {
649
- rpc_call!(client, call, set_worker_deployment_current_version)
810
+ rpc_call_on_trait!(
811
+ client,
812
+ call,
813
+ WorkflowService,
814
+ set_worker_deployment_current_version
815
+ )
816
+ }
817
+ "SetWorkerDeploymentManager" => {
818
+ rpc_call_on_trait!(client, call, WorkflowService, set_worker_deployment_manager)
650
819
  }
651
820
  "SetWorkerDeploymentRampingVersion" => {
652
- rpc_call!(client, call, set_worker_deployment_ramping_version)
821
+ rpc_call_on_trait!(
822
+ client,
823
+ call,
824
+ WorkflowService,
825
+ set_worker_deployment_ramping_version
826
+ )
653
827
  }
654
- "ShutdownWorker" => rpc_call!(client, call, shutdown_worker),
828
+ "ShutdownWorker" => rpc_call_on_trait!(client, call, WorkflowService, shutdown_worker),
655
829
  "SignalWithStartWorkflowExecution" => {
656
- rpc_call!(client, call, signal_with_start_workflow_execution)
657
- }
658
- "SignalWorkflowExecution" => rpc_call!(client, call, signal_workflow_execution),
659
- "StartWorkflowExecution" => rpc_call!(client, call, start_workflow_execution),
660
- "StartBatchOperation" => rpc_call!(client, call, start_batch_operation),
661
- "StopBatchOperation" => rpc_call!(client, call, stop_batch_operation),
662
- "TerminateWorkflowExecution" => rpc_call!(client, call, terminate_workflow_execution),
663
- "TriggerWorkflowRule" => rpc_call!(client, call, trigger_workflow_rule),
830
+ rpc_call_on_trait!(
831
+ client,
832
+ call,
833
+ WorkflowService,
834
+ signal_with_start_workflow_execution
835
+ )
836
+ }
837
+ "SignalWorkflowExecution" => {
838
+ rpc_call_on_trait!(client, call, WorkflowService, signal_workflow_execution)
839
+ }
840
+ "StartWorkflowExecution" => {
841
+ rpc_call_on_trait!(client, call, WorkflowService, start_workflow_execution)
842
+ }
843
+ "StartBatchOperation" => {
844
+ rpc_call_on_trait!(client, call, WorkflowService, start_batch_operation)
845
+ }
846
+ "StopBatchOperation" => {
847
+ rpc_call_on_trait!(client, call, WorkflowService, stop_batch_operation)
848
+ }
849
+ "TerminateWorkflowExecution" => {
850
+ rpc_call_on_trait!(client, call, WorkflowService, terminate_workflow_execution)
851
+ }
852
+ "TriggerWorkflowRule" => {
853
+ rpc_call_on_trait!(client, call, WorkflowService, trigger_workflow_rule)
854
+ }
664
855
  "UnpauseActivity" => {
665
856
  rpc_call_on_trait!(client, call, WorkflowService, unpause_activity)
666
857
  }
@@ -668,21 +859,47 @@ async fn call_workflow_service(
668
859
  rpc_call_on_trait!(client, call, WorkflowService, update_activity_options)
669
860
  }
670
861
  "UpdateNamespace" => rpc_call_on_trait!(client, call, WorkflowService, update_namespace),
671
- "UpdateSchedule" => rpc_call!(client, call, update_schedule),
672
- "UpdateTaskQueueConfig" => rpc_call!(client, call, update_task_queue_config),
673
- "UpdateWorkerConfig" => rpc_call!(client, call, update_worker_config),
862
+ "UpdateSchedule" => rpc_call_on_trait!(client, call, WorkflowService, update_schedule),
863
+ "UpdateTaskQueueConfig" => {
864
+ rpc_call_on_trait!(client, call, WorkflowService, update_task_queue_config)
865
+ }
866
+ "UpdateWorkerConfig" => {
867
+ rpc_call_on_trait!(client, call, WorkflowService, update_worker_config)
868
+ }
674
869
  "UpdateWorkerDeploymentVersionMetadata" => {
675
- rpc_call!(client, call, update_worker_deployment_version_metadata)
870
+ rpc_call_on_trait!(
871
+ client,
872
+ call,
873
+ WorkflowService,
874
+ update_worker_deployment_version_metadata
875
+ )
876
+ }
877
+ "UpdateWorkerVersioningRules" => rpc_call_on_trait!(
878
+ client,
879
+ call,
880
+ WorkflowService,
881
+ update_worker_versioning_rules
882
+ ),
883
+ "UpdateWorkflowExecution" => {
884
+ rpc_call_on_trait!(client, call, WorkflowService, update_workflow_execution)
676
885
  }
677
- "UpdateWorkerVersioningRules" => rpc_call!(client, call, update_worker_versioning_rules),
678
- "UpdateWorkflowExecution" => rpc_call!(client, call, update_workflow_execution),
679
886
  "UpdateWorkflowExecutionOptions" => {
680
- rpc_call!(client, call, update_workflow_execution_options)
887
+ rpc_call_on_trait!(
888
+ client,
889
+ call,
890
+ WorkflowService,
891
+ update_workflow_execution_options
892
+ )
681
893
  }
682
894
  "UpdateWorkerBuildIdCompatibility" => {
683
- rpc_call!(client, call, update_worker_build_id_compatibility)
895
+ rpc_call_on_trait!(
896
+ client,
897
+ call,
898
+ WorkflowService,
899
+ update_worker_build_id_compatibility
900
+ )
684
901
  }
685
- rpc => Err(anyhow::anyhow!("Unknown RPC call {}", rpc)),
902
+ rpc => Err(anyhow::anyhow!("Unknown RPC call {rpc}")),
686
903
  }
687
904
  }
688
905
 
@@ -693,8 +910,12 @@ async fn call_operator_service(
693
910
  let rpc = call.rpc.to_str();
694
911
  let mut client = client.clone();
695
912
  match rpc {
696
- "AddOrUpdateRemoteCluster" => rpc_call!(client, call, add_or_update_remote_cluster),
697
- "AddSearchAttributes" => rpc_call!(client, call, add_search_attributes),
913
+ "AddOrUpdateRemoteCluster" => {
914
+ rpc_call_on_trait!(client, call, OperatorService, add_or_update_remote_cluster)
915
+ }
916
+ "AddSearchAttributes" => {
917
+ rpc_call_on_trait!(client, call, OperatorService, add_search_attributes)
918
+ }
698
919
  "CreateNexusEndpoint" => {
699
920
  rpc_call_on_trait!(client, call, OperatorService, create_nexus_endpoint)
700
921
  }
@@ -702,17 +923,24 @@ async fn call_operator_service(
702
923
  "DeleteNexusEndpoint" => {
703
924
  rpc_call_on_trait!(client, call, OperatorService, delete_nexus_endpoint)
704
925
  }
705
- "DeleteWorkflowExecution" => rpc_call!(client, call, delete_workflow_execution),
706
926
  "GetNexusEndpoint" => rpc_call_on_trait!(client, call, OperatorService, get_nexus_endpoint),
707
- "ListClusters" => rpc_call!(client, call, list_clusters),
708
- "ListNexusEndpoints" => rpc_call!(client, call, list_nexus_endpoints),
709
- "ListSearchAttributes" => rpc_call!(client, call, list_search_attributes),
710
- "RemoveRemoteCluster" => rpc_call!(client, call, remove_remote_cluster),
711
- "RemoveSearchAttributes" => rpc_call!(client, call, remove_search_attributes),
927
+ "ListClusters" => rpc_call_on_trait!(client, call, OperatorService, list_clusters),
928
+ "ListNexusEndpoints" => {
929
+ rpc_call_on_trait!(client, call, OperatorService, list_nexus_endpoints)
930
+ }
931
+ "ListSearchAttributes" => {
932
+ rpc_call_on_trait!(client, call, OperatorService, list_search_attributes)
933
+ }
934
+ "RemoveRemoteCluster" => {
935
+ rpc_call_on_trait!(client, call, OperatorService, remove_remote_cluster)
936
+ }
937
+ "RemoveSearchAttributes" => {
938
+ rpc_call_on_trait!(client, call, OperatorService, remove_search_attributes)
939
+ }
712
940
  "UpdateNexusEndpoint" => {
713
941
  rpc_call_on_trait!(client, call, OperatorService, update_nexus_endpoint)
714
942
  }
715
- rpc => Err(anyhow::anyhow!("Unknown RPC call {}", rpc)),
943
+ rpc => Err(anyhow::anyhow!("Unknown RPC call {rpc}")),
716
944
  }
717
945
  }
718
946
 
@@ -720,69 +948,117 @@ async fn call_cloud_service(client: &CoreClient, call: &RpcCallOptions) -> anyho
720
948
  let rpc = call.rpc.to_str();
721
949
  let mut client = client.clone();
722
950
  match rpc {
723
- "AddNamespaceRegion" => rpc_call!(client, call, add_namespace_region),
724
- "AddUserGroupMember" => rpc_call!(client, call, add_user_group_member),
725
- "CreateApiKey" => rpc_call!(client, call, create_api_key),
726
- "CreateNamespace" => rpc_call!(client, call, create_namespace),
727
- "CreateNamespaceExportSink" => rpc_call!(client, call, create_namespace_export_sink),
951
+ "AddNamespaceRegion" => {
952
+ rpc_call_on_trait!(client, call, CloudService, add_namespace_region)
953
+ }
954
+ "AddUserGroupMember" => {
955
+ rpc_call_on_trait!(client, call, CloudService, add_user_group_member)
956
+ }
957
+ "CreateApiKey" => rpc_call_on_trait!(client, call, CloudService, create_api_key),
958
+ "CreateNamespace" => rpc_call_on_trait!(client, call, CloudService, create_namespace),
959
+ "CreateNamespaceExportSink" => {
960
+ rpc_call_on_trait!(client, call, CloudService, create_namespace_export_sink)
961
+ }
728
962
  "CreateNexusEndpoint" => {
729
963
  rpc_call_on_trait!(client, call, CloudService, create_nexus_endpoint)
730
964
  }
731
- "CreateServiceAccount" => rpc_call!(client, call, create_service_account),
732
- "CreateUserGroup" => rpc_call!(client, call, create_user_group),
733
- "CreateUser" => rpc_call!(client, call, create_user),
734
- "DeleteApiKey" => rpc_call!(client, call, delete_api_key),
965
+ "CreateServiceAccount" => {
966
+ rpc_call_on_trait!(client, call, CloudService, create_service_account)
967
+ }
968
+ "CreateUserGroup" => rpc_call_on_trait!(client, call, CloudService, create_user_group),
969
+ "CreateUser" => rpc_call_on_trait!(client, call, CloudService, create_user),
970
+ "DeleteApiKey" => rpc_call_on_trait!(client, call, CloudService, delete_api_key),
735
971
  "DeleteNamespace" => rpc_call_on_trait!(client, call, CloudService, delete_namespace),
736
- "DeleteNamespaceExportSink" => rpc_call!(client, call, delete_namespace_export_sink),
737
- "DeleteNamespaceRegion" => rpc_call!(client, call, delete_namespace_region),
972
+ "DeleteNamespaceExportSink" => {
973
+ rpc_call_on_trait!(client, call, CloudService, delete_namespace_export_sink)
974
+ }
975
+ "DeleteNamespaceRegion" => {
976
+ rpc_call_on_trait!(client, call, CloudService, delete_namespace_region)
977
+ }
738
978
  "DeleteNexusEndpoint" => {
739
979
  rpc_call_on_trait!(client, call, CloudService, delete_nexus_endpoint)
740
980
  }
741
- "DeleteServiceAccount" => rpc_call!(client, call, delete_service_account),
742
- "DeleteUserGroup" => rpc_call!(client, call, delete_user_group),
743
- "DeleteUser" => rpc_call!(client, call, delete_user),
744
- "FailoverNamespaceRegion" => rpc_call!(client, call, failover_namespace_region),
745
- "GetAccount" => rpc_call!(client, call, get_account),
746
- "GetApiKey" => rpc_call!(client, call, get_api_key),
747
- "GetApiKeys" => rpc_call!(client, call, get_api_keys),
748
- "GetAsyncOperation" => rpc_call!(client, call, get_async_operation),
749
- "GetNamespace" => rpc_call!(client, call, get_namespace),
750
- "GetNamespaceExportSink" => rpc_call!(client, call, get_namespace_export_sink),
751
- "GetNamespaceExportSinks" => rpc_call!(client, call, get_namespace_export_sinks),
752
- "GetNamespaces" => rpc_call!(client, call, get_namespaces),
981
+ "DeleteServiceAccount" => {
982
+ rpc_call_on_trait!(client, call, CloudService, delete_service_account)
983
+ }
984
+ "DeleteUserGroup" => rpc_call_on_trait!(client, call, CloudService, delete_user_group),
985
+ "DeleteUser" => rpc_call_on_trait!(client, call, CloudService, delete_user),
986
+ "FailoverNamespaceRegion" => {
987
+ rpc_call_on_trait!(client, call, CloudService, failover_namespace_region)
988
+ }
989
+ "GetAccount" => rpc_call_on_trait!(client, call, CloudService, get_account),
990
+ "GetApiKey" => rpc_call_on_trait!(client, call, CloudService, get_api_key),
991
+ "GetApiKeys" => rpc_call_on_trait!(client, call, CloudService, get_api_keys),
992
+ "GetAsyncOperation" => rpc_call_on_trait!(client, call, CloudService, get_async_operation),
993
+ "GetNamespace" => rpc_call_on_trait!(client, call, CloudService, get_namespace),
994
+ "GetNamespaceExportSink" => {
995
+ rpc_call_on_trait!(client, call, CloudService, get_namespace_export_sink)
996
+ }
997
+ "GetNamespaceExportSinks" => {
998
+ rpc_call_on_trait!(client, call, CloudService, get_namespace_export_sinks)
999
+ }
1000
+ "GetNamespaces" => rpc_call_on_trait!(client, call, CloudService, get_namespaces),
753
1001
  "GetNexusEndpoint" => rpc_call_on_trait!(client, call, CloudService, get_nexus_endpoint),
754
- "GetNexusEndpoints" => rpc_call!(client, call, get_nexus_endpoints),
755
- "GetRegion" => rpc_call!(client, call, get_region),
756
- "GetRegions" => rpc_call!(client, call, get_regions),
757
- "GetServiceAccount" => rpc_call!(client, call, get_service_account),
758
- "GetServiceAccounts" => rpc_call!(client, call, get_service_accounts),
759
- "GetUsage" => rpc_call!(client, call, get_usage),
760
- "GetUserGroup" => rpc_call!(client, call, get_user_group),
761
- "GetUserGroupMembers" => rpc_call!(client, call, get_user_group_members),
762
- "GetUserGroups" => rpc_call!(client, call, get_user_groups),
763
- "GetUser" => rpc_call!(client, call, get_user),
764
- "GetUsers" => rpc_call!(client, call, get_users),
765
- "RemoveUserGroupMember" => rpc_call!(client, call, remove_user_group_member),
766
- "RenameCustomSearchAttribute" => rpc_call!(client, call, rename_custom_search_attribute),
767
- "SetUserGroupNamespaceAccess" => rpc_call!(client, call, set_user_group_namespace_access),
768
- "SetUserNamespaceAccess" => rpc_call!(client, call, set_user_namespace_access),
769
- "UpdateAccount" => rpc_call!(client, call, update_account),
770
- "UpdateApiKey" => rpc_call!(client, call, update_api_key),
1002
+ "GetNexusEndpoints" => rpc_call_on_trait!(client, call, CloudService, get_nexus_endpoints),
1003
+ "GetRegion" => rpc_call_on_trait!(client, call, CloudService, get_region),
1004
+ "GetRegions" => rpc_call_on_trait!(client, call, CloudService, get_regions),
1005
+ "GetServiceAccount" => rpc_call_on_trait!(client, call, CloudService, get_service_account),
1006
+ "GetServiceAccounts" => {
1007
+ rpc_call_on_trait!(client, call, CloudService, get_service_accounts)
1008
+ }
1009
+ "GetUsage" => rpc_call_on_trait!(client, call, CloudService, get_usage),
1010
+ "GetUserGroup" => rpc_call_on_trait!(client, call, CloudService, get_user_group),
1011
+ "GetUserGroupMembers" => {
1012
+ rpc_call_on_trait!(client, call, CloudService, get_user_group_members)
1013
+ }
1014
+ "GetUserGroups" => rpc_call_on_trait!(client, call, CloudService, get_user_groups),
1015
+ "GetUser" => rpc_call_on_trait!(client, call, CloudService, get_user),
1016
+ "GetUsers" => rpc_call_on_trait!(client, call, CloudService, get_users),
1017
+ "RemoveUserGroupMember" => {
1018
+ rpc_call_on_trait!(client, call, CloudService, remove_user_group_member)
1019
+ }
1020
+ "RenameCustomSearchAttribute" => {
1021
+ rpc_call_on_trait!(client, call, CloudService, rename_custom_search_attribute)
1022
+ }
1023
+ "SetUserGroupNamespaceAccess" => {
1024
+ rpc_call_on_trait!(client, call, CloudService, set_user_group_namespace_access)
1025
+ }
1026
+ "SetUserNamespaceAccess" => {
1027
+ rpc_call_on_trait!(client, call, CloudService, set_user_namespace_access)
1028
+ }
1029
+ "UpdateAccount" => rpc_call_on_trait!(client, call, CloudService, update_account),
1030
+ "UpdateApiKey" => rpc_call_on_trait!(client, call, CloudService, update_api_key),
771
1031
  "UpdateNamespace" => rpc_call_on_trait!(client, call, CloudService, update_namespace),
772
- "UpdateNamespaceExportSink" => rpc_call!(client, call, update_namespace_export_sink),
1032
+ "UpdateNamespaceExportSink" => {
1033
+ rpc_call_on_trait!(client, call, CloudService, update_namespace_export_sink)
1034
+ }
773
1035
  "UpdateNexusEndpoint" => {
774
1036
  rpc_call_on_trait!(client, call, CloudService, update_nexus_endpoint)
775
1037
  }
776
- "UpdateServiceAccount" => rpc_call!(client, call, update_service_account),
777
- "UpdateUserGroup" => rpc_call!(client, call, update_user_group),
778
- "UpdateUser" => rpc_call!(client, call, update_user),
779
- "ValidateNamespaceExportSink" => rpc_call!(client, call, validate_namespace_export_sink),
780
- "UpdateNamespaceTags" => rpc_call!(client, call, update_namespace_tags),
781
- "CreateConnectivityRule" => rpc_call!(client, call, create_connectivity_rule),
782
- "GetConnectivityRule" => rpc_call!(client, call, get_connectivity_rule),
783
- "GetConnectivityRules" => rpc_call!(client, call, get_connectivity_rules),
784
- "DeleteConnectivityRule" => rpc_call!(client, call, delete_connectivity_rule),
785
- rpc => Err(anyhow::anyhow!("Unknown RPC call {}", rpc)),
1038
+ "UpdateServiceAccount" => {
1039
+ rpc_call_on_trait!(client, call, CloudService, update_service_account)
1040
+ }
1041
+ "UpdateUserGroup" => rpc_call_on_trait!(client, call, CloudService, update_user_group),
1042
+ "UpdateUser" => rpc_call_on_trait!(client, call, CloudService, update_user),
1043
+ "ValidateNamespaceExportSink" => {
1044
+ rpc_call_on_trait!(client, call, CloudService, validate_namespace_export_sink)
1045
+ }
1046
+ "UpdateNamespaceTags" => {
1047
+ rpc_call_on_trait!(client, call, CloudService, update_namespace_tags)
1048
+ }
1049
+ "CreateConnectivityRule" => {
1050
+ rpc_call_on_trait!(client, call, CloudService, create_connectivity_rule)
1051
+ }
1052
+ "GetConnectivityRule" => {
1053
+ rpc_call_on_trait!(client, call, CloudService, get_connectivity_rule)
1054
+ }
1055
+ "GetConnectivityRules" => {
1056
+ rpc_call_on_trait!(client, call, CloudService, get_connectivity_rules)
1057
+ }
1058
+ "DeleteConnectivityRule" => {
1059
+ rpc_call_on_trait!(client, call, CloudService, delete_connectivity_rule)
1060
+ }
1061
+ rpc => Err(anyhow::anyhow!("Unknown RPC call {rpc}")),
786
1062
  }
787
1063
  }
788
1064
 
@@ -790,13 +1066,15 @@ async fn call_test_service(client: &CoreClient, call: &RpcCallOptions) -> anyhow
790
1066
  let rpc = call.rpc.to_str();
791
1067
  let mut client = client.clone();
792
1068
  match rpc {
793
- "GetCurrentTime" => rpc_call!(client, call, get_current_time),
794
- "LockTimeSkipping" => rpc_call!(client, call, lock_time_skipping),
795
- "SleepUntil" => rpc_call!(client, call, sleep_until),
796
- "Sleep" => rpc_call!(client, call, sleep),
797
- "UnlockTimeSkippingWithSleep" => rpc_call!(client, call, unlock_time_skipping_with_sleep),
798
- "UnlockTimeSkipping" => rpc_call!(client, call, unlock_time_skipping),
799
- rpc => Err(anyhow::anyhow!("Unknown RPC call {}", rpc)),
1069
+ "GetCurrentTime" => rpc_call_on_trait!(client, call, TestService, get_current_time),
1070
+ "LockTimeSkipping" => rpc_call_on_trait!(client, call, TestService, lock_time_skipping),
1071
+ "SleepUntil" => rpc_call_on_trait!(client, call, TestService, sleep_until),
1072
+ "Sleep" => rpc_call_on_trait!(client, call, TestService, sleep),
1073
+ "UnlockTimeSkippingWithSleep" => {
1074
+ rpc_call_on_trait!(client, call, TestService, unlock_time_skipping_with_sleep)
1075
+ }
1076
+ "UnlockTimeSkipping" => rpc_call_on_trait!(client, call, TestService, unlock_time_skipping),
1077
+ rpc => Err(anyhow::anyhow!("Unknown RPC call {rpc}")),
800
1078
  }
801
1079
  }
802
1080
 
@@ -807,11 +1085,11 @@ async fn call_health_service(
807
1085
  let rpc = call.rpc.to_str();
808
1086
  let mut client = client.clone();
809
1087
  match rpc {
810
- "Check" => rpc_call!(client, call, check),
1088
+ "Check" => rpc_call_on_trait!(client, call, HealthService, check),
811
1089
  "Watch" => Err(anyhow::anyhow!(
812
1090
  "Health service Watch method is not implemented in C bridge"
813
1091
  )),
814
- rpc => Err(anyhow::anyhow!("Unknown RPC call {}", rpc)),
1092
+ rpc => Err(anyhow::anyhow!("Unknown RPC call {rpc}")),
815
1093
  }
816
1094
  }
817
1095