@@ -59,7 +59,7 @@ pub async fn sandbox_provider_list(
5959 let response = client
6060 . list_sandbox_providers ( ListSandboxProvidersRequest {
6161 sandbox_name : name. to_string ( ) ,
62- workspace : workspace . to_string ( ) ,
62+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
6363 } )
6464 . await
6565 . into_diagnostic ( ) ?;
@@ -91,7 +91,7 @@ pub async fn sandbox_provider_attach(
9191 let sandbox = client
9292 . get_sandbox ( GetSandboxRequest {
9393 name : name. to_string ( ) ,
94- workspace : workspace . to_string ( ) ,
94+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
9595 } )
9696 . await
9797 . into_diagnostic ( ) ?
@@ -106,7 +106,7 @@ pub async fn sandbox_provider_attach(
106106 sandbox_name : name. to_string ( ) ,
107107 provider_name : provider. to_string ( ) ,
108108 expected_resource_version : resource_version,
109- workspace : workspace . to_string ( ) ,
109+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
110110 } )
111111 . await
112112 {
@@ -147,7 +147,7 @@ pub async fn sandbox_provider_detach(
147147 let sandbox = client
148148 . get_sandbox ( GetSandboxRequest {
149149 name : name. to_string ( ) ,
150- workspace : workspace . to_string ( ) ,
150+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
151151 } )
152152 . await
153153 . into_diagnostic ( ) ?
@@ -162,7 +162,7 @@ pub async fn sandbox_provider_detach(
162162 sandbox_name : name. to_string ( ) ,
163163 provider_name : provider. to_string ( ) ,
164164 expected_resource_version : resource_version,
165- workspace : workspace . to_string ( ) ,
165+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
166166 } )
167167 . await
168168 {
@@ -305,8 +305,7 @@ pub async fn ensure_required_providers(
305305 . list_providers ( ListProvidersRequest {
306306 limit,
307307 offset,
308- workspace : workspace. to_string ( ) ,
309- all_workspaces : false ,
308+ workspace_scope : Some ( openshell_core:: proto:: workspace_selector ( workspace) ) ,
310309 } )
311310 . await
312311 . into_diagnostic ( ) ?;
@@ -490,7 +489,7 @@ async fn auto_create_provider(
490489 profile_workspace : workspace. to_string ( ) ,
491490 credential_handles : HashMap :: new ( ) ,
492491 } ) ,
493- workspace : workspace . to_string ( ) ,
492+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
494493 } ;
495494
496495 let response = client. create_provider ( request) . await . map_err ( |status| {
@@ -538,7 +537,7 @@ async fn auto_create_provider(
538537 profile_workspace : workspace. to_string ( ) ,
539538 credential_handles : HashMap :: new ( ) ,
540539 } ) ,
541- workspace : workspace . to_string ( ) ,
540+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
542541 } ;
543542
544543 match client. create_provider ( request) . await {
@@ -672,7 +671,7 @@ async fn rollback_provider_create_after_gcloud_adc_failure(
672671 match client
673672 . delete_provider ( DeleteProviderRequest {
674673 name : provider_name. to_string ( ) ,
675- workspace : workspace . to_string ( ) ,
674+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
676675 } )
677676 . await
678677 {
@@ -1119,7 +1118,7 @@ pub async fn provider_create_with_options(options: ProviderCreateOptions<'_>) ->
11191118 profile_workspace : profile_workspace. to_string ( ) ,
11201119 credential_handles : HashMap :: new ( ) ,
11211120 } ) ,
1122- workspace : workspace . to_string ( ) ,
1121+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
11231122 } )
11241123 . await
11251124 . into_diagnostic ( ) ?;
@@ -1149,7 +1148,7 @@ pub async fn provider_create_with_options(options: ProviderCreateOptions<'_>) ->
11491148 "refresh_token" . to_string( ) ,
11501149 ] ,
11511150 expires_at_ms : None ,
1152- workspace : workspace . to_string ( ) ,
1151+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
11531152 } )
11541153 . await
11551154 {
@@ -1167,7 +1166,7 @@ pub async fn provider_create_with_options(options: ProviderCreateOptions<'_>) ->
11671166 . rotate_provider_credential ( RotateProviderCredentialRequest {
11681167 provider : provider_name. clone ( ) ,
11691168 credential_key : adc_credential_key,
1170- workspace : workspace . to_string ( ) ,
1169+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
11711170 } )
11721171 . await
11731172 {
@@ -1208,7 +1207,7 @@ pub async fn provider_get(
12081207 let response = client
12091208 . get_provider ( GetProviderRequest {
12101209 name : name. to_string ( ) ,
1211- workspace : workspace . to_string ( ) ,
1210+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
12121211 } )
12131212 . await
12141213 . into_diagnostic ( ) ?;
@@ -1339,12 +1338,11 @@ pub async fn provider_list(
13391338 . list_providers ( ListProvidersRequest {
13401339 limit,
13411340 offset,
1342- workspace : if all_workspaces {
1343- String :: new ( )
1341+ workspace_scope : Some ( if all_workspaces {
1342+ openshell_core :: proto :: all_workspaces_selector ( )
13441343 } else {
1345- workspace. to_string ( )
1346- } ,
1347- all_workspaces,
1344+ openshell_core:: proto:: workspace_selector ( workspace)
1345+ } ) ,
13481346 } )
13491347 . await
13501348 . into_diagnostic ( ) ?;
@@ -1713,7 +1711,7 @@ pub async fn provider_refresh_status(
17131711 . get_provider_refresh_status ( GetProviderRefreshStatusRequest {
17141712 provider : name. to_string ( ) ,
17151713 credential_key : credential_key. unwrap_or_default ( ) . to_string ( ) ,
1716- workspace : workspace . to_string ( ) ,
1714+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
17171715 } )
17181716 . await
17191717 . into_diagnostic ( ) ?
@@ -1794,7 +1792,7 @@ pub async fn provider_refresh_config(
17941792 material,
17951793 secret_material_keys,
17961794 expires_at_ms : input. credential_expires_at_ms ,
1797- workspace : workspace . to_string ( ) ,
1795+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
17981796 } )
17991797 . await
18001798 . into_diagnostic ( ) ?
@@ -1823,7 +1821,7 @@ pub async fn provider_rotate(
18231821 . rotate_provider_credential ( RotateProviderCredentialRequest {
18241822 provider : name. to_string ( ) ,
18251823 credential_key : credential_key. to_string ( ) ,
1826- workspace : workspace . to_string ( ) ,
1824+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
18271825 } )
18281826 . await
18291827 . into_diagnostic ( ) ?
@@ -1860,7 +1858,7 @@ pub async fn provider_refresh_delete(
18601858 . delete_provider_refresh ( DeleteProviderRefreshRequest {
18611859 provider : name. to_string ( ) ,
18621860 credential_key : credential_key. to_string ( ) ,
1863- workspace : workspace . to_string ( ) ,
1861+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
18641862 } )
18651863 . await
18661864 . into_diagnostic ( ) ?
@@ -2236,7 +2234,7 @@ pub async fn provider_update(options: ProviderUpdateOptions<'_>) -> Result<()> {
22362234 let existing = match client
22372235 . get_provider ( GetProviderRequest {
22382236 name : name. to_string ( ) ,
2239- workspace : workspace . to_string ( ) ,
2237+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
22402238 } )
22412239 . await
22422240 {
@@ -2319,7 +2317,7 @@ pub async fn provider_update(options: ProviderUpdateOptions<'_>) -> Result<()> {
23192317 credential_handles : HashMap :: new ( ) ,
23202318 } ) ,
23212319 credential_expires_at_ms,
2322- workspace : workspace . to_string ( ) ,
2320+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
23232321 } )
23242322 . await
23252323 . into_diagnostic ( ) ?;
@@ -2349,7 +2347,7 @@ pub async fn provider_delete(
23492347 let response = match client
23502348 . delete_provider ( DeleteProviderRequest {
23512349 name : name. clone ( ) ,
2352- workspace : workspace . to_string ( ) ,
2350+ workspace_scope : Some ( openshell_core :: proto :: workspace_selector ( workspace ) ) ,
23532351 } )
23542352 . await
23552353 {
0 commit comments