google_cloud_securityposture_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 Security Posture API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_securityposture_v1::client::SecurityPosture;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
26/// let client = SecurityPosture::builder().build().await?;
27/// let parent = "parent_value";
28/// let mut list = client.list_postures()
29/// .set_parent(parent)
30/// .by_item();
31/// while let Some(item) = list.next().await.transpose()? {
32/// println!("{:?}", item);
33/// }
34/// # Ok(()) }
35/// ```
36///
37/// # Service Description
38///
39/// Service describing handlers for resources.
40///
41/// # Configuration
42///
43/// To configure `SecurityPosture` use the `with_*` methods in the type returned
44/// by [builder()][SecurityPosture::builder]. The default configuration should
45/// work for most applications. Common configuration changes include
46///
47/// * [with_endpoint()]: by default this client uses the global default endpoint
48/// (`https://securityposture.googleapis.com`). Applications using regional
49/// endpoints or running in restricted networks (e.g. a network configured
50// with [Private Google Access with VPC Service Controls]) may want to
51/// override this default.
52/// * [with_credentials()]: by default this client uses
53/// [Application Default Credentials]. Applications using custom
54/// authentication may need to override this default.
55///
56/// [with_endpoint()]: super::builder::security_posture::ClientBuilder::with_endpoint
57/// [with_credentials()]: super::builder::security_posture::ClientBuilder::with_credentials
58/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
59/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
60///
61/// # Pooling and Cloning
62///
63/// `SecurityPosture` holds a connection pool internally, it is advised to
64/// create one and reuse it. You do not need to wrap `SecurityPosture` in
65/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
66/// already uses an `Arc` internally.
67#[derive(Clone, Debug)]
68pub struct SecurityPosture {
69 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPosture>,
70}
71
72impl SecurityPosture {
73 /// Returns a builder for [SecurityPosture].
74 ///
75 /// ```
76 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
77 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
78 /// let client = SecurityPosture::builder().build().await?;
79 /// # Ok(()) }
80 /// ```
81 pub fn builder() -> super::builder::security_posture::ClientBuilder {
82 crate::new_client_builder(super::builder::security_posture::client::Factory)
83 }
84
85 /// Creates a new client from the provided stub.
86 ///
87 /// The most common case for calling this function is in tests mocking the
88 /// client's behavior.
89 pub fn from_stub<T>(stub: T) -> Self
90 where
91 T: super::stub::SecurityPosture + 'static,
92 {
93 Self {
94 inner: std::sync::Arc::new(stub),
95 }
96 }
97
98 pub(crate) async fn new(
99 config: gaxi::options::ClientConfig,
100 ) -> crate::ClientBuilderResult<Self> {
101 let inner = Self::build_inner(config).await?;
102 Ok(Self { inner })
103 }
104
105 async fn build_inner(
106 conf: gaxi::options::ClientConfig,
107 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPosture>> {
108 if gaxi::options::tracing_enabled(&conf) {
109 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
110 }
111 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
112 }
113
114 async fn build_transport(
115 conf: gaxi::options::ClientConfig,
116 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPosture> {
117 super::transport::SecurityPosture::new(conf).await
118 }
119
120 async fn build_with_tracing(
121 conf: gaxi::options::ClientConfig,
122 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPosture> {
123 Self::build_transport(conf)
124 .await
125 .map(super::tracing::SecurityPosture::new)
126 }
127
128 /// (-- This option restricts the visibility of the API to only projects that
129 /// will
130 /// (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service.
131 /// (-- option (google.api.api_visibility).restriction =
132 /// "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization
133 /// and location. In case a posture has multiple revisions, the latest revision
134 /// as per UpdateTime will be returned.
135 ///
136 /// # Example
137 /// ```
138 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
139 /// use google_cloud_gax::paginator::ItemPaginator as _;
140 /// use google_cloud_securityposture_v1::Result;
141 /// async fn sample(
142 /// client: &SecurityPosture, parent: &str
143 /// ) -> Result<()> {
144 /// let mut list = client.list_postures()
145 /// .set_parent(parent)
146 /// .by_item();
147 /// while let Some(item) = list.next().await.transpose()? {
148 /// println!("{:?}", item);
149 /// }
150 /// Ok(())
151 /// }
152 /// ```
153 pub fn list_postures(&self) -> super::builder::security_posture::ListPostures {
154 super::builder::security_posture::ListPostures::new(self.inner.clone())
155 }
156
157 /// Lists revisions of a Posture in a given organization and location.
158 ///
159 /// # Example
160 /// ```
161 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
162 /// use google_cloud_gax::paginator::ItemPaginator as _;
163 /// use google_cloud_securityposture_v1::Result;
164 /// async fn sample(
165 /// client: &SecurityPosture
166 /// ) -> Result<()> {
167 /// let mut list = client.list_posture_revisions()
168 /// /* set fields */
169 /// .by_item();
170 /// while let Some(item) = list.next().await.transpose()? {
171 /// println!("{:?}", item);
172 /// }
173 /// Ok(())
174 /// }
175 /// ```
176 pub fn list_posture_revisions(&self) -> super::builder::security_posture::ListPostureRevisions {
177 super::builder::security_posture::ListPostureRevisions::new(self.inner.clone())
178 }
179
180 /// Gets a posture in a given organization and location.
181 /// User must provide revision_id to retrieve a specific revision of the
182 /// resource.
183 /// NOT_FOUND error is returned if the revision_id or the Posture name does not
184 /// exist. In case revision_id is not provided then the latest Posture revision
185 /// by UpdateTime is returned.
186 ///
187 /// # Example
188 /// ```
189 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
190 /// use google_cloud_securityposture_v1::Result;
191 /// async fn sample(
192 /// client: &SecurityPosture, name: &str
193 /// ) -> Result<()> {
194 /// let response = client.get_posture()
195 /// .set_name(name)
196 /// .send().await?;
197 /// println!("response {:?}", response);
198 /// Ok(())
199 /// }
200 /// ```
201 pub fn get_posture(&self) -> super::builder::security_posture::GetPosture {
202 super::builder::security_posture::GetPosture::new(self.inner.clone())
203 }
204
205 /// Creates a new Posture resource.
206 /// If a Posture with the specified name already exists in the specified
207 /// organization and location, the long running operation returns a
208 /// [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
209 ///
210 /// # Long running operations
211 ///
212 /// This method is used to start, and/or poll a [long-running Operation].
213 /// The [Working with long-running operations] chapter in the [user guide]
214 /// covers these operations in detail.
215 ///
216 /// [long-running operation]: https://google.aip.dev/151
217 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
218 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
219 ///
220 /// # Example
221 /// ```
222 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
223 /// use google_cloud_lro::Poller;
224 /// use google_cloud_securityposture_v1::model::Posture;
225 /// use google_cloud_securityposture_v1::Result;
226 /// async fn sample(
227 /// client: &SecurityPosture, parent: &str
228 /// ) -> Result<()> {
229 /// let response = client.create_posture()
230 /// .set_parent(parent)
231 /// .set_posture_id("posture_id_value")
232 /// .set_posture(
233 /// Posture::new()/* set fields */
234 /// )
235 /// .poller().until_done().await?;
236 /// println!("response {:?}", response);
237 /// Ok(())
238 /// }
239 /// ```
240 pub fn create_posture(&self) -> super::builder::security_posture::CreatePosture {
241 super::builder::security_posture::CreatePosture::new(self.inner.clone())
242 }
243
244 /// Updates an existing Posture.
245 /// A new revision of the posture will be created if the revision to be
246 /// updated is currently deployed on a workload.
247 /// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the
248 /// Posture does not exist.
249 /// Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag
250 /// supplied in the request does not match the persisted etag of the Posture.
251 /// Updatable fields are state, description and policy_sets.
252 /// State update operation cannot be clubbed with update of description and
253 /// policy_sets.
254 /// An ACTIVE posture can be updated to both DRAFT or DEPRECATED states.
255 /// Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state.
256 ///
257 /// # Long running operations
258 ///
259 /// This method is used to start, and/or poll a [long-running Operation].
260 /// The [Working with long-running operations] chapter in the [user guide]
261 /// covers these operations in detail.
262 ///
263 /// [long-running operation]: https://google.aip.dev/151
264 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
265 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
266 ///
267 /// # Example
268 /// ```
269 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
270 /// use google_cloud_lro::Poller;
271 /// # extern crate wkt as google_cloud_wkt;
272 /// use google_cloud_wkt::FieldMask;
273 /// use google_cloud_securityposture_v1::model::Posture;
274 /// use google_cloud_securityposture_v1::Result;
275 /// async fn sample(
276 /// client: &SecurityPosture, name: &str
277 /// ) -> Result<()> {
278 /// let response = client.update_posture()
279 /// .set_posture(
280 /// Posture::new().set_name(name)/* set fields */
281 /// )
282 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
283 /// .poller().until_done().await?;
284 /// println!("response {:?}", response);
285 /// Ok(())
286 /// }
287 /// ```
288 pub fn update_posture(&self) -> super::builder::security_posture::UpdatePosture {
289 super::builder::security_posture::UpdatePosture::new(self.inner.clone())
290 }
291
292 /// Deletes all the revisions of a resource.
293 /// A posture can only be deleted when none of the revisions are deployed to
294 /// any workload.
295 ///
296 /// # Long running operations
297 ///
298 /// This method is used to start, and/or poll a [long-running Operation].
299 /// The [Working with long-running operations] chapter in the [user guide]
300 /// covers these operations in detail.
301 ///
302 /// [long-running operation]: https://google.aip.dev/151
303 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
304 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
305 ///
306 /// # Example
307 /// ```
308 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
309 /// use google_cloud_lro::Poller;
310 /// use google_cloud_securityposture_v1::Result;
311 /// async fn sample(
312 /// client: &SecurityPosture, name: &str
313 /// ) -> Result<()> {
314 /// client.delete_posture()
315 /// .set_name(name)
316 /// .poller().until_done().await?;
317 /// Ok(())
318 /// }
319 /// ```
320 pub fn delete_posture(&self) -> super::builder::security_posture::DeletePosture {
321 super::builder::security_posture::DeletePosture::new(self.inner.clone())
322 }
323
324 /// Extracts existing policies on a workload as a posture.
325 /// If a Posture on the given workload already exists, the long running
326 /// operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
327 ///
328 /// # Long running operations
329 ///
330 /// This method is used to start, and/or poll a [long-running Operation].
331 /// The [Working with long-running operations] chapter in the [user guide]
332 /// covers these operations in detail.
333 ///
334 /// [long-running operation]: https://google.aip.dev/151
335 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
336 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
337 ///
338 /// # Example
339 /// ```
340 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
341 /// use google_cloud_lro::Poller;
342 /// use google_cloud_securityposture_v1::Result;
343 /// async fn sample(
344 /// client: &SecurityPosture
345 /// ) -> Result<()> {
346 /// let response = client.extract_posture()
347 /// /* set fields */
348 /// .poller().until_done().await?;
349 /// println!("response {:?}", response);
350 /// Ok(())
351 /// }
352 /// ```
353 pub fn extract_posture(&self) -> super::builder::security_posture::ExtractPosture {
354 super::builder::security_posture::ExtractPosture::new(self.inner.clone())
355 }
356
357 /// PostureDeployments
358 /// Lists PostureDeployments in a given project and location.
359 ///
360 /// # Example
361 /// ```
362 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
363 /// use google_cloud_gax::paginator::ItemPaginator as _;
364 /// use google_cloud_securityposture_v1::Result;
365 /// async fn sample(
366 /// client: &SecurityPosture, parent: &str
367 /// ) -> Result<()> {
368 /// let mut list = client.list_posture_deployments()
369 /// .set_parent(parent)
370 /// .by_item();
371 /// while let Some(item) = list.next().await.transpose()? {
372 /// println!("{:?}", item);
373 /// }
374 /// Ok(())
375 /// }
376 /// ```
377 pub fn list_posture_deployments(
378 &self,
379 ) -> super::builder::security_posture::ListPostureDeployments {
380 super::builder::security_posture::ListPostureDeployments::new(self.inner.clone())
381 }
382
383 /// Gets details of a single PostureDeployment.
384 ///
385 /// # Example
386 /// ```
387 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
388 /// use google_cloud_securityposture_v1::Result;
389 /// async fn sample(
390 /// client: &SecurityPosture, name: &str
391 /// ) -> Result<()> {
392 /// let response = client.get_posture_deployment()
393 /// .set_name(name)
394 /// .send().await?;
395 /// println!("response {:?}", response);
396 /// Ok(())
397 /// }
398 /// ```
399 pub fn get_posture_deployment(&self) -> super::builder::security_posture::GetPostureDeployment {
400 super::builder::security_posture::GetPostureDeployment::new(self.inner.clone())
401 }
402
403 /// Creates a new PostureDeployment in a given project and location.
404 ///
405 /// # Long running operations
406 ///
407 /// This method is used to start, and/or poll a [long-running Operation].
408 /// The [Working with long-running operations] chapter in the [user guide]
409 /// covers these operations in detail.
410 ///
411 /// [long-running operation]: https://google.aip.dev/151
412 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
413 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
414 ///
415 /// # Example
416 /// ```
417 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
418 /// use google_cloud_lro::Poller;
419 /// use google_cloud_securityposture_v1::model::PostureDeployment;
420 /// use google_cloud_securityposture_v1::Result;
421 /// async fn sample(
422 /// client: &SecurityPosture, parent: &str
423 /// ) -> Result<()> {
424 /// let response = client.create_posture_deployment()
425 /// .set_parent(parent)
426 /// .set_posture_deployment(
427 /// PostureDeployment::new()/* set fields */
428 /// )
429 /// .poller().until_done().await?;
430 /// println!("response {:?}", response);
431 /// Ok(())
432 /// }
433 /// ```
434 pub fn create_posture_deployment(
435 &self,
436 ) -> super::builder::security_posture::CreatePostureDeployment {
437 super::builder::security_posture::CreatePostureDeployment::new(self.inner.clone())
438 }
439
440 /// Updates the parameters of a single PostureDeployment.
441 ///
442 /// # Long running operations
443 ///
444 /// This method is used to start, and/or poll a [long-running Operation].
445 /// The [Working with long-running operations] chapter in the [user guide]
446 /// covers these operations in detail.
447 ///
448 /// [long-running operation]: https://google.aip.dev/151
449 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
450 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
451 ///
452 /// # Example
453 /// ```
454 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
455 /// use google_cloud_lro::Poller;
456 /// # extern crate wkt as google_cloud_wkt;
457 /// use google_cloud_wkt::FieldMask;
458 /// use google_cloud_securityposture_v1::model::PostureDeployment;
459 /// use google_cloud_securityposture_v1::Result;
460 /// async fn sample(
461 /// client: &SecurityPosture, name: &str
462 /// ) -> Result<()> {
463 /// let response = client.update_posture_deployment()
464 /// .set_posture_deployment(
465 /// PostureDeployment::new().set_name(name)/* set fields */
466 /// )
467 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
468 /// .poller().until_done().await?;
469 /// println!("response {:?}", response);
470 /// Ok(())
471 /// }
472 /// ```
473 pub fn update_posture_deployment(
474 &self,
475 ) -> super::builder::security_posture::UpdatePostureDeployment {
476 super::builder::security_posture::UpdatePostureDeployment::new(self.inner.clone())
477 }
478
479 /// Deletes a single PostureDeployment.
480 ///
481 /// # Long running operations
482 ///
483 /// This method is used to start, and/or poll a [long-running Operation].
484 /// The [Working with long-running operations] chapter in the [user guide]
485 /// covers these operations in detail.
486 ///
487 /// [long-running operation]: https://google.aip.dev/151
488 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
489 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
490 ///
491 /// # Example
492 /// ```
493 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
494 /// use google_cloud_lro::Poller;
495 /// use google_cloud_securityposture_v1::Result;
496 /// async fn sample(
497 /// client: &SecurityPosture, name: &str
498 /// ) -> Result<()> {
499 /// client.delete_posture_deployment()
500 /// .set_name(name)
501 /// .poller().until_done().await?;
502 /// Ok(())
503 /// }
504 /// ```
505 pub fn delete_posture_deployment(
506 &self,
507 ) -> super::builder::security_posture::DeletePostureDeployment {
508 super::builder::security_posture::DeletePostureDeployment::new(self.inner.clone())
509 }
510
511 /// PostureTemplates
512 /// Lists all the PostureTemplates available to the user.
513 ///
514 /// # Example
515 /// ```
516 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
517 /// use google_cloud_gax::paginator::ItemPaginator as _;
518 /// use google_cloud_securityposture_v1::Result;
519 /// async fn sample(
520 /// client: &SecurityPosture, parent: &str
521 /// ) -> Result<()> {
522 /// let mut list = client.list_posture_templates()
523 /// .set_parent(parent)
524 /// .by_item();
525 /// while let Some(item) = list.next().await.transpose()? {
526 /// println!("{:?}", item);
527 /// }
528 /// Ok(())
529 /// }
530 /// ```
531 pub fn list_posture_templates(&self) -> super::builder::security_posture::ListPostureTemplates {
532 super::builder::security_posture::ListPostureTemplates::new(self.inner.clone())
533 }
534
535 /// Gets a PostureTemplate.
536 /// User must provide revision_id to retrieve a specific revision of the
537 /// resource.
538 /// NOT_FOUND error is returned if the revision_id or the PostureTemplate name
539 /// does not exist. In case revision_id is not provided then the
540 /// PostureTemplate with latest revision_id is returned.
541 ///
542 /// # Example
543 /// ```
544 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
545 /// use google_cloud_securityposture_v1::Result;
546 /// async fn sample(
547 /// client: &SecurityPosture, name: &str
548 /// ) -> Result<()> {
549 /// let response = client.get_posture_template()
550 /// .set_name(name)
551 /// .send().await?;
552 /// println!("response {:?}", response);
553 /// Ok(())
554 /// }
555 /// ```
556 pub fn get_posture_template(&self) -> super::builder::security_posture::GetPostureTemplate {
557 super::builder::security_posture::GetPostureTemplate::new(self.inner.clone())
558 }
559
560 /// Lists information about the supported locations for this service.
561 ///
562 /// # Example
563 /// ```
564 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
565 /// use google_cloud_gax::paginator::ItemPaginator as _;
566 /// use google_cloud_securityposture_v1::Result;
567 /// async fn sample(
568 /// client: &SecurityPosture
569 /// ) -> Result<()> {
570 /// let mut list = client.list_locations()
571 /// /* set fields */
572 /// .by_item();
573 /// while let Some(item) = list.next().await.transpose()? {
574 /// println!("{:?}", item);
575 /// }
576 /// Ok(())
577 /// }
578 /// ```
579 pub fn list_locations(&self) -> super::builder::security_posture::ListLocations {
580 super::builder::security_posture::ListLocations::new(self.inner.clone())
581 }
582
583 /// Gets information about a location.
584 ///
585 /// # Example
586 /// ```
587 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
588 /// use google_cloud_securityposture_v1::Result;
589 /// async fn sample(
590 /// client: &SecurityPosture
591 /// ) -> Result<()> {
592 /// let response = client.get_location()
593 /// /* set fields */
594 /// .send().await?;
595 /// println!("response {:?}", response);
596 /// Ok(())
597 /// }
598 /// ```
599 pub fn get_location(&self) -> super::builder::security_posture::GetLocation {
600 super::builder::security_posture::GetLocation::new(self.inner.clone())
601 }
602
603 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
604 ///
605 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
606 ///
607 /// # Example
608 /// ```
609 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
610 /// use google_cloud_gax::paginator::ItemPaginator as _;
611 /// use google_cloud_securityposture_v1::Result;
612 /// async fn sample(
613 /// client: &SecurityPosture
614 /// ) -> Result<()> {
615 /// let mut list = client.list_operations()
616 /// /* set fields */
617 /// .by_item();
618 /// while let Some(item) = list.next().await.transpose()? {
619 /// println!("{:?}", item);
620 /// }
621 /// Ok(())
622 /// }
623 /// ```
624 pub fn list_operations(&self) -> super::builder::security_posture::ListOperations {
625 super::builder::security_posture::ListOperations::new(self.inner.clone())
626 }
627
628 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
629 ///
630 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
631 ///
632 /// # Example
633 /// ```
634 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
635 /// use google_cloud_securityposture_v1::Result;
636 /// async fn sample(
637 /// client: &SecurityPosture
638 /// ) -> Result<()> {
639 /// let response = client.get_operation()
640 /// /* set fields */
641 /// .send().await?;
642 /// println!("response {:?}", response);
643 /// Ok(())
644 /// }
645 /// ```
646 pub fn get_operation(&self) -> super::builder::security_posture::GetOperation {
647 super::builder::security_posture::GetOperation::new(self.inner.clone())
648 }
649
650 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
651 ///
652 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
653 ///
654 /// # Example
655 /// ```
656 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
657 /// use google_cloud_securityposture_v1::Result;
658 /// async fn sample(
659 /// client: &SecurityPosture
660 /// ) -> Result<()> {
661 /// client.delete_operation()
662 /// /* set fields */
663 /// .send().await?;
664 /// Ok(())
665 /// }
666 /// ```
667 pub fn delete_operation(&self) -> super::builder::security_posture::DeleteOperation {
668 super::builder::security_posture::DeleteOperation::new(self.inner.clone())
669 }
670
671 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
672 ///
673 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
674 ///
675 /// # Example
676 /// ```
677 /// # use google_cloud_securityposture_v1::client::SecurityPosture;
678 /// use google_cloud_securityposture_v1::Result;
679 /// async fn sample(
680 /// client: &SecurityPosture
681 /// ) -> Result<()> {
682 /// client.cancel_operation()
683 /// /* set fields */
684 /// .send().await?;
685 /// Ok(())
686 /// }
687 /// ```
688 pub fn cancel_operation(&self) -> super::builder::security_posture::CancelOperation {
689 super::builder::security_posture::CancelOperation::new(self.inner.clone())
690 }
691}