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