google_cloud_cloudsecuritycompliance_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 Cloud Security Compliance API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
26/// let client = Audit::builder().build().await?;
27/// let parent = "parent_value";
28/// let mut list = client.list_framework_audits()
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 `Audit` use the `with_*` methods in the type returned
44/// by [builder()][Audit::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://cloudsecuritycompliance.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::audit::ClientBuilder::with_endpoint
57/// [with_credentials()]: super::builder::audit::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/// `Audit` holds a connection pool internally, it is advised to
64/// create one and reuse it. You do not need to wrap `Audit` 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 Audit {
69 inner: std::sync::Arc<dyn super::stub::dynamic::Audit>,
70}
71
72impl Audit {
73 /// Returns a builder for [Audit].
74 ///
75 /// ```
76 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
77 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
78 /// let client = Audit::builder().build().await?;
79 /// # Ok(()) }
80 /// ```
81 pub fn builder() -> super::builder::audit::ClientBuilder {
82 crate::new_client_builder(super::builder::audit::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::Audit + '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::Audit>> {
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::Audit> {
117 super::transport::Audit::new(conf).await
118 }
119
120 async fn build_with_tracing(
121 conf: gaxi::options::ClientConfig,
122 ) -> crate::ClientBuilderResult<impl super::stub::Audit> {
123 Self::build_transport(conf)
124 .await
125 .map(super::tracing::Audit::new)
126 }
127
128 /// Generates an audit scope report for a framework.
129 ///
130 /// # Example
131 /// ```
132 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
133 /// use google_cloud_cloudsecuritycompliance_v1::Result;
134 /// async fn sample(
135 /// client: &Audit
136 /// ) -> Result<()> {
137 /// let response = client.generate_framework_audit_scope_report()
138 /// /* set fields */
139 /// .send().await?;
140 /// println!("response {:?}", response);
141 /// Ok(())
142 /// }
143 /// ```
144 pub fn generate_framework_audit_scope_report(
145 &self,
146 ) -> super::builder::audit::GenerateFrameworkAuditScopeReport {
147 super::builder::audit::GenerateFrameworkAuditScopeReport::new(self.inner.clone())
148 }
149
150 /// Creates an audit scope report for a framework.
151 ///
152 /// # Long running operations
153 ///
154 /// This method is used to start, and/or poll a [long-running Operation].
155 /// The [Working with long-running operations] chapter in the [user guide]
156 /// covers these operations in detail.
157 ///
158 /// [long-running operation]: https://google.aip.dev/151
159 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
160 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
161 ///
162 /// # Example
163 /// ```
164 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
165 /// use google_cloud_lro::Poller;
166 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
167 /// use google_cloud_cloudsecuritycompliance_v1::Result;
168 /// async fn sample(
169 /// client: &Audit, parent: &str
170 /// ) -> Result<()> {
171 /// let response = client.create_framework_audit()
172 /// .set_parent(parent)
173 /// .set_framework_audit(
174 /// FrameworkAudit::new()/* set fields */
175 /// )
176 /// .poller().until_done().await?;
177 /// println!("response {:?}", response);
178 /// Ok(())
179 /// }
180 /// ```
181 pub fn create_framework_audit(&self) -> super::builder::audit::CreateFrameworkAudit {
182 super::builder::audit::CreateFrameworkAudit::new(self.inner.clone())
183 }
184
185 /// Lists the framework audits for a given organization, folder, or project.
186 ///
187 /// # Example
188 /// ```
189 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
190 /// use google_cloud_gax::paginator::ItemPaginator as _;
191 /// use google_cloud_cloudsecuritycompliance_v1::Result;
192 /// async fn sample(
193 /// client: &Audit, parent: &str
194 /// ) -> Result<()> {
195 /// let mut list = client.list_framework_audits()
196 /// .set_parent(parent)
197 /// .by_item();
198 /// while let Some(item) = list.next().await.transpose()? {
199 /// println!("{:?}", item);
200 /// }
201 /// Ok(())
202 /// }
203 /// ```
204 pub fn list_framework_audits(&self) -> super::builder::audit::ListFrameworkAudits {
205 super::builder::audit::ListFrameworkAudits::new(self.inner.clone())
206 }
207
208 /// Gets the details for a framework audit.
209 ///
210 /// # Example
211 /// ```
212 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
213 /// use google_cloud_cloudsecuritycompliance_v1::Result;
214 /// async fn sample(
215 /// client: &Audit, name: &str
216 /// ) -> Result<()> {
217 /// let response = client.get_framework_audit()
218 /// .set_name(name)
219 /// .send().await?;
220 /// println!("response {:?}", response);
221 /// Ok(())
222 /// }
223 /// ```
224 pub fn get_framework_audit(&self) -> super::builder::audit::GetFrameworkAudit {
225 super::builder::audit::GetFrameworkAudit::new(self.inner.clone())
226 }
227
228 /// Lists information about the supported locations for this service.
229 ///
230 /// # Example
231 /// ```
232 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
233 /// use google_cloud_gax::paginator::ItemPaginator as _;
234 /// use google_cloud_cloudsecuritycompliance_v1::Result;
235 /// async fn sample(
236 /// client: &Audit
237 /// ) -> Result<()> {
238 /// let mut list = client.list_locations()
239 /// /* set fields */
240 /// .by_item();
241 /// while let Some(item) = list.next().await.transpose()? {
242 /// println!("{:?}", item);
243 /// }
244 /// Ok(())
245 /// }
246 /// ```
247 pub fn list_locations(&self) -> super::builder::audit::ListLocations {
248 super::builder::audit::ListLocations::new(self.inner.clone())
249 }
250
251 /// Gets information about a location.
252 ///
253 /// # Example
254 /// ```
255 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
256 /// use google_cloud_cloudsecuritycompliance_v1::Result;
257 /// async fn sample(
258 /// client: &Audit
259 /// ) -> Result<()> {
260 /// let response = client.get_location()
261 /// /* set fields */
262 /// .send().await?;
263 /// println!("response {:?}", response);
264 /// Ok(())
265 /// }
266 /// ```
267 pub fn get_location(&self) -> super::builder::audit::GetLocation {
268 super::builder::audit::GetLocation::new(self.inner.clone())
269 }
270
271 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
272 ///
273 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
274 ///
275 /// # Example
276 /// ```
277 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
278 /// use google_cloud_gax::paginator::ItemPaginator as _;
279 /// use google_cloud_cloudsecuritycompliance_v1::Result;
280 /// async fn sample(
281 /// client: &Audit
282 /// ) -> Result<()> {
283 /// let mut list = client.list_operations()
284 /// /* set fields */
285 /// .by_item();
286 /// while let Some(item) = list.next().await.transpose()? {
287 /// println!("{:?}", item);
288 /// }
289 /// Ok(())
290 /// }
291 /// ```
292 pub fn list_operations(&self) -> super::builder::audit::ListOperations {
293 super::builder::audit::ListOperations::new(self.inner.clone())
294 }
295
296 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
297 ///
298 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
299 ///
300 /// # Example
301 /// ```
302 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
303 /// use google_cloud_cloudsecuritycompliance_v1::Result;
304 /// async fn sample(
305 /// client: &Audit
306 /// ) -> Result<()> {
307 /// let response = client.get_operation()
308 /// /* set fields */
309 /// .send().await?;
310 /// println!("response {:?}", response);
311 /// Ok(())
312 /// }
313 /// ```
314 pub fn get_operation(&self) -> super::builder::audit::GetOperation {
315 super::builder::audit::GetOperation::new(self.inner.clone())
316 }
317
318 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
319 ///
320 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
321 ///
322 /// # Example
323 /// ```
324 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
325 /// use google_cloud_cloudsecuritycompliance_v1::Result;
326 /// async fn sample(
327 /// client: &Audit
328 /// ) -> Result<()> {
329 /// client.delete_operation()
330 /// /* set fields */
331 /// .send().await?;
332 /// Ok(())
333 /// }
334 /// ```
335 pub fn delete_operation(&self) -> super::builder::audit::DeleteOperation {
336 super::builder::audit::DeleteOperation::new(self.inner.clone())
337 }
338
339 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
340 ///
341 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
342 ///
343 /// # Example
344 /// ```
345 /// # use google_cloud_cloudsecuritycompliance_v1::client::Audit;
346 /// use google_cloud_cloudsecuritycompliance_v1::Result;
347 /// async fn sample(
348 /// client: &Audit
349 /// ) -> Result<()> {
350 /// client.cancel_operation()
351 /// /* set fields */
352 /// .send().await?;
353 /// Ok(())
354 /// }
355 /// ```
356 pub fn cancel_operation(&self) -> super::builder::audit::CancelOperation {
357 super::builder::audit::CancelOperation::new(self.inner.clone())
358 }
359}
360
361/// Implements a client for the Cloud Security Compliance API.
362///
363/// # Example
364/// ```
365/// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
366/// # extern crate wkt as google_cloud_wkt;
367/// use google_cloud_wkt::FieldMask;
368/// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
369/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
370/// let client = CmEnrollmentService::builder().build().await?;
371/// let name = "name_value";
372/// let response = client.update_cm_enrollment()
373/// .set_cm_enrollment(
374/// CmEnrollment::new().set_name(name)/* set fields */
375/// )
376/// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
377/// .send().await?;
378/// println!("response {:?}", response);
379/// # Ok(()) }
380/// ```
381///
382/// # Service Description
383///
384/// Service describing CmEnrollment related RPCs for
385/// complianceManager.
386///
387/// # Configuration
388///
389/// To configure `CmEnrollmentService` use the `with_*` methods in the type returned
390/// by [builder()][CmEnrollmentService::builder]. The default configuration should
391/// work for most applications. Common configuration changes include
392///
393/// * [with_endpoint()]: by default this client uses the global default endpoint
394/// (`https://cloudsecuritycompliance.googleapis.com`). Applications using regional
395/// endpoints or running in restricted networks (e.g. a network configured
396// with [Private Google Access with VPC Service Controls]) may want to
397/// override this default.
398/// * [with_credentials()]: by default this client uses
399/// [Application Default Credentials]. Applications using custom
400/// authentication may need to override this default.
401///
402/// [with_endpoint()]: super::builder::cm_enrollment_service::ClientBuilder::with_endpoint
403/// [with_credentials()]: super::builder::cm_enrollment_service::ClientBuilder::with_credentials
404/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
405/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
406///
407/// # Pooling and Cloning
408///
409/// `CmEnrollmentService` holds a connection pool internally, it is advised to
410/// create one and reuse it. You do not need to wrap `CmEnrollmentService` in
411/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
412/// already uses an `Arc` internally.
413#[derive(Clone, Debug)]
414pub struct CmEnrollmentService {
415 inner: std::sync::Arc<dyn super::stub::dynamic::CmEnrollmentService>,
416}
417
418impl CmEnrollmentService {
419 /// Returns a builder for [CmEnrollmentService].
420 ///
421 /// ```
422 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
423 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
424 /// let client = CmEnrollmentService::builder().build().await?;
425 /// # Ok(()) }
426 /// ```
427 pub fn builder() -> super::builder::cm_enrollment_service::ClientBuilder {
428 crate::new_client_builder(super::builder::cm_enrollment_service::client::Factory)
429 }
430
431 /// Creates a new client from the provided stub.
432 ///
433 /// The most common case for calling this function is in tests mocking the
434 /// client's behavior.
435 pub fn from_stub<T>(stub: T) -> Self
436 where
437 T: super::stub::CmEnrollmentService + 'static,
438 {
439 Self {
440 inner: std::sync::Arc::new(stub),
441 }
442 }
443
444 pub(crate) async fn new(
445 config: gaxi::options::ClientConfig,
446 ) -> crate::ClientBuilderResult<Self> {
447 let inner = Self::build_inner(config).await?;
448 Ok(Self { inner })
449 }
450
451 async fn build_inner(
452 conf: gaxi::options::ClientConfig,
453 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CmEnrollmentService>>
454 {
455 if gaxi::options::tracing_enabled(&conf) {
456 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
457 }
458 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
459 }
460
461 async fn build_transport(
462 conf: gaxi::options::ClientConfig,
463 ) -> crate::ClientBuilderResult<impl super::stub::CmEnrollmentService> {
464 super::transport::CmEnrollmentService::new(conf).await
465 }
466
467 async fn build_with_tracing(
468 conf: gaxi::options::ClientConfig,
469 ) -> crate::ClientBuilderResult<impl super::stub::CmEnrollmentService> {
470 Self::build_transport(conf)
471 .await
472 .map(super::tracing::CmEnrollmentService::new)
473 }
474
475 /// Updates the Compliance Manager enrollment for a resource to facilitate
476 /// an audit.
477 /// Use this method to enroll a resource in Compliance Manager or to
478 /// create or update feature-specific configurations.
479 ///
480 /// # Example
481 /// ```
482 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
483 /// # extern crate wkt as google_cloud_wkt;
484 /// use google_cloud_wkt::FieldMask;
485 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
486 /// use google_cloud_cloudsecuritycompliance_v1::Result;
487 /// async fn sample(
488 /// client: &CmEnrollmentService, name: &str
489 /// ) -> Result<()> {
490 /// let response = client.update_cm_enrollment()
491 /// .set_cm_enrollment(
492 /// CmEnrollment::new().set_name(name)/* set fields */
493 /// )
494 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
495 /// .send().await?;
496 /// println!("response {:?}", response);
497 /// Ok(())
498 /// }
499 /// ```
500 pub fn update_cm_enrollment(
501 &self,
502 ) -> super::builder::cm_enrollment_service::UpdateCmEnrollment {
503 super::builder::cm_enrollment_service::UpdateCmEnrollment::new(self.inner.clone())
504 }
505
506 /// Calculates the effective Compliance Manager enrollment for a resource.
507 /// An effective enrollment is either a direct enrollment of a
508 /// resource (if it exists), or an enrollment of the closest parent of a
509 /// resource that's enrolled in Compliance Manager.
510 ///
511 /// # Example
512 /// ```
513 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
514 /// use google_cloud_cloudsecuritycompliance_v1::Result;
515 /// async fn sample(
516 /// client: &CmEnrollmentService
517 /// ) -> Result<()> {
518 /// let response = client.calculate_effective_cm_enrollment()
519 /// /* set fields */
520 /// .send().await?;
521 /// println!("response {:?}", response);
522 /// Ok(())
523 /// }
524 /// ```
525 pub fn calculate_effective_cm_enrollment(
526 &self,
527 ) -> super::builder::cm_enrollment_service::CalculateEffectiveCmEnrollment {
528 super::builder::cm_enrollment_service::CalculateEffectiveCmEnrollment::new(
529 self.inner.clone(),
530 )
531 }
532
533 /// Lists information about the supported locations for this service.
534 ///
535 /// # Example
536 /// ```
537 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
538 /// use google_cloud_gax::paginator::ItemPaginator as _;
539 /// use google_cloud_cloudsecuritycompliance_v1::Result;
540 /// async fn sample(
541 /// client: &CmEnrollmentService
542 /// ) -> Result<()> {
543 /// let mut list = client.list_locations()
544 /// /* set fields */
545 /// .by_item();
546 /// while let Some(item) = list.next().await.transpose()? {
547 /// println!("{:?}", item);
548 /// }
549 /// Ok(())
550 /// }
551 /// ```
552 pub fn list_locations(&self) -> super::builder::cm_enrollment_service::ListLocations {
553 super::builder::cm_enrollment_service::ListLocations::new(self.inner.clone())
554 }
555
556 /// Gets information about a location.
557 ///
558 /// # Example
559 /// ```
560 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
561 /// use google_cloud_cloudsecuritycompliance_v1::Result;
562 /// async fn sample(
563 /// client: &CmEnrollmentService
564 /// ) -> Result<()> {
565 /// let response = client.get_location()
566 /// /* set fields */
567 /// .send().await?;
568 /// println!("response {:?}", response);
569 /// Ok(())
570 /// }
571 /// ```
572 pub fn get_location(&self) -> super::builder::cm_enrollment_service::GetLocation {
573 super::builder::cm_enrollment_service::GetLocation::new(self.inner.clone())
574 }
575
576 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
577 ///
578 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
579 ///
580 /// # Example
581 /// ```
582 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
583 /// use google_cloud_gax::paginator::ItemPaginator as _;
584 /// use google_cloud_cloudsecuritycompliance_v1::Result;
585 /// async fn sample(
586 /// client: &CmEnrollmentService
587 /// ) -> Result<()> {
588 /// let mut list = client.list_operations()
589 /// /* set fields */
590 /// .by_item();
591 /// while let Some(item) = list.next().await.transpose()? {
592 /// println!("{:?}", item);
593 /// }
594 /// Ok(())
595 /// }
596 /// ```
597 pub fn list_operations(&self) -> super::builder::cm_enrollment_service::ListOperations {
598 super::builder::cm_enrollment_service::ListOperations::new(self.inner.clone())
599 }
600
601 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
602 ///
603 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
604 ///
605 /// # Example
606 /// ```
607 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
608 /// use google_cloud_cloudsecuritycompliance_v1::Result;
609 /// async fn sample(
610 /// client: &CmEnrollmentService
611 /// ) -> Result<()> {
612 /// let response = client.get_operation()
613 /// /* set fields */
614 /// .send().await?;
615 /// println!("response {:?}", response);
616 /// Ok(())
617 /// }
618 /// ```
619 pub fn get_operation(&self) -> super::builder::cm_enrollment_service::GetOperation {
620 super::builder::cm_enrollment_service::GetOperation::new(self.inner.clone())
621 }
622
623 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
624 ///
625 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
626 ///
627 /// # Example
628 /// ```
629 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
630 /// use google_cloud_cloudsecuritycompliance_v1::Result;
631 /// async fn sample(
632 /// client: &CmEnrollmentService
633 /// ) -> Result<()> {
634 /// client.delete_operation()
635 /// /* set fields */
636 /// .send().await?;
637 /// Ok(())
638 /// }
639 /// ```
640 pub fn delete_operation(&self) -> super::builder::cm_enrollment_service::DeleteOperation {
641 super::builder::cm_enrollment_service::DeleteOperation::new(self.inner.clone())
642 }
643
644 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
645 ///
646 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
647 ///
648 /// # Example
649 /// ```
650 /// # use google_cloud_cloudsecuritycompliance_v1::client::CmEnrollmentService;
651 /// use google_cloud_cloudsecuritycompliance_v1::Result;
652 /// async fn sample(
653 /// client: &CmEnrollmentService
654 /// ) -> Result<()> {
655 /// client.cancel_operation()
656 /// /* set fields */
657 /// .send().await?;
658 /// Ok(())
659 /// }
660 /// ```
661 pub fn cancel_operation(&self) -> super::builder::cm_enrollment_service::CancelOperation {
662 super::builder::cm_enrollment_service::CancelOperation::new(self.inner.clone())
663 }
664}
665
666/// Implements a client for the Cloud Security Compliance API.
667///
668/// # Example
669/// ```
670/// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
671/// use google_cloud_gax::paginator::ItemPaginator as _;
672/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
673/// let client = Config::builder().build().await?;
674/// let parent = "parent_value";
675/// let mut list = client.list_frameworks()
676/// .set_parent(parent)
677/// .by_item();
678/// while let Some(item) = list.next().await.transpose()? {
679/// println!("{:?}", item);
680/// }
681/// # Ok(()) }
682/// ```
683///
684/// # Service Description
685///
686/// Config Service manages compliance frameworks, cloud controls, and their
687/// configurations.
688///
689/// # Configuration
690///
691/// To configure `Config` use the `with_*` methods in the type returned
692/// by [builder()][Config::builder]. The default configuration should
693/// work for most applications. Common configuration changes include
694///
695/// * [with_endpoint()]: by default this client uses the global default endpoint
696/// (`https://cloudsecuritycompliance.googleapis.com`). Applications using regional
697/// endpoints or running in restricted networks (e.g. a network configured
698// with [Private Google Access with VPC Service Controls]) may want to
699/// override this default.
700/// * [with_credentials()]: by default this client uses
701/// [Application Default Credentials]. Applications using custom
702/// authentication may need to override this default.
703///
704/// [with_endpoint()]: super::builder::config::ClientBuilder::with_endpoint
705/// [with_credentials()]: super::builder::config::ClientBuilder::with_credentials
706/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
707/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
708///
709/// # Pooling and Cloning
710///
711/// `Config` holds a connection pool internally, it is advised to
712/// create one and reuse it. You do not need to wrap `Config` in
713/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
714/// already uses an `Arc` internally.
715#[derive(Clone, Debug)]
716pub struct Config {
717 inner: std::sync::Arc<dyn super::stub::dynamic::Config>,
718}
719
720impl Config {
721 /// Returns a builder for [Config].
722 ///
723 /// ```
724 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
725 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
726 /// let client = Config::builder().build().await?;
727 /// # Ok(()) }
728 /// ```
729 pub fn builder() -> super::builder::config::ClientBuilder {
730 crate::new_client_builder(super::builder::config::client::Factory)
731 }
732
733 /// Creates a new client from the provided stub.
734 ///
735 /// The most common case for calling this function is in tests mocking the
736 /// client's behavior.
737 pub fn from_stub<T>(stub: T) -> Self
738 where
739 T: super::stub::Config + 'static,
740 {
741 Self {
742 inner: std::sync::Arc::new(stub),
743 }
744 }
745
746 pub(crate) async fn new(
747 config: gaxi::options::ClientConfig,
748 ) -> crate::ClientBuilderResult<Self> {
749 let inner = Self::build_inner(config).await?;
750 Ok(Self { inner })
751 }
752
753 async fn build_inner(
754 conf: gaxi::options::ClientConfig,
755 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Config>> {
756 if gaxi::options::tracing_enabled(&conf) {
757 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
758 }
759 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
760 }
761
762 async fn build_transport(
763 conf: gaxi::options::ClientConfig,
764 ) -> crate::ClientBuilderResult<impl super::stub::Config> {
765 super::transport::Config::new(conf).await
766 }
767
768 async fn build_with_tracing(
769 conf: gaxi::options::ClientConfig,
770 ) -> crate::ClientBuilderResult<impl super::stub::Config> {
771 Self::build_transport(conf)
772 .await
773 .map(super::tracing::Config::new)
774 }
775
776 /// Lists the frameworks (both built-in and custom) that are available within
777 /// the parent resource. The latest major version of each framework is
778 /// returned.
779 /// This method supports pagination.
780 ///
781 /// # Example
782 /// ```
783 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
784 /// use google_cloud_gax::paginator::ItemPaginator as _;
785 /// use google_cloud_cloudsecuritycompliance_v1::Result;
786 /// async fn sample(
787 /// client: &Config, parent: &str
788 /// ) -> Result<()> {
789 /// let mut list = client.list_frameworks()
790 /// .set_parent(parent)
791 /// .by_item();
792 /// while let Some(item) = list.next().await.transpose()? {
793 /// println!("{:?}", item);
794 /// }
795 /// Ok(())
796 /// }
797 /// ```
798 pub fn list_frameworks(&self) -> super::builder::config::ListFrameworks {
799 super::builder::config::ListFrameworks::new(self.inner.clone())
800 }
801
802 /// Gets details about a framework.
803 /// This method retrieves the latest major version of the framework.
804 ///
805 /// To retrieve a specific major version, include `major_revision_id` in
806 /// the request.
807 ///
808 /// # Example
809 /// ```
810 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
811 /// use google_cloud_cloudsecuritycompliance_v1::Result;
812 /// async fn sample(
813 /// client: &Config, name: &str
814 /// ) -> Result<()> {
815 /// let response = client.get_framework()
816 /// .set_name(name)
817 /// .send().await?;
818 /// println!("response {:?}", response);
819 /// Ok(())
820 /// }
821 /// ```
822 pub fn get_framework(&self) -> super::builder::config::GetFramework {
823 super::builder::config::GetFramework::new(self.inner.clone())
824 }
825
826 /// Creates a custom framework in a given parent resource.
827 /// You can't create built-in frameworks because those are managed by
828 /// Google.
829 ///
830 /// # Example
831 /// ```
832 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
833 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
834 /// use google_cloud_cloudsecuritycompliance_v1::Result;
835 /// async fn sample(
836 /// client: &Config, parent: &str
837 /// ) -> Result<()> {
838 /// let response = client.create_framework()
839 /// .set_parent(parent)
840 /// .set_framework_id("framework_id_value")
841 /// .set_framework(
842 /// Framework::new()/* set fields */
843 /// )
844 /// .send().await?;
845 /// println!("response {:?}", response);
846 /// Ok(())
847 /// }
848 /// ```
849 pub fn create_framework(&self) -> super::builder::config::CreateFramework {
850 super::builder::config::CreateFramework::new(self.inner.clone())
851 }
852
853 /// Updates a custom framework.
854 /// This method allows for partial updates of a framework. Use the
855 /// `update_mask` to specify which fields to update. Consider the following:
856 ///
857 /// - If you provide an `update_mask`, only the fields that are specified
858 /// in the mask are updated.
859 /// - If you don't provide an `update_mask`, all the fields that are present
860 /// in the request's `framework` body are used to overwrite the existing
861 /// resource.
862 ///
863 /// You can only update frameworks with the `CUSTOM` type.
864 /// A successful update creates a new version of the framework.
865 ///
866 /// # Example
867 /// ```
868 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
869 /// # extern crate wkt as google_cloud_wkt;
870 /// use google_cloud_wkt::FieldMask;
871 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
872 /// use google_cloud_cloudsecuritycompliance_v1::Result;
873 /// async fn sample(
874 /// client: &Config, name: &str
875 /// ) -> Result<()> {
876 /// let response = client.update_framework()
877 /// .set_framework(
878 /// Framework::new().set_name(name)/* set fields */
879 /// )
880 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
881 /// .send().await?;
882 /// println!("response {:?}", response);
883 /// Ok(())
884 /// }
885 /// ```
886 pub fn update_framework(&self) -> super::builder::config::UpdateFramework {
887 super::builder::config::UpdateFramework::new(self.inner.clone())
888 }
889
890 /// Deletes a custom framework, including all its major and
891 /// minor revisions. Consider the following:
892 ///
893 /// - You can't delete built-in frameworks. You can only delete frameworks
894 /// with type `CUSTOM`.
895 /// - You can't delete frameworks that are deployed to a resource.
896 /// - You can't restore a deleted framework. This action is permanent.
897 ///
898 /// # Example
899 /// ```
900 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
901 /// use google_cloud_cloudsecuritycompliance_v1::Result;
902 /// async fn sample(
903 /// client: &Config, name: &str
904 /// ) -> Result<()> {
905 /// client.delete_framework()
906 /// .set_name(name)
907 /// .send().await?;
908 /// Ok(())
909 /// }
910 /// ```
911 pub fn delete_framework(&self) -> super::builder::config::DeleteFramework {
912 super::builder::config::DeleteFramework::new(self.inner.clone())
913 }
914
915 /// Lists the cloud controls (both built-in and custom) that are available
916 /// in a given parent resource. The latest major version of each cloud control
917 /// is returned.
918 /// This method supports pagination.
919 ///
920 /// # Example
921 /// ```
922 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
923 /// use google_cloud_gax::paginator::ItemPaginator as _;
924 /// use google_cloud_cloudsecuritycompliance_v1::Result;
925 /// async fn sample(
926 /// client: &Config, parent: &str
927 /// ) -> Result<()> {
928 /// let mut list = client.list_cloud_controls()
929 /// .set_parent(parent)
930 /// .by_item();
931 /// while let Some(item) = list.next().await.transpose()? {
932 /// println!("{:?}", item);
933 /// }
934 /// Ok(())
935 /// }
936 /// ```
937 pub fn list_cloud_controls(&self) -> super::builder::config::ListCloudControls {
938 super::builder::config::ListCloudControls::new(self.inner.clone())
939 }
940
941 /// Gets details about a cloud control.
942 /// This method retrieves the latest major version of a cloud control that
943 /// you identify by name.
944 ///
945 /// By default, the latest major version of the cloud control is returned.
946 /// To retrieve a specific major version, include `major_revision_id` in
947 /// the request.
948 ///
949 /// # Example
950 /// ```
951 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
952 /// use google_cloud_cloudsecuritycompliance_v1::Result;
953 /// async fn sample(
954 /// client: &Config, name: &str
955 /// ) -> Result<()> {
956 /// let response = client.get_cloud_control()
957 /// .set_name(name)
958 /// .send().await?;
959 /// println!("response {:?}", response);
960 /// Ok(())
961 /// }
962 /// ```
963 pub fn get_cloud_control(&self) -> super::builder::config::GetCloudControl {
964 super::builder::config::GetCloudControl::new(self.inner.clone())
965 }
966
967 /// Creates a custom cloud control in a given parent
968 /// resource.
969 /// You can't create built-in cloud controls because those are managed by
970 /// Google.
971 ///
972 /// # Example
973 /// ```
974 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
975 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
976 /// use google_cloud_cloudsecuritycompliance_v1::Result;
977 /// async fn sample(
978 /// client: &Config, parent: &str
979 /// ) -> Result<()> {
980 /// let response = client.create_cloud_control()
981 /// .set_parent(parent)
982 /// .set_cloud_control(
983 /// CloudControl::new()/* set fields */
984 /// )
985 /// .send().await?;
986 /// println!("response {:?}", response);
987 /// Ok(())
988 /// }
989 /// ```
990 pub fn create_cloud_control(&self) -> super::builder::config::CreateCloudControl {
991 super::builder::config::CreateCloudControl::new(self.inner.clone())
992 }
993
994 /// Updates a custom cloud control.
995 /// This method allows for partial updates of a cloud control. Use the
996 /// `update_mask` to specify which fields to update. Consider the following:
997 ///
998 /// - If you provide an `update_mask`, only the fields that are specified
999 /// in the mask are updated.
1000 /// - If you don't provide an `update_mask`, all the fields that are present
1001 /// in the request's `cloud_control` body are used to overwrite the existing
1002 /// resource.
1003 ///
1004 /// You can only update cloud controls with the `CUSTOM` type.
1005 /// A successful update creates a new version of the cloud control.
1006 ///
1007 /// # Example
1008 /// ```
1009 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1010 /// # extern crate wkt as google_cloud_wkt;
1011 /// use google_cloud_wkt::FieldMask;
1012 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
1013 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1014 /// async fn sample(
1015 /// client: &Config, name: &str
1016 /// ) -> Result<()> {
1017 /// let response = client.update_cloud_control()
1018 /// .set_cloud_control(
1019 /// CloudControl::new().set_name(name)/* set fields */
1020 /// )
1021 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1022 /// .send().await?;
1023 /// println!("response {:?}", response);
1024 /// Ok(())
1025 /// }
1026 /// ```
1027 pub fn update_cloud_control(&self) -> super::builder::config::UpdateCloudControl {
1028 super::builder::config::UpdateCloudControl::new(self.inner.clone())
1029 }
1030
1031 /// Deletes a custom cloud control, including all its
1032 /// major and minor revisions. Consider the following:
1033 ///
1034 /// - You can't delete built-in cloud controls. You can only delete cloud
1035 /// controls with type `CUSTOM`.
1036 /// - You can't delete cloud controls if any of the versions are referenced
1037 /// by a framework.
1038 /// - You can't restore a deleted cloud control. This action is permanent.
1039 ///
1040 /// # Example
1041 /// ```
1042 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1043 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1044 /// async fn sample(
1045 /// client: &Config, name: &str
1046 /// ) -> Result<()> {
1047 /// client.delete_cloud_control()
1048 /// .set_name(name)
1049 /// .send().await?;
1050 /// Ok(())
1051 /// }
1052 /// ```
1053 pub fn delete_cloud_control(&self) -> super::builder::config::DeleteCloudControl {
1054 super::builder::config::DeleteCloudControl::new(self.inner.clone())
1055 }
1056
1057 /// Lists information about the supported locations for this service.
1058 ///
1059 /// # Example
1060 /// ```
1061 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1062 /// use google_cloud_gax::paginator::ItemPaginator as _;
1063 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1064 /// async fn sample(
1065 /// client: &Config
1066 /// ) -> Result<()> {
1067 /// let mut list = client.list_locations()
1068 /// /* set fields */
1069 /// .by_item();
1070 /// while let Some(item) = list.next().await.transpose()? {
1071 /// println!("{:?}", item);
1072 /// }
1073 /// Ok(())
1074 /// }
1075 /// ```
1076 pub fn list_locations(&self) -> super::builder::config::ListLocations {
1077 super::builder::config::ListLocations::new(self.inner.clone())
1078 }
1079
1080 /// Gets information about a location.
1081 ///
1082 /// # Example
1083 /// ```
1084 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1085 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1086 /// async fn sample(
1087 /// client: &Config
1088 /// ) -> Result<()> {
1089 /// let response = client.get_location()
1090 /// /* set fields */
1091 /// .send().await?;
1092 /// println!("response {:?}", response);
1093 /// Ok(())
1094 /// }
1095 /// ```
1096 pub fn get_location(&self) -> super::builder::config::GetLocation {
1097 super::builder::config::GetLocation::new(self.inner.clone())
1098 }
1099
1100 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1101 ///
1102 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1103 ///
1104 /// # Example
1105 /// ```
1106 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1107 /// use google_cloud_gax::paginator::ItemPaginator as _;
1108 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1109 /// async fn sample(
1110 /// client: &Config
1111 /// ) -> Result<()> {
1112 /// let mut list = client.list_operations()
1113 /// /* set fields */
1114 /// .by_item();
1115 /// while let Some(item) = list.next().await.transpose()? {
1116 /// println!("{:?}", item);
1117 /// }
1118 /// Ok(())
1119 /// }
1120 /// ```
1121 pub fn list_operations(&self) -> super::builder::config::ListOperations {
1122 super::builder::config::ListOperations::new(self.inner.clone())
1123 }
1124
1125 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1126 ///
1127 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1128 ///
1129 /// # Example
1130 /// ```
1131 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1132 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1133 /// async fn sample(
1134 /// client: &Config
1135 /// ) -> Result<()> {
1136 /// let response = client.get_operation()
1137 /// /* set fields */
1138 /// .send().await?;
1139 /// println!("response {:?}", response);
1140 /// Ok(())
1141 /// }
1142 /// ```
1143 pub fn get_operation(&self) -> super::builder::config::GetOperation {
1144 super::builder::config::GetOperation::new(self.inner.clone())
1145 }
1146
1147 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1148 ///
1149 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1150 ///
1151 /// # Example
1152 /// ```
1153 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1154 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1155 /// async fn sample(
1156 /// client: &Config
1157 /// ) -> Result<()> {
1158 /// client.delete_operation()
1159 /// /* set fields */
1160 /// .send().await?;
1161 /// Ok(())
1162 /// }
1163 /// ```
1164 pub fn delete_operation(&self) -> super::builder::config::DeleteOperation {
1165 super::builder::config::DeleteOperation::new(self.inner.clone())
1166 }
1167
1168 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1169 ///
1170 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1171 ///
1172 /// # Example
1173 /// ```
1174 /// # use google_cloud_cloudsecuritycompliance_v1::client::Config;
1175 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1176 /// async fn sample(
1177 /// client: &Config
1178 /// ) -> Result<()> {
1179 /// client.cancel_operation()
1180 /// /* set fields */
1181 /// .send().await?;
1182 /// Ok(())
1183 /// }
1184 /// ```
1185 pub fn cancel_operation(&self) -> super::builder::config::CancelOperation {
1186 super::builder::config::CancelOperation::new(self.inner.clone())
1187 }
1188}
1189
1190/// Implements a client for the Cloud Security Compliance API.
1191///
1192/// # Example
1193/// ```
1194/// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1195/// use google_cloud_gax::paginator::ItemPaginator as _;
1196/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1197/// let client = Deployment::builder().build().await?;
1198/// let parent = "parent_value";
1199/// let mut list = client.list_framework_deployments()
1200/// .set_parent(parent)
1201/// .by_item();
1202/// while let Some(item) = list.next().await.transpose()? {
1203/// println!("{:?}", item);
1204/// }
1205/// # Ok(()) }
1206/// ```
1207///
1208/// # Service Description
1209///
1210/// Deployment service allows users to manage deployments of Frameworks and
1211/// Cloud Controls on a target resource.
1212///
1213/// # Configuration
1214///
1215/// To configure `Deployment` use the `with_*` methods in the type returned
1216/// by [builder()][Deployment::builder]. The default configuration should
1217/// work for most applications. Common configuration changes include
1218///
1219/// * [with_endpoint()]: by default this client uses the global default endpoint
1220/// (`https://cloudsecuritycompliance.googleapis.com`). Applications using regional
1221/// endpoints or running in restricted networks (e.g. a network configured
1222// with [Private Google Access with VPC Service Controls]) may want to
1223/// override this default.
1224/// * [with_credentials()]: by default this client uses
1225/// [Application Default Credentials]. Applications using custom
1226/// authentication may need to override this default.
1227///
1228/// [with_endpoint()]: super::builder::deployment::ClientBuilder::with_endpoint
1229/// [with_credentials()]: super::builder::deployment::ClientBuilder::with_credentials
1230/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1231/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1232///
1233/// # Pooling and Cloning
1234///
1235/// `Deployment` holds a connection pool internally, it is advised to
1236/// create one and reuse it. You do not need to wrap `Deployment` in
1237/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1238/// already uses an `Arc` internally.
1239#[derive(Clone, Debug)]
1240pub struct Deployment {
1241 inner: std::sync::Arc<dyn super::stub::dynamic::Deployment>,
1242}
1243
1244impl Deployment {
1245 /// Returns a builder for [Deployment].
1246 ///
1247 /// ```
1248 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1249 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1250 /// let client = Deployment::builder().build().await?;
1251 /// # Ok(()) }
1252 /// ```
1253 pub fn builder() -> super::builder::deployment::ClientBuilder {
1254 crate::new_client_builder(super::builder::deployment::client::Factory)
1255 }
1256
1257 /// Creates a new client from the provided stub.
1258 ///
1259 /// The most common case for calling this function is in tests mocking the
1260 /// client's behavior.
1261 pub fn from_stub<T>(stub: T) -> Self
1262 where
1263 T: super::stub::Deployment + 'static,
1264 {
1265 Self {
1266 inner: std::sync::Arc::new(stub),
1267 }
1268 }
1269
1270 pub(crate) async fn new(
1271 config: gaxi::options::ClientConfig,
1272 ) -> crate::ClientBuilderResult<Self> {
1273 let inner = Self::build_inner(config).await?;
1274 Ok(Self { inner })
1275 }
1276
1277 async fn build_inner(
1278 conf: gaxi::options::ClientConfig,
1279 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Deployment>> {
1280 if gaxi::options::tracing_enabled(&conf) {
1281 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1282 }
1283 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1284 }
1285
1286 async fn build_transport(
1287 conf: gaxi::options::ClientConfig,
1288 ) -> crate::ClientBuilderResult<impl super::stub::Deployment> {
1289 super::transport::Deployment::new(conf).await
1290 }
1291
1292 async fn build_with_tracing(
1293 conf: gaxi::options::ClientConfig,
1294 ) -> crate::ClientBuilderResult<impl super::stub::Deployment> {
1295 Self::build_transport(conf)
1296 .await
1297 .map(super::tracing::Deployment::new)
1298 }
1299
1300 /// Creates a framework deployment in a given parent resource. A
1301 /// framework deployment lets you assign a particular framework version to an
1302 /// organization, folder, or project so that you can control and monitor
1303 /// those resources using the framework's cloud controls.
1304 ///
1305 /// # Long running operations
1306 ///
1307 /// This method is used to start, and/or poll a [long-running Operation].
1308 /// The [Working with long-running operations] chapter in the [user guide]
1309 /// covers these operations in detail.
1310 ///
1311 /// [long-running operation]: https://google.aip.dev/151
1312 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1313 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1314 ///
1315 /// # Example
1316 /// ```
1317 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1318 /// use google_cloud_lro::Poller;
1319 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
1320 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1321 /// async fn sample(
1322 /// client: &Deployment, parent: &str
1323 /// ) -> Result<()> {
1324 /// let response = client.create_framework_deployment()
1325 /// .set_parent(parent)
1326 /// .set_framework_deployment(
1327 /// FrameworkDeployment::new()/* set fields */
1328 /// )
1329 /// .poller().until_done().await?;
1330 /// println!("response {:?}", response);
1331 /// Ok(())
1332 /// }
1333 /// ```
1334 pub fn create_framework_deployment(
1335 &self,
1336 ) -> super::builder::deployment::CreateFrameworkDeployment {
1337 super::builder::deployment::CreateFrameworkDeployment::new(self.inner.clone())
1338 }
1339
1340 /// Deletes a framework deployment.
1341 ///
1342 /// # Long running operations
1343 ///
1344 /// This method is used to start, and/or poll a [long-running Operation].
1345 /// The [Working with long-running operations] chapter in the [user guide]
1346 /// covers these operations in detail.
1347 ///
1348 /// [long-running operation]: https://google.aip.dev/151
1349 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1350 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1351 ///
1352 /// # Example
1353 /// ```
1354 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1355 /// use google_cloud_lro::Poller;
1356 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1357 /// async fn sample(
1358 /// client: &Deployment, name: &str
1359 /// ) -> Result<()> {
1360 /// client.delete_framework_deployment()
1361 /// .set_name(name)
1362 /// .poller().until_done().await?;
1363 /// Ok(())
1364 /// }
1365 /// ```
1366 pub fn delete_framework_deployment(
1367 &self,
1368 ) -> super::builder::deployment::DeleteFrameworkDeployment {
1369 super::builder::deployment::DeleteFrameworkDeployment::new(self.inner.clone())
1370 }
1371
1372 /// Gets details about a framework deployment.
1373 ///
1374 /// # Example
1375 /// ```
1376 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1377 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1378 /// async fn sample(
1379 /// client: &Deployment, name: &str
1380 /// ) -> Result<()> {
1381 /// let response = client.get_framework_deployment()
1382 /// .set_name(name)
1383 /// .send().await?;
1384 /// println!("response {:?}", response);
1385 /// Ok(())
1386 /// }
1387 /// ```
1388 pub fn get_framework_deployment(&self) -> super::builder::deployment::GetFrameworkDeployment {
1389 super::builder::deployment::GetFrameworkDeployment::new(self.inner.clone())
1390 }
1391
1392 /// Lists the framework deployments in a given parent resource.
1393 ///
1394 /// # Example
1395 /// ```
1396 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1397 /// use google_cloud_gax::paginator::ItemPaginator as _;
1398 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1399 /// async fn sample(
1400 /// client: &Deployment, parent: &str
1401 /// ) -> Result<()> {
1402 /// let mut list = client.list_framework_deployments()
1403 /// .set_parent(parent)
1404 /// .by_item();
1405 /// while let Some(item) = list.next().await.transpose()? {
1406 /// println!("{:?}", item);
1407 /// }
1408 /// Ok(())
1409 /// }
1410 /// ```
1411 pub fn list_framework_deployments(
1412 &self,
1413 ) -> super::builder::deployment::ListFrameworkDeployments {
1414 super::builder::deployment::ListFrameworkDeployments::new(self.inner.clone())
1415 }
1416
1417 /// Gets details about a cloud control deployment.
1418 ///
1419 /// # Example
1420 /// ```
1421 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1422 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1423 /// async fn sample(
1424 /// client: &Deployment, name: &str
1425 /// ) -> Result<()> {
1426 /// let response = client.get_cloud_control_deployment()
1427 /// .set_name(name)
1428 /// .send().await?;
1429 /// println!("response {:?}", response);
1430 /// Ok(())
1431 /// }
1432 /// ```
1433 pub fn get_cloud_control_deployment(
1434 &self,
1435 ) -> super::builder::deployment::GetCloudControlDeployment {
1436 super::builder::deployment::GetCloudControlDeployment::new(self.inner.clone())
1437 }
1438
1439 /// Lists the cloud conrol deployments in a given parent resource.
1440 ///
1441 /// # Example
1442 /// ```
1443 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1444 /// use google_cloud_gax::paginator::ItemPaginator as _;
1445 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1446 /// async fn sample(
1447 /// client: &Deployment, parent: &str
1448 /// ) -> Result<()> {
1449 /// let mut list = client.list_cloud_control_deployments()
1450 /// .set_parent(parent)
1451 /// .by_item();
1452 /// while let Some(item) = list.next().await.transpose()? {
1453 /// println!("{:?}", item);
1454 /// }
1455 /// Ok(())
1456 /// }
1457 /// ```
1458 pub fn list_cloud_control_deployments(
1459 &self,
1460 ) -> super::builder::deployment::ListCloudControlDeployments {
1461 super::builder::deployment::ListCloudControlDeployments::new(self.inner.clone())
1462 }
1463
1464 /// Lists information about the supported locations for this service.
1465 ///
1466 /// # Example
1467 /// ```
1468 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1469 /// use google_cloud_gax::paginator::ItemPaginator as _;
1470 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1471 /// async fn sample(
1472 /// client: &Deployment
1473 /// ) -> Result<()> {
1474 /// let mut list = client.list_locations()
1475 /// /* set fields */
1476 /// .by_item();
1477 /// while let Some(item) = list.next().await.transpose()? {
1478 /// println!("{:?}", item);
1479 /// }
1480 /// Ok(())
1481 /// }
1482 /// ```
1483 pub fn list_locations(&self) -> super::builder::deployment::ListLocations {
1484 super::builder::deployment::ListLocations::new(self.inner.clone())
1485 }
1486
1487 /// Gets information about a location.
1488 ///
1489 /// # Example
1490 /// ```
1491 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1492 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1493 /// async fn sample(
1494 /// client: &Deployment
1495 /// ) -> Result<()> {
1496 /// let response = client.get_location()
1497 /// /* set fields */
1498 /// .send().await?;
1499 /// println!("response {:?}", response);
1500 /// Ok(())
1501 /// }
1502 /// ```
1503 pub fn get_location(&self) -> super::builder::deployment::GetLocation {
1504 super::builder::deployment::GetLocation::new(self.inner.clone())
1505 }
1506
1507 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1508 ///
1509 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1510 ///
1511 /// # Example
1512 /// ```
1513 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1514 /// use google_cloud_gax::paginator::ItemPaginator as _;
1515 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1516 /// async fn sample(
1517 /// client: &Deployment
1518 /// ) -> Result<()> {
1519 /// let mut list = client.list_operations()
1520 /// /* set fields */
1521 /// .by_item();
1522 /// while let Some(item) = list.next().await.transpose()? {
1523 /// println!("{:?}", item);
1524 /// }
1525 /// Ok(())
1526 /// }
1527 /// ```
1528 pub fn list_operations(&self) -> super::builder::deployment::ListOperations {
1529 super::builder::deployment::ListOperations::new(self.inner.clone())
1530 }
1531
1532 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1533 ///
1534 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1535 ///
1536 /// # Example
1537 /// ```
1538 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1539 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1540 /// async fn sample(
1541 /// client: &Deployment
1542 /// ) -> Result<()> {
1543 /// let response = client.get_operation()
1544 /// /* set fields */
1545 /// .send().await?;
1546 /// println!("response {:?}", response);
1547 /// Ok(())
1548 /// }
1549 /// ```
1550 pub fn get_operation(&self) -> super::builder::deployment::GetOperation {
1551 super::builder::deployment::GetOperation::new(self.inner.clone())
1552 }
1553
1554 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1555 ///
1556 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1557 ///
1558 /// # Example
1559 /// ```
1560 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1561 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1562 /// async fn sample(
1563 /// client: &Deployment
1564 /// ) -> Result<()> {
1565 /// client.delete_operation()
1566 /// /* set fields */
1567 /// .send().await?;
1568 /// Ok(())
1569 /// }
1570 /// ```
1571 pub fn delete_operation(&self) -> super::builder::deployment::DeleteOperation {
1572 super::builder::deployment::DeleteOperation::new(self.inner.clone())
1573 }
1574
1575 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1576 ///
1577 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1578 ///
1579 /// # Example
1580 /// ```
1581 /// # use google_cloud_cloudsecuritycompliance_v1::client::Deployment;
1582 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1583 /// async fn sample(
1584 /// client: &Deployment
1585 /// ) -> Result<()> {
1586 /// client.cancel_operation()
1587 /// /* set fields */
1588 /// .send().await?;
1589 /// Ok(())
1590 /// }
1591 /// ```
1592 pub fn cancel_operation(&self) -> super::builder::deployment::CancelOperation {
1593 super::builder::deployment::CancelOperation::new(self.inner.clone())
1594 }
1595}
1596
1597/// Implements a client for the Cloud Security Compliance API.
1598///
1599/// # Example
1600/// ```
1601/// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1602/// use google_cloud_gax::paginator::ItemPaginator as _;
1603/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1604/// let client = Monitoring::builder().build().await?;
1605/// let parent = "parent_value";
1606/// let mut list = client.list_framework_compliance_summaries()
1607/// .set_parent(parent)
1608/// .by_item();
1609/// while let Some(item) = list.next().await.transpose()? {
1610/// println!("{:?}", item);
1611/// }
1612/// # Ok(()) }
1613/// ```
1614///
1615/// # Service Description
1616///
1617/// Service describing handlers for resources
1618///
1619/// # Configuration
1620///
1621/// To configure `Monitoring` use the `with_*` methods in the type returned
1622/// by [builder()][Monitoring::builder]. The default configuration should
1623/// work for most applications. Common configuration changes include
1624///
1625/// * [with_endpoint()]: by default this client uses the global default endpoint
1626/// (`https://cloudsecuritycompliance.googleapis.com`). Applications using regional
1627/// endpoints or running in restricted networks (e.g. a network configured
1628// with [Private Google Access with VPC Service Controls]) may want to
1629/// override this default.
1630/// * [with_credentials()]: by default this client uses
1631/// [Application Default Credentials]. Applications using custom
1632/// authentication may need to override this default.
1633///
1634/// [with_endpoint()]: super::builder::monitoring::ClientBuilder::with_endpoint
1635/// [with_credentials()]: super::builder::monitoring::ClientBuilder::with_credentials
1636/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1637/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1638///
1639/// # Pooling and Cloning
1640///
1641/// `Monitoring` holds a connection pool internally, it is advised to
1642/// create one and reuse it. You do not need to wrap `Monitoring` in
1643/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1644/// already uses an `Arc` internally.
1645#[derive(Clone, Debug)]
1646pub struct Monitoring {
1647 inner: std::sync::Arc<dyn super::stub::dynamic::Monitoring>,
1648}
1649
1650impl Monitoring {
1651 /// Returns a builder for [Monitoring].
1652 ///
1653 /// ```
1654 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1655 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1656 /// let client = Monitoring::builder().build().await?;
1657 /// # Ok(()) }
1658 /// ```
1659 pub fn builder() -> super::builder::monitoring::ClientBuilder {
1660 crate::new_client_builder(super::builder::monitoring::client::Factory)
1661 }
1662
1663 /// Creates a new client from the provided stub.
1664 ///
1665 /// The most common case for calling this function is in tests mocking the
1666 /// client's behavior.
1667 pub fn from_stub<T>(stub: T) -> Self
1668 where
1669 T: super::stub::Monitoring + 'static,
1670 {
1671 Self {
1672 inner: std::sync::Arc::new(stub),
1673 }
1674 }
1675
1676 pub(crate) async fn new(
1677 config: gaxi::options::ClientConfig,
1678 ) -> crate::ClientBuilderResult<Self> {
1679 let inner = Self::build_inner(config).await?;
1680 Ok(Self { inner })
1681 }
1682
1683 async fn build_inner(
1684 conf: gaxi::options::ClientConfig,
1685 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Monitoring>> {
1686 if gaxi::options::tracing_enabled(&conf) {
1687 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1688 }
1689 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1690 }
1691
1692 async fn build_transport(
1693 conf: gaxi::options::ClientConfig,
1694 ) -> crate::ClientBuilderResult<impl super::stub::Monitoring> {
1695 super::transport::Monitoring::new(conf).await
1696 }
1697
1698 async fn build_with_tracing(
1699 conf: gaxi::options::ClientConfig,
1700 ) -> crate::ClientBuilderResult<impl super::stub::Monitoring> {
1701 Self::build_transport(conf)
1702 .await
1703 .map(super::tracing::Monitoring::new)
1704 }
1705
1706 /// Lists the framework compliance summary for a given scope.
1707 ///
1708 /// # Example
1709 /// ```
1710 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1711 /// use google_cloud_gax::paginator::ItemPaginator as _;
1712 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1713 /// async fn sample(
1714 /// client: &Monitoring, parent: &str
1715 /// ) -> Result<()> {
1716 /// let mut list = client.list_framework_compliance_summaries()
1717 /// .set_parent(parent)
1718 /// .by_item();
1719 /// while let Some(item) = list.next().await.transpose()? {
1720 /// println!("{:?}", item);
1721 /// }
1722 /// Ok(())
1723 /// }
1724 /// ```
1725 pub fn list_framework_compliance_summaries(
1726 &self,
1727 ) -> super::builder::monitoring::ListFrameworkComplianceSummaries {
1728 super::builder::monitoring::ListFrameworkComplianceSummaries::new(self.inner.clone())
1729 }
1730
1731 /// Lists the finding summary by category for a given scope.
1732 ///
1733 /// # Example
1734 /// ```
1735 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1736 /// use google_cloud_gax::paginator::ItemPaginator as _;
1737 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1738 /// async fn sample(
1739 /// client: &Monitoring, parent: &str
1740 /// ) -> Result<()> {
1741 /// let mut list = client.list_finding_summaries()
1742 /// .set_parent(parent)
1743 /// .by_item();
1744 /// while let Some(item) = list.next().await.transpose()? {
1745 /// println!("{:?}", item);
1746 /// }
1747 /// Ok(())
1748 /// }
1749 /// ```
1750 pub fn list_finding_summaries(&self) -> super::builder::monitoring::ListFindingSummaries {
1751 super::builder::monitoring::ListFindingSummaries::new(self.inner.clone())
1752 }
1753
1754 /// Fetches the framework compliance report for a given scope.
1755 ///
1756 /// # Example
1757 /// ```
1758 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1759 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1760 /// async fn sample(
1761 /// client: &Monitoring
1762 /// ) -> Result<()> {
1763 /// let response = client.fetch_framework_compliance_report()
1764 /// /* set fields */
1765 /// .send().await?;
1766 /// println!("response {:?}", response);
1767 /// Ok(())
1768 /// }
1769 /// ```
1770 pub fn fetch_framework_compliance_report(
1771 &self,
1772 ) -> super::builder::monitoring::FetchFrameworkComplianceReport {
1773 super::builder::monitoring::FetchFrameworkComplianceReport::new(self.inner.clone())
1774 }
1775
1776 /// Lists the control compliance summary for a given scope.
1777 ///
1778 /// # Example
1779 /// ```
1780 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1781 /// use google_cloud_gax::paginator::ItemPaginator as _;
1782 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1783 /// async fn sample(
1784 /// client: &Monitoring, parent: &str
1785 /// ) -> Result<()> {
1786 /// let mut list = client.list_control_compliance_summaries()
1787 /// .set_parent(parent)
1788 /// .by_item();
1789 /// while let Some(item) = list.next().await.transpose()? {
1790 /// println!("{:?}", item);
1791 /// }
1792 /// Ok(())
1793 /// }
1794 /// ```
1795 pub fn list_control_compliance_summaries(
1796 &self,
1797 ) -> super::builder::monitoring::ListControlComplianceSummaries {
1798 super::builder::monitoring::ListControlComplianceSummaries::new(self.inner.clone())
1799 }
1800
1801 /// Gets the aggregated compliance report over time for a given scope.
1802 ///
1803 /// # Example
1804 /// ```
1805 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1806 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1807 /// async fn sample(
1808 /// client: &Monitoring
1809 /// ) -> Result<()> {
1810 /// let response = client.aggregate_framework_compliance_report()
1811 /// /* set fields */
1812 /// .send().await?;
1813 /// println!("response {:?}", response);
1814 /// Ok(())
1815 /// }
1816 /// ```
1817 pub fn aggregate_framework_compliance_report(
1818 &self,
1819 ) -> super::builder::monitoring::AggregateFrameworkComplianceReport {
1820 super::builder::monitoring::AggregateFrameworkComplianceReport::new(self.inner.clone())
1821 }
1822
1823 /// Lists information about the supported locations for this service.
1824 ///
1825 /// # Example
1826 /// ```
1827 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1828 /// use google_cloud_gax::paginator::ItemPaginator as _;
1829 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1830 /// async fn sample(
1831 /// client: &Monitoring
1832 /// ) -> Result<()> {
1833 /// let mut list = client.list_locations()
1834 /// /* set fields */
1835 /// .by_item();
1836 /// while let Some(item) = list.next().await.transpose()? {
1837 /// println!("{:?}", item);
1838 /// }
1839 /// Ok(())
1840 /// }
1841 /// ```
1842 pub fn list_locations(&self) -> super::builder::monitoring::ListLocations {
1843 super::builder::monitoring::ListLocations::new(self.inner.clone())
1844 }
1845
1846 /// Gets information about a location.
1847 ///
1848 /// # Example
1849 /// ```
1850 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1851 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1852 /// async fn sample(
1853 /// client: &Monitoring
1854 /// ) -> Result<()> {
1855 /// let response = client.get_location()
1856 /// /* set fields */
1857 /// .send().await?;
1858 /// println!("response {:?}", response);
1859 /// Ok(())
1860 /// }
1861 /// ```
1862 pub fn get_location(&self) -> super::builder::monitoring::GetLocation {
1863 super::builder::monitoring::GetLocation::new(self.inner.clone())
1864 }
1865
1866 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1867 ///
1868 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1869 ///
1870 /// # Example
1871 /// ```
1872 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1873 /// use google_cloud_gax::paginator::ItemPaginator as _;
1874 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1875 /// async fn sample(
1876 /// client: &Monitoring
1877 /// ) -> Result<()> {
1878 /// let mut list = client.list_operations()
1879 /// /* set fields */
1880 /// .by_item();
1881 /// while let Some(item) = list.next().await.transpose()? {
1882 /// println!("{:?}", item);
1883 /// }
1884 /// Ok(())
1885 /// }
1886 /// ```
1887 pub fn list_operations(&self) -> super::builder::monitoring::ListOperations {
1888 super::builder::monitoring::ListOperations::new(self.inner.clone())
1889 }
1890
1891 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1892 ///
1893 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1894 ///
1895 /// # Example
1896 /// ```
1897 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1898 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1899 /// async fn sample(
1900 /// client: &Monitoring
1901 /// ) -> Result<()> {
1902 /// let response = client.get_operation()
1903 /// /* set fields */
1904 /// .send().await?;
1905 /// println!("response {:?}", response);
1906 /// Ok(())
1907 /// }
1908 /// ```
1909 pub fn get_operation(&self) -> super::builder::monitoring::GetOperation {
1910 super::builder::monitoring::GetOperation::new(self.inner.clone())
1911 }
1912
1913 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1914 ///
1915 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1916 ///
1917 /// # Example
1918 /// ```
1919 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1920 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1921 /// async fn sample(
1922 /// client: &Monitoring
1923 /// ) -> Result<()> {
1924 /// client.delete_operation()
1925 /// /* set fields */
1926 /// .send().await?;
1927 /// Ok(())
1928 /// }
1929 /// ```
1930 pub fn delete_operation(&self) -> super::builder::monitoring::DeleteOperation {
1931 super::builder::monitoring::DeleteOperation::new(self.inner.clone())
1932 }
1933
1934 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1935 ///
1936 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1937 ///
1938 /// # Example
1939 /// ```
1940 /// # use google_cloud_cloudsecuritycompliance_v1::client::Monitoring;
1941 /// use google_cloud_cloudsecuritycompliance_v1::Result;
1942 /// async fn sample(
1943 /// client: &Monitoring
1944 /// ) -> Result<()> {
1945 /// client.cancel_operation()
1946 /// /* set fields */
1947 /// .send().await?;
1948 /// Ok(())
1949 /// }
1950 /// ```
1951 pub fn cancel_operation(&self) -> super::builder::monitoring::CancelOperation {
1952 super::builder::monitoring::CancelOperation::new(self.inner.clone())
1953 }
1954}