1313// limitations under the License.
1414
1515use anyhow:: Result ;
16- use gax:: exponential_backoff:: { ExponentialBackoff , ExponentialBackoffBuilder } ;
17- use gax:: options:: RequestOptionsBuilder ;
18- use gax:: paginator:: ItemPaginator as _;
19- use gax:: retry_policy:: { AlwaysRetry , RetryPolicyExt } ;
16+ use google_cloud_gax:: exponential_backoff:: { ExponentialBackoff , ExponentialBackoffBuilder } ;
17+ use google_cloud_gax:: options:: RequestOptionsBuilder ;
18+ use google_cloud_gax:: paginator:: ItemPaginator as _;
19+ use google_cloud_gax:: retry_policy:: { AlwaysRetry , RetryPolicyExt } ;
20+ use google_cloud_lro:: Poller ;
21+ use google_cloud_test_utils:: resource_names:: random_workflow_id;
2022use google_cloud_test_utils:: runtime_config:: { project_id, region_id, test_service_account} ;
21- use lro:: Poller ;
23+ use google_cloud_workflows_executions_v1:: {
24+ client:: Executions , model:: Execution , model:: ExecutionView ,
25+ } ;
26+ use google_cloud_workflows_v1:: { client:: Workflows , model:: Workflow , model:: workflow:: SourceCode } ;
2227use std:: time:: Duration ;
2328
2429// Verify enum query parameters are serialized correctly.
25- pub async fn list ( ) -> Result < ( ) > {
30+ pub async fn run ( ) -> Result < ( ) > {
2631 // Create a workflow so we can list its executions. We rely on the other
2732 // workflows integration tests to delete it if something fails or crashes
2833 // in this test.
2934 let parent = create_test_workflow ( ) . await ?;
30- let client = wfe:: client:: Executions :: builder ( )
31- . with_tracing ( )
32- . build ( )
33- . await ?;
35+ let client = Executions :: builder ( ) . with_tracing ( ) . build ( ) . await ?;
3436
3537 // Create an execution with a label. The label is not returned for the `BASIC` view.
3638 let start = client
3739 . create_execution ( )
3840 . set_parent ( & parent)
39- . set_execution ( wfe :: model :: Execution :: new ( ) . set_labels ( [ ( "test-label" , "test-value" ) ] ) )
41+ . set_execution ( Execution :: new ( ) . set_labels ( [ ( "test-label" , "test-value" ) ] ) )
4042 . send ( )
4143 . await ?;
4244 tracing:: info!( "start was successful={start:?}" ) ;
@@ -45,7 +47,7 @@ pub async fn list() -> Result<()> {
4547 let mut executions = client
4648 . list_executions ( )
4749 . set_parent ( & parent)
48- . set_view ( wfe :: model :: ExecutionView :: Basic )
50+ . set_view ( ExecutionView :: Basic )
4951 . by_item ( ) ;
5052
5153 while let Some ( execution) = executions. next ( ) . await {
@@ -58,7 +60,7 @@ pub async fn list() -> Result<()> {
5860 let mut executions = client
5961 . list_executions ( )
6062 . set_parent ( & parent)
61- . set_view ( wfe :: model :: ExecutionView :: Full )
63+ . set_view ( ExecutionView :: Full )
6264 . by_item ( ) ;
6365
6466 while let Some ( execution) = executions. next ( ) . await {
@@ -93,16 +95,16 @@ main:
9395 - sayHello:
9496 return: Hello World
9597"### ;
96- let source_code = wf :: model :: workflow :: SourceCode :: SourceContents ( source_contents. to_string ( ) ) ;
97- let workflow_id = crate :: random_workflow_id ( ) ;
98+ let source_code = SourceCode :: SourceContents ( source_contents. to_string ( ) ) ;
99+ let workflow_id = random_workflow_id ( ) ;
98100
99101 tracing:: info!( "Start create_workflow() LRO and poll it to completion" ) ;
100102 let response = client
101103 . create_workflow ( )
102104 . set_parent ( format ! ( "projects/{project_id}/locations/{location_id}" ) )
103105 . set_workflow_id ( & workflow_id)
104106 . set_workflow (
105- wf :: model :: Workflow :: new ( )
107+ Workflow :: new ( )
106108 . set_labels ( [ ( "integration-test" , "true" ) ] )
107109 . set_service_account ( & workflows_runner)
108110 . set_source_code ( source_code) ,
@@ -116,8 +118,8 @@ main:
116118 Ok ( response. name )
117119}
118120
119- async fn workflow_client ( ) -> Result < wf :: client :: Workflows > {
120- let client = wf :: client :: Workflows :: builder ( )
121+ async fn workflow_client ( ) -> Result < Workflows > {
122+ let client = Workflows :: builder ( )
121123 . with_retry_policy (
122124 AlwaysRetry
123125 . with_time_limit ( Duration :: from_secs ( 15 ) )
0 commit comments