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