google_cloud_networkconnectivity_v1/
client.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19use crate::Result;
20use std::sync::Arc;
21
22/// Implements a client for the Network Connectivity API.
23///
24/// # Service Description
25///
26/// Network Connectivity Center is a hub-and-spoke abstraction for network
27/// connectivity management in Google Cloud. It reduces operational complexity
28/// through a simple, centralized connectivity management model.
29///
30/// # Configuration
31///
32/// `HubService` has various configuration parameters, the defaults should
33/// work with most applications.
34///
35/// # Pooling and Cloning
36///
37/// `HubService` holds a connection pool internally, it is advised to
38/// create one and the reuse it.  You do not need to wrap `HubService` in
39/// an [Rc](std::rc::Rc) or [Arc] to reuse it, because it already uses an `Arc`
40/// internally.
41#[derive(Clone, Debug)]
42pub struct HubService {
43    inner: Arc<dyn crate::stubs::dynamic::HubService>,
44}
45
46impl HubService {
47    /// Creates a new client with the default configuration.
48    pub async fn new() -> Result<Self> {
49        Self::new_with_config(gax::options::ClientConfig::default()).await
50    }
51
52    /// Creates a new client with the specified configuration.
53    pub async fn new_with_config(conf: gax::options::ClientConfig) -> Result<Self> {
54        let inner = Self::build_inner(conf).await?;
55        Ok(Self { inner })
56    }
57
58    /// Creates a new client from the provided stub.
59    ///
60    /// The most common case for calling this function is when mocking the
61    /// client.
62    pub fn from_stub<T>(stub: T) -> Self
63    where
64        T: crate::stubs::HubService + 'static,
65    {
66        Self {
67            inner: Arc::new(stub),
68        }
69    }
70
71    async fn build_inner(
72        conf: gax::options::ClientConfig,
73    ) -> Result<Arc<dyn crate::stubs::dynamic::HubService>> {
74        if conf.tracing_enabled() {
75            return Ok(Arc::new(Self::build_with_tracing(conf).await?));
76        }
77        Ok(Arc::new(Self::build_transport(conf).await?))
78    }
79
80    async fn build_transport(
81        conf: gax::options::ClientConfig,
82    ) -> Result<impl crate::stubs::HubService> {
83        crate::transport::HubService::new(conf).await
84    }
85
86    async fn build_with_tracing(
87        conf: gax::options::ClientConfig,
88    ) -> Result<impl crate::stubs::HubService> {
89        Self::build_transport(conf)
90            .await
91            .map(crate::tracing::HubService::new)
92    }
93
94    /// Lists the Network Connectivity Center hubs associated with a given project.
95    pub fn list_hubs(
96        &self,
97        parent: impl Into<std::string::String>,
98    ) -> crate::builders::hub_service::ListHubs {
99        crate::builders::hub_service::ListHubs::new(self.inner.clone()).set_parent(parent.into())
100    }
101
102    /// Gets details about a Network Connectivity Center hub.
103    pub fn get_hub(
104        &self,
105        name: impl Into<std::string::String>,
106    ) -> crate::builders::hub_service::GetHub {
107        crate::builders::hub_service::GetHub::new(self.inner.clone()).set_name(name.into())
108    }
109
110    /// Creates a new Network Connectivity Center hub in the specified project.
111    ///
112    /// # Long running operations
113    ///
114    /// This method is used to start, and/or poll a [long-running Operation].
115    /// The [Working with long-running operations] chapter in the [user guide]
116    /// covers these operations in detail.
117    ///
118    /// [long-running operation]: https://google.aip.dev/151
119    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
120    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
121    pub fn create_hub(
122        &self,
123        parent: impl Into<std::string::String>,
124    ) -> crate::builders::hub_service::CreateHub {
125        crate::builders::hub_service::CreateHub::new(self.inner.clone()).set_parent(parent.into())
126    }
127
128    /// Updates the description and/or labels of a Network Connectivity Center
129    /// hub.
130    ///
131    /// # Long running operations
132    ///
133    /// This method is used to start, and/or poll a [long-running Operation].
134    /// The [Working with long-running operations] chapter in the [user guide]
135    /// covers these operations in detail.
136    ///
137    /// [long-running operation]: https://google.aip.dev/151
138    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
139    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
140    pub fn update_hub(
141        &self,
142        hub: impl Into<crate::model::Hub>,
143    ) -> crate::builders::hub_service::UpdateHub {
144        crate::builders::hub_service::UpdateHub::new(self.inner.clone()).set_hub(hub.into())
145    }
146
147    /// Deletes a Network Connectivity Center hub.
148    ///
149    /// # Long running operations
150    ///
151    /// This method is used to start, and/or poll a [long-running Operation].
152    /// The [Working with long-running operations] chapter in the [user guide]
153    /// covers these operations in detail.
154    ///
155    /// [long-running operation]: https://google.aip.dev/151
156    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
157    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
158    pub fn delete_hub(
159        &self,
160        name: impl Into<std::string::String>,
161    ) -> crate::builders::hub_service::DeleteHub {
162        crate::builders::hub_service::DeleteHub::new(self.inner.clone()).set_name(name.into())
163    }
164
165    /// Lists the Network Connectivity Center spokes associated with a
166    /// specified hub and location. The list includes both spokes that are attached
167    /// to the hub and spokes that have been proposed but not yet accepted.
168    pub fn list_hub_spokes(
169        &self,
170        name: impl Into<std::string::String>,
171    ) -> crate::builders::hub_service::ListHubSpokes {
172        crate::builders::hub_service::ListHubSpokes::new(self.inner.clone()).set_name(name.into())
173    }
174
175    /// Query the Private Service Connect propagation status of a Network
176    /// Connectivity Center hub.
177    pub fn query_hub_status(
178        &self,
179        name: impl Into<std::string::String>,
180    ) -> crate::builders::hub_service::QueryHubStatus {
181        crate::builders::hub_service::QueryHubStatus::new(self.inner.clone()).set_name(name.into())
182    }
183
184    /// Lists the Network Connectivity Center spokes in a specified project and
185    /// location.
186    pub fn list_spokes(
187        &self,
188        parent: impl Into<std::string::String>,
189    ) -> crate::builders::hub_service::ListSpokes {
190        crate::builders::hub_service::ListSpokes::new(self.inner.clone()).set_parent(parent.into())
191    }
192
193    /// Gets details about a Network Connectivity Center spoke.
194    pub fn get_spoke(
195        &self,
196        name: impl Into<std::string::String>,
197    ) -> crate::builders::hub_service::GetSpoke {
198        crate::builders::hub_service::GetSpoke::new(self.inner.clone()).set_name(name.into())
199    }
200
201    /// Creates a Network Connectivity Center spoke.
202    ///
203    /// # Long running operations
204    ///
205    /// This method is used to start, and/or poll a [long-running Operation].
206    /// The [Working with long-running operations] chapter in the [user guide]
207    /// covers these operations in detail.
208    ///
209    /// [long-running operation]: https://google.aip.dev/151
210    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
211    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
212    pub fn create_spoke(
213        &self,
214        parent: impl Into<std::string::String>,
215    ) -> crate::builders::hub_service::CreateSpoke {
216        crate::builders::hub_service::CreateSpoke::new(self.inner.clone()).set_parent(parent.into())
217    }
218
219    /// Updates the parameters of a Network Connectivity Center spoke.
220    ///
221    /// # Long running operations
222    ///
223    /// This method is used to start, and/or poll a [long-running Operation].
224    /// The [Working with long-running operations] chapter in the [user guide]
225    /// covers these operations in detail.
226    ///
227    /// [long-running operation]: https://google.aip.dev/151
228    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
229    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
230    pub fn update_spoke(
231        &self,
232        spoke: impl Into<crate::model::Spoke>,
233    ) -> crate::builders::hub_service::UpdateSpoke {
234        crate::builders::hub_service::UpdateSpoke::new(self.inner.clone()).set_spoke(spoke.into())
235    }
236
237    /// Rejects a Network Connectivity Center spoke from being attached to a hub.
238    /// If the spoke was previously in the `ACTIVE` state, it
239    /// transitions to the `INACTIVE` state and is no longer able to
240    /// connect to other spokes that are attached to the hub.
241    ///
242    /// # Long running operations
243    ///
244    /// This method is used to start, and/or poll a [long-running Operation].
245    /// The [Working with long-running operations] chapter in the [user guide]
246    /// covers these operations in detail.
247    ///
248    /// [long-running operation]: https://google.aip.dev/151
249    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
250    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
251    pub fn reject_hub_spoke(
252        &self,
253        name: impl Into<std::string::String>,
254    ) -> crate::builders::hub_service::RejectHubSpoke {
255        crate::builders::hub_service::RejectHubSpoke::new(self.inner.clone()).set_name(name.into())
256    }
257
258    /// Accepts a proposal to attach a Network Connectivity Center spoke
259    /// to a hub.
260    ///
261    /// # Long running operations
262    ///
263    /// This method is used to start, and/or poll a [long-running Operation].
264    /// The [Working with long-running operations] chapter in the [user guide]
265    /// covers these operations in detail.
266    ///
267    /// [long-running operation]: https://google.aip.dev/151
268    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
269    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
270    pub fn accept_hub_spoke(
271        &self,
272        name: impl Into<std::string::String>,
273    ) -> crate::builders::hub_service::AcceptHubSpoke {
274        crate::builders::hub_service::AcceptHubSpoke::new(self.inner.clone()).set_name(name.into())
275    }
276
277    /// Deletes a Network Connectivity Center spoke.
278    ///
279    /// # Long running operations
280    ///
281    /// This method is used to start, and/or poll a [long-running Operation].
282    /// The [Working with long-running operations] chapter in the [user guide]
283    /// covers these operations in detail.
284    ///
285    /// [long-running operation]: https://google.aip.dev/151
286    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
287    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
288    pub fn delete_spoke(
289        &self,
290        name: impl Into<std::string::String>,
291    ) -> crate::builders::hub_service::DeleteSpoke {
292        crate::builders::hub_service::DeleteSpoke::new(self.inner.clone()).set_name(name.into())
293    }
294
295    /// Gets details about a Network Connectivity Center route table.
296    pub fn get_route_table(
297        &self,
298        name: impl Into<std::string::String>,
299    ) -> crate::builders::hub_service::GetRouteTable {
300        crate::builders::hub_service::GetRouteTable::new(self.inner.clone()).set_name(name.into())
301    }
302
303    /// Gets details about the specified route.
304    pub fn get_route(
305        &self,
306        name: impl Into<std::string::String>,
307    ) -> crate::builders::hub_service::GetRoute {
308        crate::builders::hub_service::GetRoute::new(self.inner.clone()).set_name(name.into())
309    }
310
311    /// Lists routes in a given route table.
312    pub fn list_routes(
313        &self,
314        parent: impl Into<std::string::String>,
315    ) -> crate::builders::hub_service::ListRoutes {
316        crate::builders::hub_service::ListRoutes::new(self.inner.clone()).set_parent(parent.into())
317    }
318
319    /// Lists route tables in a given hub.
320    pub fn list_route_tables(
321        &self,
322        parent: impl Into<std::string::String>,
323    ) -> crate::builders::hub_service::ListRouteTables {
324        crate::builders::hub_service::ListRouteTables::new(self.inner.clone())
325            .set_parent(parent.into())
326    }
327
328    /// Gets details about a Network Connectivity Center group.
329    pub fn get_group(
330        &self,
331        name: impl Into<std::string::String>,
332    ) -> crate::builders::hub_service::GetGroup {
333        crate::builders::hub_service::GetGroup::new(self.inner.clone()).set_name(name.into())
334    }
335
336    /// Lists groups in a given hub.
337    pub fn list_groups(
338        &self,
339        parent: impl Into<std::string::String>,
340    ) -> crate::builders::hub_service::ListGroups {
341        crate::builders::hub_service::ListGroups::new(self.inner.clone()).set_parent(parent.into())
342    }
343
344    /// Updates the parameters of a Network Connectivity Center group.
345    ///
346    /// # Long running operations
347    ///
348    /// This method is used to start, and/or poll a [long-running Operation].
349    /// The [Working with long-running operations] chapter in the [user guide]
350    /// covers these operations in detail.
351    ///
352    /// [long-running operation]: https://google.aip.dev/151
353    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
354    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
355    pub fn update_group(
356        &self,
357        group: impl Into<crate::model::Group>,
358    ) -> crate::builders::hub_service::UpdateGroup {
359        crate::builders::hub_service::UpdateGroup::new(self.inner.clone()).set_group(group.into())
360    }
361
362    /// Lists information about the supported locations for this service.
363    pub fn list_locations(
364        &self,
365        name: impl Into<std::string::String>,
366    ) -> crate::builders::hub_service::ListLocations {
367        crate::builders::hub_service::ListLocations::new(self.inner.clone()).set_name(name.into())
368    }
369
370    /// Gets information about a location.
371    pub fn get_location(
372        &self,
373        name: impl Into<std::string::String>,
374    ) -> crate::builders::hub_service::GetLocation {
375        crate::builders::hub_service::GetLocation::new(self.inner.clone()).set_name(name.into())
376    }
377
378    /// Sets the access control policy on the specified resource. Replaces
379    /// any existing policy.
380    ///
381    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
382    /// errors.
383    pub fn set_iam_policy(
384        &self,
385        resource: impl Into<std::string::String>,
386    ) -> crate::builders::hub_service::SetIamPolicy {
387        crate::builders::hub_service::SetIamPolicy::new(self.inner.clone())
388            .set_resource(resource.into())
389    }
390
391    /// Gets the access control policy for a resource. Returns an empty policy
392    /// if the resource exists and does not have a policy set.
393    pub fn get_iam_policy(
394        &self,
395        resource: impl Into<std::string::String>,
396    ) -> crate::builders::hub_service::GetIamPolicy {
397        crate::builders::hub_service::GetIamPolicy::new(self.inner.clone())
398            .set_resource(resource.into())
399    }
400
401    /// Returns permissions that a caller has on the specified resource. If the
402    /// resource does not exist, this will return an empty set of
403    /// permissions, not a `NOT_FOUND` error.
404    ///
405    /// Note: This operation is designed to be used for building
406    /// permission-aware UIs and command-line tools, not for authorization
407    /// checking. This operation may "fail open" without warning.
408    pub fn test_iam_permissions(
409        &self,
410        resource: impl Into<std::string::String>,
411    ) -> crate::builders::hub_service::TestIamPermissions {
412        crate::builders::hub_service::TestIamPermissions::new(self.inner.clone())
413            .set_resource(resource.into())
414    }
415
416    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
417    ///
418    /// [google.longrunning.Operations]: longrunning::client::Operations
419    pub fn list_operations(
420        &self,
421        name: impl Into<std::string::String>,
422    ) -> crate::builders::hub_service::ListOperations {
423        crate::builders::hub_service::ListOperations::new(self.inner.clone()).set_name(name.into())
424    }
425
426    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
427    ///
428    /// [google.longrunning.Operations]: longrunning::client::Operations
429    pub fn get_operation(
430        &self,
431        name: impl Into<std::string::String>,
432    ) -> crate::builders::hub_service::GetOperation {
433        crate::builders::hub_service::GetOperation::new(self.inner.clone()).set_name(name.into())
434    }
435
436    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
437    ///
438    /// [google.longrunning.Operations]: longrunning::client::Operations
439    pub fn delete_operation(
440        &self,
441        name: impl Into<std::string::String>,
442    ) -> crate::builders::hub_service::DeleteOperation {
443        crate::builders::hub_service::DeleteOperation::new(self.inner.clone()).set_name(name.into())
444    }
445
446    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
447    ///
448    /// [google.longrunning.Operations]: longrunning::client::Operations
449    pub fn cancel_operation(
450        &self,
451        name: impl Into<std::string::String>,
452    ) -> crate::builders::hub_service::CancelOperation {
453        crate::builders::hub_service::CancelOperation::new(self.inner.clone()).set_name(name.into())
454    }
455}
456
457/// Implements a client for the Network Connectivity API.
458///
459/// # Service Description
460///
461/// Policy-Based Routing allows GCP customers to specify flexibile routing
462/// policies for Layer 4 traffic traversing through the connected service.
463///
464/// # Configuration
465///
466/// `PolicyBasedRoutingService` has various configuration parameters, the defaults should
467/// work with most applications.
468///
469/// # Pooling and Cloning
470///
471/// `PolicyBasedRoutingService` holds a connection pool internally, it is advised to
472/// create one and the reuse it.  You do not need to wrap `PolicyBasedRoutingService` in
473/// an [Rc](std::rc::Rc) or [Arc] to reuse it, because it already uses an `Arc`
474/// internally.
475#[derive(Clone, Debug)]
476pub struct PolicyBasedRoutingService {
477    inner: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>,
478}
479
480impl PolicyBasedRoutingService {
481    /// Creates a new client with the default configuration.
482    pub async fn new() -> Result<Self> {
483        Self::new_with_config(gax::options::ClientConfig::default()).await
484    }
485
486    /// Creates a new client with the specified configuration.
487    pub async fn new_with_config(conf: gax::options::ClientConfig) -> Result<Self> {
488        let inner = Self::build_inner(conf).await?;
489        Ok(Self { inner })
490    }
491
492    /// Creates a new client from the provided stub.
493    ///
494    /// The most common case for calling this function is when mocking the
495    /// client.
496    pub fn from_stub<T>(stub: T) -> Self
497    where
498        T: crate::stubs::PolicyBasedRoutingService + 'static,
499    {
500        Self {
501            inner: Arc::new(stub),
502        }
503    }
504
505    async fn build_inner(
506        conf: gax::options::ClientConfig,
507    ) -> Result<Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>> {
508        if conf.tracing_enabled() {
509            return Ok(Arc::new(Self::build_with_tracing(conf).await?));
510        }
511        Ok(Arc::new(Self::build_transport(conf).await?))
512    }
513
514    async fn build_transport(
515        conf: gax::options::ClientConfig,
516    ) -> Result<impl crate::stubs::PolicyBasedRoutingService> {
517        crate::transport::PolicyBasedRoutingService::new(conf).await
518    }
519
520    async fn build_with_tracing(
521        conf: gax::options::ClientConfig,
522    ) -> Result<impl crate::stubs::PolicyBasedRoutingService> {
523        Self::build_transport(conf)
524            .await
525            .map(crate::tracing::PolicyBasedRoutingService::new)
526    }
527
528    /// Lists PolicyBasedRoutes in a given project and location.
529    pub fn list_policy_based_routes(
530        &self,
531        parent: impl Into<std::string::String>,
532    ) -> crate::builders::policy_based_routing_service::ListPolicyBasedRoutes {
533        crate::builders::policy_based_routing_service::ListPolicyBasedRoutes::new(
534            self.inner.clone(),
535        )
536        .set_parent(parent.into())
537    }
538
539    /// Gets details of a single PolicyBasedRoute.
540    pub fn get_policy_based_route(
541        &self,
542        name: impl Into<std::string::String>,
543    ) -> crate::builders::policy_based_routing_service::GetPolicyBasedRoute {
544        crate::builders::policy_based_routing_service::GetPolicyBasedRoute::new(self.inner.clone())
545            .set_name(name.into())
546    }
547
548    /// Creates a new PolicyBasedRoute in a given project and location.
549    ///
550    /// # Long running operations
551    ///
552    /// This method is used to start, and/or poll a [long-running Operation].
553    /// The [Working with long-running operations] chapter in the [user guide]
554    /// covers these operations in detail.
555    ///
556    /// [long-running operation]: https://google.aip.dev/151
557    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
558    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
559    pub fn create_policy_based_route(
560        &self,
561        parent: impl Into<std::string::String>,
562    ) -> crate::builders::policy_based_routing_service::CreatePolicyBasedRoute {
563        crate::builders::policy_based_routing_service::CreatePolicyBasedRoute::new(
564            self.inner.clone(),
565        )
566        .set_parent(parent.into())
567    }
568
569    /// Deletes a single PolicyBasedRoute.
570    ///
571    /// # Long running operations
572    ///
573    /// This method is used to start, and/or poll a [long-running Operation].
574    /// The [Working with long-running operations] chapter in the [user guide]
575    /// covers these operations in detail.
576    ///
577    /// [long-running operation]: https://google.aip.dev/151
578    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
579    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
580    pub fn delete_policy_based_route(
581        &self,
582        name: impl Into<std::string::String>,
583    ) -> crate::builders::policy_based_routing_service::DeletePolicyBasedRoute {
584        crate::builders::policy_based_routing_service::DeletePolicyBasedRoute::new(
585            self.inner.clone(),
586        )
587        .set_name(name.into())
588    }
589
590    /// Lists information about the supported locations for this service.
591    pub fn list_locations(
592        &self,
593        name: impl Into<std::string::String>,
594    ) -> crate::builders::policy_based_routing_service::ListLocations {
595        crate::builders::policy_based_routing_service::ListLocations::new(self.inner.clone())
596            .set_name(name.into())
597    }
598
599    /// Gets information about a location.
600    pub fn get_location(
601        &self,
602        name: impl Into<std::string::String>,
603    ) -> crate::builders::policy_based_routing_service::GetLocation {
604        crate::builders::policy_based_routing_service::GetLocation::new(self.inner.clone())
605            .set_name(name.into())
606    }
607
608    /// Sets the access control policy on the specified resource. Replaces
609    /// any existing policy.
610    ///
611    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
612    /// errors.
613    pub fn set_iam_policy(
614        &self,
615        resource: impl Into<std::string::String>,
616    ) -> crate::builders::policy_based_routing_service::SetIamPolicy {
617        crate::builders::policy_based_routing_service::SetIamPolicy::new(self.inner.clone())
618            .set_resource(resource.into())
619    }
620
621    /// Gets the access control policy for a resource. Returns an empty policy
622    /// if the resource exists and does not have a policy set.
623    pub fn get_iam_policy(
624        &self,
625        resource: impl Into<std::string::String>,
626    ) -> crate::builders::policy_based_routing_service::GetIamPolicy {
627        crate::builders::policy_based_routing_service::GetIamPolicy::new(self.inner.clone())
628            .set_resource(resource.into())
629    }
630
631    /// Returns permissions that a caller has on the specified resource. If the
632    /// resource does not exist, this will return an empty set of
633    /// permissions, not a `NOT_FOUND` error.
634    ///
635    /// Note: This operation is designed to be used for building
636    /// permission-aware UIs and command-line tools, not for authorization
637    /// checking. This operation may "fail open" without warning.
638    pub fn test_iam_permissions(
639        &self,
640        resource: impl Into<std::string::String>,
641    ) -> crate::builders::policy_based_routing_service::TestIamPermissions {
642        crate::builders::policy_based_routing_service::TestIamPermissions::new(self.inner.clone())
643            .set_resource(resource.into())
644    }
645
646    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
647    ///
648    /// [google.longrunning.Operations]: longrunning::client::Operations
649    pub fn list_operations(
650        &self,
651        name: impl Into<std::string::String>,
652    ) -> crate::builders::policy_based_routing_service::ListOperations {
653        crate::builders::policy_based_routing_service::ListOperations::new(self.inner.clone())
654            .set_name(name.into())
655    }
656
657    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
658    ///
659    /// [google.longrunning.Operations]: longrunning::client::Operations
660    pub fn get_operation(
661        &self,
662        name: impl Into<std::string::String>,
663    ) -> crate::builders::policy_based_routing_service::GetOperation {
664        crate::builders::policy_based_routing_service::GetOperation::new(self.inner.clone())
665            .set_name(name.into())
666    }
667
668    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
669    ///
670    /// [google.longrunning.Operations]: longrunning::client::Operations
671    pub fn delete_operation(
672        &self,
673        name: impl Into<std::string::String>,
674    ) -> crate::builders::policy_based_routing_service::DeleteOperation {
675        crate::builders::policy_based_routing_service::DeleteOperation::new(self.inner.clone())
676            .set_name(name.into())
677    }
678
679    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
680    ///
681    /// [google.longrunning.Operations]: longrunning::client::Operations
682    pub fn cancel_operation(
683        &self,
684        name: impl Into<std::string::String>,
685    ) -> crate::builders::policy_based_routing_service::CancelOperation {
686        crate::builders::policy_based_routing_service::CancelOperation::new(self.inner.clone())
687            .set_name(name.into())
688    }
689}