google_cloud_privilegedaccessmanager_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
19/// Implements a client for the Privileged Access Manager API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// async fn sample(
26/// project_id: &str,
27/// location_id: &str,
28/// ) -> anyhow::Result<()> {
29/// let client = PrivilegedAccessManager::builder().build().await?;
30/// let mut list = client.list_entitlements()
31/// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
32/// .by_item();
33/// while let Some(item) = list.next().await.transpose()? {
34/// println!("{:?}", item);
35/// }
36/// Ok(())
37/// }
38/// ```
39///
40/// # Service Description
41///
42/// This API allows customers to manage temporary, request based privileged
43/// access to their resources.
44///
45/// It defines the following resource model:
46///
47/// * A collection of `Entitlement` resources. An entitlement allows configuring
48/// (among other things):
49///
50/// * Some kind of privileged access that users can request.
51/// * A set of users called _requesters_ who can request this access.
52/// * A maximum duration for which the access can be requested.
53/// * An optional approval workflow which must be satisfied before access is
54/// granted.
55/// * A collection of `Grant` resources. A grant is a request by a requester to
56/// get the privileged access specified in an entitlement for some duration.
57///
58/// After the approval workflow as specified in the entitlement is satisfied,
59/// the specified access is given to the requester. The access is automatically
60/// taken back after the requested duration is over.
61///
62///
63/// # Configuration
64///
65/// To configure `PrivilegedAccessManager` use the `with_*` methods in the type returned
66/// by [builder()][PrivilegedAccessManager::builder]. The default configuration should
67/// work for most applications. Common configuration changes include
68///
69/// * [with_endpoint()]: by default this client uses the global default endpoint
70/// (`https://privilegedaccessmanager.googleapis.com`). Applications using regional
71/// endpoints or running in restricted networks (e.g. a network configured
72/// with [Private Google Access with VPC Service Controls]) may want to
73/// override this default.
74/// * [with_credentials()]: by default this client uses
75/// [Application Default Credentials]. Applications using custom
76/// authentication may need to override this default.
77///
78/// [with_endpoint()]: super::builder::privileged_access_manager::ClientBuilder::with_endpoint
79/// [with_credentials()]: super::builder::privileged_access_manager::ClientBuilder::with_credentials
80/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
81/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
82///
83/// # Pooling and Cloning
84///
85/// `PrivilegedAccessManager` holds a connection pool internally, it is advised to
86/// create one and reuse it. You do not need to wrap `PrivilegedAccessManager` in
87/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
88/// already uses an `Arc` internally.
89#[derive(Clone, Debug)]
90pub struct PrivilegedAccessManager {
91 inner: std::sync::Arc<dyn super::stub::dynamic::PrivilegedAccessManager>,
92}
93
94impl PrivilegedAccessManager {
95 /// Returns a builder for [PrivilegedAccessManager].
96 ///
97 /// ```
98 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
99 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
100 /// let client = PrivilegedAccessManager::builder().build().await?;
101 /// # Ok(()) }
102 /// ```
103 pub fn builder() -> super::builder::privileged_access_manager::ClientBuilder {
104 crate::new_client_builder(super::builder::privileged_access_manager::client::Factory)
105 }
106
107 /// Creates a new client from the provided stub.
108 ///
109 /// The most common case for calling this function is in tests mocking the
110 /// client's behavior.
111 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
112 where
113 T: super::stub::PrivilegedAccessManager + 'static,
114 {
115 Self { inner: stub.into() }
116 }
117
118 pub(crate) async fn new(
119 config: gaxi::options::ClientConfig,
120 ) -> crate::ClientBuilderResult<Self> {
121 let inner = Self::build_inner(config).await?;
122 Ok(Self { inner })
123 }
124
125 async fn build_inner(
126 conf: gaxi::options::ClientConfig,
127 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PrivilegedAccessManager>>
128 {
129 if gaxi::options::tracing_enabled(&conf) {
130 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
131 }
132 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
133 }
134
135 async fn build_transport(
136 conf: gaxi::options::ClientConfig,
137 ) -> crate::ClientBuilderResult<impl super::stub::PrivilegedAccessManager> {
138 super::transport::PrivilegedAccessManager::new(conf).await
139 }
140
141 async fn build_with_tracing(
142 conf: gaxi::options::ClientConfig,
143 ) -> crate::ClientBuilderResult<impl super::stub::PrivilegedAccessManager> {
144 Self::build_transport(conf)
145 .await
146 .map(super::tracing::PrivilegedAccessManager::new)
147 }
148
149 /// `CheckOnboardingStatus` reports the onboarding status for a
150 /// project/folder/organization. Any findings reported by this API need to be
151 /// fixed before PAM can be used on the resource.
152 ///
153 /// # Example
154 /// ```
155 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
156 /// use google_cloud_privilegedaccessmanager_v1::Result;
157 /// async fn sample(
158 /// client: &PrivilegedAccessManager
159 /// ) -> Result<()> {
160 /// let response = client.check_onboarding_status()
161 /// /* set fields */
162 /// .send().await?;
163 /// println!("response {:?}", response);
164 /// Ok(())
165 /// }
166 /// ```
167 pub fn check_onboarding_status(
168 &self,
169 ) -> super::builder::privileged_access_manager::CheckOnboardingStatus {
170 super::builder::privileged_access_manager::CheckOnboardingStatus::new(self.inner.clone())
171 }
172
173 /// Lists entitlements in a given project/folder/organization and location.
174 ///
175 /// # Example
176 /// ```
177 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
178 /// use google_cloud_gax::paginator::ItemPaginator as _;
179 /// use google_cloud_privilegedaccessmanager_v1::Result;
180 /// async fn sample(
181 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str
182 /// ) -> Result<()> {
183 /// let mut list = client.list_entitlements()
184 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
185 /// .by_item();
186 /// while let Some(item) = list.next().await.transpose()? {
187 /// println!("{:?}", item);
188 /// }
189 /// Ok(())
190 /// }
191 /// ```
192 pub fn list_entitlements(&self) -> super::builder::privileged_access_manager::ListEntitlements {
193 super::builder::privileged_access_manager::ListEntitlements::new(self.inner.clone())
194 }
195
196 /// `SearchEntitlements` returns entitlements on which the caller has the
197 /// specified access.
198 ///
199 /// # Example
200 /// ```
201 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
202 /// use google_cloud_gax::paginator::ItemPaginator as _;
203 /// use google_cloud_privilegedaccessmanager_v1::Result;
204 /// async fn sample(
205 /// client: &PrivilegedAccessManager
206 /// ) -> Result<()> {
207 /// let mut list = client.search_entitlements()
208 /// /* set fields */
209 /// .by_item();
210 /// while let Some(item) = list.next().await.transpose()? {
211 /// println!("{:?}", item);
212 /// }
213 /// Ok(())
214 /// }
215 /// ```
216 pub fn search_entitlements(
217 &self,
218 ) -> super::builder::privileged_access_manager::SearchEntitlements {
219 super::builder::privileged_access_manager::SearchEntitlements::new(self.inner.clone())
220 }
221
222 /// Gets details of a single entitlement.
223 ///
224 /// # Example
225 /// ```
226 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
227 /// use google_cloud_privilegedaccessmanager_v1::Result;
228 /// async fn sample(
229 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str, entitlement_id: &str
230 /// ) -> Result<()> {
231 /// let response = client.get_entitlement()
232 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entitlements/{entitlement_id}"))
233 /// .send().await?;
234 /// println!("response {:?}", response);
235 /// Ok(())
236 /// }
237 /// ```
238 pub fn get_entitlement(&self) -> super::builder::privileged_access_manager::GetEntitlement {
239 super::builder::privileged_access_manager::GetEntitlement::new(self.inner.clone())
240 }
241
242 /// Creates a new entitlement in a given project/folder/organization and
243 /// location.
244 ///
245 /// # Long running operations
246 ///
247 /// This method is used to start, and/or poll a [long-running Operation].
248 /// The [Working with long-running operations] chapter in the [user guide]
249 /// covers these operations in detail.
250 ///
251 /// [long-running operation]: https://google.aip.dev/151
252 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
253 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
254 ///
255 /// # Example
256 /// ```
257 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
258 /// use google_cloud_lro::Poller;
259 /// use google_cloud_privilegedaccessmanager_v1::model::Entitlement;
260 /// use google_cloud_privilegedaccessmanager_v1::Result;
261 /// async fn sample(
262 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str
263 /// ) -> Result<()> {
264 /// let response = client.create_entitlement()
265 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
266 /// .set_entitlement_id("entitlement_id_value")
267 /// .set_entitlement(
268 /// Entitlement::new()/* set fields */
269 /// )
270 /// .poller().until_done().await?;
271 /// println!("response {:?}", response);
272 /// Ok(())
273 /// }
274 /// ```
275 pub fn create_entitlement(
276 &self,
277 ) -> super::builder::privileged_access_manager::CreateEntitlement {
278 super::builder::privileged_access_manager::CreateEntitlement::new(self.inner.clone())
279 }
280
281 /// Deletes a single entitlement. This method can only be called when there
282 /// are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the
283 /// entitlement.
284 ///
285 /// # Long running operations
286 ///
287 /// This method is used to start, and/or poll a [long-running Operation].
288 /// The [Working with long-running operations] chapter in the [user guide]
289 /// covers these operations in detail.
290 ///
291 /// [long-running operation]: https://google.aip.dev/151
292 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
293 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
294 ///
295 /// # Example
296 /// ```
297 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
298 /// use google_cloud_lro::Poller;
299 /// use google_cloud_privilegedaccessmanager_v1::Result;
300 /// async fn sample(
301 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str, entitlement_id: &str
302 /// ) -> Result<()> {
303 /// let response = client.delete_entitlement()
304 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entitlements/{entitlement_id}"))
305 /// .poller().until_done().await?;
306 /// println!("response {:?}", response);
307 /// Ok(())
308 /// }
309 /// ```
310 pub fn delete_entitlement(
311 &self,
312 ) -> super::builder::privileged_access_manager::DeleteEntitlement {
313 super::builder::privileged_access_manager::DeleteEntitlement::new(self.inner.clone())
314 }
315
316 /// Updates the entitlement specified in the request. Updated fields in the
317 /// entitlement need to be specified in an update mask. The changes made to an
318 /// entitlement are applicable only on future grants of the entitlement.
319 /// However, if new approvers are added or existing approvers are removed from
320 /// the approval workflow, the changes are effective on existing grants.
321 ///
322 /// The following fields are not supported for updates:
323 ///
324 /// * All immutable fields
325 /// * Entitlement name
326 /// * Resource name
327 /// * Resource type
328 /// * Adding an approval workflow in an entitlement which previously had no
329 /// approval workflow.
330 /// * Deleting the approval workflow from an entitlement.
331 /// * Adding or deleting a step in the approval workflow (only one step is
332 /// supported)
333 ///
334 /// Note that updates are allowed on the list of approvers in an approval
335 /// workflow step.
336 ///
337 /// # Long running operations
338 ///
339 /// This method is used to start, and/or poll a [long-running Operation].
340 /// The [Working with long-running operations] chapter in the [user guide]
341 /// covers these operations in detail.
342 ///
343 /// [long-running operation]: https://google.aip.dev/151
344 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
345 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
346 ///
347 /// # Example
348 /// ```
349 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
350 /// use google_cloud_lro::Poller;
351 /// # extern crate wkt as google_cloud_wkt;
352 /// use google_cloud_wkt::FieldMask;
353 /// use google_cloud_privilegedaccessmanager_v1::model::Entitlement;
354 /// use google_cloud_privilegedaccessmanager_v1::Result;
355 /// async fn sample(
356 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str, entitlement_id: &str
357 /// ) -> Result<()> {
358 /// let response = client.update_entitlement()
359 /// .set_entitlement(
360 /// Entitlement::new().set_name(format!("projects/{project_id}/locations/{location_id}/entitlements/{entitlement_id}"))/* set fields */
361 /// )
362 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
363 /// .poller().until_done().await?;
364 /// println!("response {:?}", response);
365 /// Ok(())
366 /// }
367 /// ```
368 pub fn update_entitlement(
369 &self,
370 ) -> super::builder::privileged_access_manager::UpdateEntitlement {
371 super::builder::privileged_access_manager::UpdateEntitlement::new(self.inner.clone())
372 }
373
374 /// Lists grants for a given entitlement.
375 ///
376 /// # Example
377 /// ```
378 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
379 /// use google_cloud_gax::paginator::ItemPaginator as _;
380 /// use google_cloud_privilegedaccessmanager_v1::Result;
381 /// async fn sample(
382 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str, entitlement_id: &str
383 /// ) -> Result<()> {
384 /// let mut list = client.list_grants()
385 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/entitlements/{entitlement_id}"))
386 /// .by_item();
387 /// while let Some(item) = list.next().await.transpose()? {
388 /// println!("{:?}", item);
389 /// }
390 /// Ok(())
391 /// }
392 /// ```
393 pub fn list_grants(&self) -> super::builder::privileged_access_manager::ListGrants {
394 super::builder::privileged_access_manager::ListGrants::new(self.inner.clone())
395 }
396
397 /// `SearchGrants` returns grants that are related to the calling user in the
398 /// specified way.
399 ///
400 /// # Example
401 /// ```
402 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
403 /// use google_cloud_gax::paginator::ItemPaginator as _;
404 /// use google_cloud_privilegedaccessmanager_v1::Result;
405 /// async fn sample(
406 /// client: &PrivilegedAccessManager
407 /// ) -> Result<()> {
408 /// let mut list = client.search_grants()
409 /// /* set fields */
410 /// .by_item();
411 /// while let Some(item) = list.next().await.transpose()? {
412 /// println!("{:?}", item);
413 /// }
414 /// Ok(())
415 /// }
416 /// ```
417 pub fn search_grants(&self) -> super::builder::privileged_access_manager::SearchGrants {
418 super::builder::privileged_access_manager::SearchGrants::new(self.inner.clone())
419 }
420
421 /// Get details of a single grant.
422 ///
423 /// # Example
424 /// ```
425 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
426 /// use google_cloud_privilegedaccessmanager_v1::Result;
427 /// async fn sample(
428 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str, entitlement_id: &str, grant_id: &str
429 /// ) -> Result<()> {
430 /// let response = client.get_grant()
431 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entitlements/{entitlement_id}/grants/{grant_id}"))
432 /// .send().await?;
433 /// println!("response {:?}", response);
434 /// Ok(())
435 /// }
436 /// ```
437 pub fn get_grant(&self) -> super::builder::privileged_access_manager::GetGrant {
438 super::builder::privileged_access_manager::GetGrant::new(self.inner.clone())
439 }
440
441 /// Creates a new grant in a given project/folder/organization and
442 /// location.
443 ///
444 /// # Example
445 /// ```
446 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
447 /// use google_cloud_privilegedaccessmanager_v1::model::Grant;
448 /// use google_cloud_privilegedaccessmanager_v1::Result;
449 /// async fn sample(
450 /// client: &PrivilegedAccessManager, project_id: &str, location_id: &str, entitlement_id: &str
451 /// ) -> Result<()> {
452 /// let response = client.create_grant()
453 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/entitlements/{entitlement_id}"))
454 /// .set_grant(
455 /// Grant::new()/* set fields */
456 /// )
457 /// .send().await?;
458 /// println!("response {:?}", response);
459 /// Ok(())
460 /// }
461 /// ```
462 pub fn create_grant(&self) -> super::builder::privileged_access_manager::CreateGrant {
463 super::builder::privileged_access_manager::CreateGrant::new(self.inner.clone())
464 }
465
466 /// `ApproveGrant` is used to approve a grant. This method can only be called
467 /// on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't
468 /// be undone.
469 ///
470 /// # Example
471 /// ```
472 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
473 /// use google_cloud_privilegedaccessmanager_v1::Result;
474 /// async fn sample(
475 /// client: &PrivilegedAccessManager
476 /// ) -> Result<()> {
477 /// let response = client.approve_grant()
478 /// /* set fields */
479 /// .send().await?;
480 /// println!("response {:?}", response);
481 /// Ok(())
482 /// }
483 /// ```
484 pub fn approve_grant(&self) -> super::builder::privileged_access_manager::ApproveGrant {
485 super::builder::privileged_access_manager::ApproveGrant::new(self.inner.clone())
486 }
487
488 /// `DenyGrant` is used to deny a grant. This method can only be called on a
489 /// grant when it's in the `APPROVAL_AWAITED` state. This operation can't be
490 /// undone.
491 ///
492 /// # Example
493 /// ```
494 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
495 /// use google_cloud_privilegedaccessmanager_v1::Result;
496 /// async fn sample(
497 /// client: &PrivilegedAccessManager
498 /// ) -> Result<()> {
499 /// let response = client.deny_grant()
500 /// /* set fields */
501 /// .send().await?;
502 /// println!("response {:?}", response);
503 /// Ok(())
504 /// }
505 /// ```
506 pub fn deny_grant(&self) -> super::builder::privileged_access_manager::DenyGrant {
507 super::builder::privileged_access_manager::DenyGrant::new(self.inner.clone())
508 }
509
510 /// `RevokeGrant` is used to immediately revoke access for a grant. This method
511 /// can be called when the grant is in a non-terminal state.
512 ///
513 /// # Long running operations
514 ///
515 /// This method is used to start, and/or poll a [long-running Operation].
516 /// The [Working with long-running operations] chapter in the [user guide]
517 /// covers these operations in detail.
518 ///
519 /// [long-running operation]: https://google.aip.dev/151
520 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
521 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
522 ///
523 /// # Example
524 /// ```
525 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
526 /// use google_cloud_lro::Poller;
527 /// use google_cloud_privilegedaccessmanager_v1::Result;
528 /// async fn sample(
529 /// client: &PrivilegedAccessManager
530 /// ) -> Result<()> {
531 /// let response = client.revoke_grant()
532 /// /* set fields */
533 /// .poller().until_done().await?;
534 /// println!("response {:?}", response);
535 /// Ok(())
536 /// }
537 /// ```
538 pub fn revoke_grant(&self) -> super::builder::privileged_access_manager::RevokeGrant {
539 super::builder::privileged_access_manager::RevokeGrant::new(self.inner.clone())
540 }
541
542 /// Lists information about the supported locations for this service.
543 ///
544 /// # Example
545 /// ```
546 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
547 /// use google_cloud_gax::paginator::ItemPaginator as _;
548 /// use google_cloud_privilegedaccessmanager_v1::Result;
549 /// async fn sample(
550 /// client: &PrivilegedAccessManager
551 /// ) -> Result<()> {
552 /// let mut list = client.list_locations()
553 /// /* set fields */
554 /// .by_item();
555 /// while let Some(item) = list.next().await.transpose()? {
556 /// println!("{:?}", item);
557 /// }
558 /// Ok(())
559 /// }
560 /// ```
561 pub fn list_locations(&self) -> super::builder::privileged_access_manager::ListLocations {
562 super::builder::privileged_access_manager::ListLocations::new(self.inner.clone())
563 }
564
565 /// Gets information about a location.
566 ///
567 /// # Example
568 /// ```
569 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
570 /// use google_cloud_privilegedaccessmanager_v1::Result;
571 /// async fn sample(
572 /// client: &PrivilegedAccessManager
573 /// ) -> Result<()> {
574 /// let response = client.get_location()
575 /// /* set fields */
576 /// .send().await?;
577 /// println!("response {:?}", response);
578 /// Ok(())
579 /// }
580 /// ```
581 pub fn get_location(&self) -> super::builder::privileged_access_manager::GetLocation {
582 super::builder::privileged_access_manager::GetLocation::new(self.inner.clone())
583 }
584
585 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
586 ///
587 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
588 ///
589 /// # Example
590 /// ```
591 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
592 /// use google_cloud_gax::paginator::ItemPaginator as _;
593 /// use google_cloud_privilegedaccessmanager_v1::Result;
594 /// async fn sample(
595 /// client: &PrivilegedAccessManager
596 /// ) -> Result<()> {
597 /// let mut list = client.list_operations()
598 /// /* set fields */
599 /// .by_item();
600 /// while let Some(item) = list.next().await.transpose()? {
601 /// println!("{:?}", item);
602 /// }
603 /// Ok(())
604 /// }
605 /// ```
606 pub fn list_operations(&self) -> super::builder::privileged_access_manager::ListOperations {
607 super::builder::privileged_access_manager::ListOperations::new(self.inner.clone())
608 }
609
610 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
611 ///
612 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
613 ///
614 /// # Example
615 /// ```
616 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
617 /// use google_cloud_privilegedaccessmanager_v1::Result;
618 /// async fn sample(
619 /// client: &PrivilegedAccessManager
620 /// ) -> Result<()> {
621 /// let response = client.get_operation()
622 /// /* set fields */
623 /// .send().await?;
624 /// println!("response {:?}", response);
625 /// Ok(())
626 /// }
627 /// ```
628 pub fn get_operation(&self) -> super::builder::privileged_access_manager::GetOperation {
629 super::builder::privileged_access_manager::GetOperation::new(self.inner.clone())
630 }
631
632 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
633 ///
634 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
635 ///
636 /// # Example
637 /// ```
638 /// # use google_cloud_privilegedaccessmanager_v1::client::PrivilegedAccessManager;
639 /// use google_cloud_privilegedaccessmanager_v1::Result;
640 /// async fn sample(
641 /// client: &PrivilegedAccessManager
642 /// ) -> Result<()> {
643 /// client.delete_operation()
644 /// /* set fields */
645 /// .send().await?;
646 /// Ok(())
647 /// }
648 /// ```
649 pub fn delete_operation(&self) -> super::builder::privileged_access_manager::DeleteOperation {
650 super::builder::privileged_access_manager::DeleteOperation::new(self.inner.clone())
651 }
652}