Skip to main content

google_cloud_binaryauthorization_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 Binary Authorization API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// async fn sample(
26///    parent: &str,
27/// ) -> anyhow::Result<()> {
28///     let client = BinauthzManagementServiceV1::builder().build().await?;
29///     let mut list = client.list_attestors()
30///         .set_parent(parent)
31///         .by_item();
32///     while let Some(item) = list.next().await.transpose()? {
33///         println!("{:?}", item);
34///     }
35///     Ok(())
36/// }
37/// ```
38///
39/// # Service Description
40///
41/// Google Cloud Management Service for Binary Authorization admission policies
42/// and attestation authorities.
43///
44/// This API implements a REST model with the following objects:
45///
46/// * [Policy][google.cloud.binaryauthorization.v1.Policy]
47/// * [Attestor][google.cloud.binaryauthorization.v1.Attestor]
48///
49/// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
50/// [google.cloud.binaryauthorization.v1.Policy]: crate::model::Policy
51///
52/// # Configuration
53///
54/// To configure `BinauthzManagementServiceV1` use the `with_*` methods in the type returned
55/// by [builder()][BinauthzManagementServiceV1::builder]. The default configuration should
56/// work for most applications. Common configuration changes include
57///
58/// * [with_endpoint()]: by default this client uses the global default endpoint
59///   (`https://binaryauthorization.googleapis.com`). Applications using regional
60///   endpoints or running in restricted networks (e.g. a network configured
61//    with [Private Google Access with VPC Service Controls]) may want to
62///   override this default.
63/// * [with_credentials()]: by default this client uses
64///   [Application Default Credentials]. Applications using custom
65///   authentication may need to override this default.
66///
67/// [with_endpoint()]: super::builder::binauthz_management_service_v_1::ClientBuilder::with_endpoint
68/// [with_credentials()]: super::builder::binauthz_management_service_v_1::ClientBuilder::with_credentials
69/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
70/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
71///
72/// # Pooling and Cloning
73///
74/// `BinauthzManagementServiceV1` holds a connection pool internally, it is advised to
75/// create one and reuse it. You do not need to wrap `BinauthzManagementServiceV1` in
76/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
77/// already uses an `Arc` internally.
78#[derive(Clone, Debug)]
79pub struct BinauthzManagementServiceV1 {
80    inner: std::sync::Arc<dyn super::stub::dynamic::BinauthzManagementServiceV1>,
81}
82
83impl BinauthzManagementServiceV1 {
84    /// Returns a builder for [BinauthzManagementServiceV1].
85    ///
86    /// ```
87    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
88    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
89    /// let client = BinauthzManagementServiceV1::builder().build().await?;
90    /// # Ok(()) }
91    /// ```
92    pub fn builder() -> super::builder::binauthz_management_service_v_1::ClientBuilder {
93        crate::new_client_builder(super::builder::binauthz_management_service_v_1::client::Factory)
94    }
95
96    /// Creates a new client from the provided stub.
97    ///
98    /// The most common case for calling this function is in tests mocking the
99    /// client's behavior.
100    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
101    where
102        T: super::stub::BinauthzManagementServiceV1 + 'static,
103    {
104        Self { inner: stub.into() }
105    }
106
107    pub(crate) async fn new(
108        config: gaxi::options::ClientConfig,
109    ) -> crate::ClientBuilderResult<Self> {
110        let inner = Self::build_inner(config).await?;
111        Ok(Self { inner })
112    }
113
114    async fn build_inner(
115        conf: gaxi::options::ClientConfig,
116    ) -> crate::ClientBuilderResult<
117        std::sync::Arc<dyn super::stub::dynamic::BinauthzManagementServiceV1>,
118    > {
119        if gaxi::options::tracing_enabled(&conf) {
120            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
121        }
122        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
123    }
124
125    async fn build_transport(
126        conf: gaxi::options::ClientConfig,
127    ) -> crate::ClientBuilderResult<impl super::stub::BinauthzManagementServiceV1> {
128        super::transport::BinauthzManagementServiceV1::new(conf).await
129    }
130
131    async fn build_with_tracing(
132        conf: gaxi::options::ClientConfig,
133    ) -> crate::ClientBuilderResult<impl super::stub::BinauthzManagementServiceV1> {
134        Self::build_transport(conf)
135            .await
136            .map(super::tracing::BinauthzManagementServiceV1::new)
137    }
138
139    /// A [policy][google.cloud.binaryauthorization.v1.Policy] specifies the [attestors][google.cloud.binaryauthorization.v1.Attestor] that must attest to
140    /// a container image, before the project is allowed to deploy that
141    /// image. There is at most one policy per project. All image admission
142    /// requests are permitted if a project has no policy.
143    ///
144    /// Gets the [policy][google.cloud.binaryauthorization.v1.Policy] for this project. Returns a default
145    /// [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one.
146    ///
147    /// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
148    /// [google.cloud.binaryauthorization.v1.Policy]: crate::model::Policy
149    ///
150    /// # Example
151    /// ```
152    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
153    /// use google_cloud_binaryauthorization_v1::Result;
154    /// async fn sample(
155    ///    client: &BinauthzManagementServiceV1, project_id: &str
156    /// ) -> Result<()> {
157    ///     let response = client.get_policy()
158    ///         .set_name(format!("projects/{project_id}/policy"))
159    ///         .send().await?;
160    ///     println!("response {:?}", response);
161    ///     Ok(())
162    /// }
163    /// ```
164    pub fn get_policy(&self) -> super::builder::binauthz_management_service_v_1::GetPolicy {
165        super::builder::binauthz_management_service_v_1::GetPolicy::new(self.inner.clone())
166    }
167
168    /// Creates or updates a project's [policy][google.cloud.binaryauthorization.v1.Policy], and returns a copy of the
169    /// new [policy][google.cloud.binaryauthorization.v1.Policy]. A policy is always updated as a whole, to avoid race
170    /// conditions with concurrent policy enforcement (or management!)
171    /// requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
172    /// if the request is malformed.
173    ///
174    /// [google.cloud.binaryauthorization.v1.Policy]: crate::model::Policy
175    ///
176    /// # Example
177    /// ```
178    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
179    /// use google_cloud_binaryauthorization_v1::model::Policy;
180    /// use google_cloud_binaryauthorization_v1::Result;
181    /// async fn sample(
182    ///    client: &BinauthzManagementServiceV1, project_id: &str
183    /// ) -> Result<()> {
184    ///     let response = client.update_policy()
185    ///         .set_policy(
186    ///             Policy::new().set_name(format!("projects/{project_id}/policy"))/* set fields */
187    ///         )
188    ///         .send().await?;
189    ///     println!("response {:?}", response);
190    ///     Ok(())
191    /// }
192    /// ```
193    pub fn update_policy(&self) -> super::builder::binauthz_management_service_v_1::UpdatePolicy {
194        super::builder::binauthz_management_service_v_1::UpdatePolicy::new(self.inner.clone())
195    }
196
197    /// Creates an [attestor][google.cloud.binaryauthorization.v1.Attestor], and returns a copy of the new
198    /// [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the project does not exist,
199    /// INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
200    /// [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists.
201    ///
202    /// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
203    ///
204    /// # Example
205    /// ```
206    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
207    /// use google_cloud_binaryauthorization_v1::model::Attestor;
208    /// use google_cloud_binaryauthorization_v1::Result;
209    /// async fn sample(
210    ///    client: &BinauthzManagementServiceV1, parent: &str
211    /// ) -> Result<()> {
212    ///     let response = client.create_attestor()
213    ///         .set_parent(parent)
214    ///         .set_attestor_id("attestor_id_value")
215    ///         .set_attestor(
216    ///             Attestor::new()/* set fields */
217    ///         )
218    ///         .send().await?;
219    ///     println!("response {:?}", response);
220    ///     Ok(())
221    /// }
222    /// ```
223    pub fn create_attestor(
224        &self,
225    ) -> super::builder::binauthz_management_service_v_1::CreateAttestor {
226        super::builder::binauthz_management_service_v_1::CreateAttestor::new(self.inner.clone())
227    }
228
229    /// Gets an [attestor][google.cloud.binaryauthorization.v1.Attestor].
230    /// Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist.
231    ///
232    /// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
233    ///
234    /// # Example
235    /// ```
236    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
237    /// use google_cloud_binaryauthorization_v1::Result;
238    /// async fn sample(
239    ///    client: &BinauthzManagementServiceV1, project_id: &str, attestor_id: &str
240    /// ) -> Result<()> {
241    ///     let response = client.get_attestor()
242    ///         .set_name(format!("projects/{project_id}/attestors/{attestor_id}"))
243    ///         .send().await?;
244    ///     println!("response {:?}", response);
245    ///     Ok(())
246    /// }
247    /// ```
248    pub fn get_attestor(&self) -> super::builder::binauthz_management_service_v_1::GetAttestor {
249        super::builder::binauthz_management_service_v_1::GetAttestor::new(self.inner.clone())
250    }
251
252    /// Updates an [attestor][google.cloud.binaryauthorization.v1.Attestor].
253    /// Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist.
254    ///
255    /// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
256    ///
257    /// # Example
258    /// ```
259    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
260    /// use google_cloud_binaryauthorization_v1::model::Attestor;
261    /// use google_cloud_binaryauthorization_v1::Result;
262    /// async fn sample(
263    ///    client: &BinauthzManagementServiceV1, project_id: &str, attestor_id: &str
264    /// ) -> Result<()> {
265    ///     let response = client.update_attestor()
266    ///         .set_attestor(
267    ///             Attestor::new().set_name(format!("projects/{project_id}/attestors/{attestor_id}"))/* set fields */
268    ///         )
269    ///         .send().await?;
270    ///     println!("response {:?}", response);
271    ///     Ok(())
272    /// }
273    /// ```
274    pub fn update_attestor(
275        &self,
276    ) -> super::builder::binauthz_management_service_v_1::UpdateAttestor {
277        super::builder::binauthz_management_service_v_1::UpdateAttestor::new(self.inner.clone())
278    }
279
280    /// Lists [attestors][google.cloud.binaryauthorization.v1.Attestor].
281    /// Returns INVALID_ARGUMENT if the project does not exist.
282    ///
283    /// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
284    ///
285    /// # Example
286    /// ```
287    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
288    /// use google_cloud_gax::paginator::ItemPaginator as _;
289    /// use google_cloud_binaryauthorization_v1::Result;
290    /// async fn sample(
291    ///    client: &BinauthzManagementServiceV1, parent: &str
292    /// ) -> Result<()> {
293    ///     let mut list = client.list_attestors()
294    ///         .set_parent(parent)
295    ///         .by_item();
296    ///     while let Some(item) = list.next().await.transpose()? {
297    ///         println!("{:?}", item);
298    ///     }
299    ///     Ok(())
300    /// }
301    /// ```
302    pub fn list_attestors(&self) -> super::builder::binauthz_management_service_v_1::ListAttestors {
303        super::builder::binauthz_management_service_v_1::ListAttestors::new(self.inner.clone())
304    }
305
306    /// Deletes an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the
307    /// [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist.
308    ///
309    /// [google.cloud.binaryauthorization.v1.Attestor]: crate::model::Attestor
310    ///
311    /// # Example
312    /// ```
313    /// # use google_cloud_binaryauthorization_v1::client::BinauthzManagementServiceV1;
314    /// use google_cloud_binaryauthorization_v1::Result;
315    /// async fn sample(
316    ///    client: &BinauthzManagementServiceV1, project_id: &str, attestor_id: &str
317    /// ) -> Result<()> {
318    ///     client.delete_attestor()
319    ///         .set_name(format!("projects/{project_id}/attestors/{attestor_id}"))
320    ///         .send().await?;
321    ///     Ok(())
322    /// }
323    /// ```
324    pub fn delete_attestor(
325        &self,
326    ) -> super::builder::binauthz_management_service_v_1::DeleteAttestor {
327        super::builder::binauthz_management_service_v_1::DeleteAttestor::new(self.inner.clone())
328    }
329}
330
331/// Implements a client for the Binary Authorization API.
332///
333/// # Example
334/// ```
335/// # use google_cloud_binaryauthorization_v1::client::SystemPolicyV1;
336/// async fn sample(
337///    project_id: &str,
338/// ) -> anyhow::Result<()> {
339///     let client = SystemPolicyV1::builder().build().await?;
340///     let response = client.get_system_policy()
341///         .set_name(format!("projects/{project_id}/policy"))
342///         .send().await?;
343///     println!("response {:?}", response);
344///     Ok(())
345/// }
346/// ```
347///
348/// # Service Description
349///
350/// API for working with the system policy.
351///
352/// # Configuration
353///
354/// To configure `SystemPolicyV1` use the `with_*` methods in the type returned
355/// by [builder()][SystemPolicyV1::builder]. The default configuration should
356/// work for most applications. Common configuration changes include
357///
358/// * [with_endpoint()]: by default this client uses the global default endpoint
359///   (`https://binaryauthorization.googleapis.com`). Applications using regional
360///   endpoints or running in restricted networks (e.g. a network configured
361//    with [Private Google Access with VPC Service Controls]) may want to
362///   override this default.
363/// * [with_credentials()]: by default this client uses
364///   [Application Default Credentials]. Applications using custom
365///   authentication may need to override this default.
366///
367/// [with_endpoint()]: super::builder::system_policy_v_1::ClientBuilder::with_endpoint
368/// [with_credentials()]: super::builder::system_policy_v_1::ClientBuilder::with_credentials
369/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
370/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
371///
372/// # Pooling and Cloning
373///
374/// `SystemPolicyV1` holds a connection pool internally, it is advised to
375/// create one and reuse it. You do not need to wrap `SystemPolicyV1` in
376/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
377/// already uses an `Arc` internally.
378#[derive(Clone, Debug)]
379pub struct SystemPolicyV1 {
380    inner: std::sync::Arc<dyn super::stub::dynamic::SystemPolicyV1>,
381}
382
383impl SystemPolicyV1 {
384    /// Returns a builder for [SystemPolicyV1].
385    ///
386    /// ```
387    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
388    /// # use google_cloud_binaryauthorization_v1::client::SystemPolicyV1;
389    /// let client = SystemPolicyV1::builder().build().await?;
390    /// # Ok(()) }
391    /// ```
392    pub fn builder() -> super::builder::system_policy_v_1::ClientBuilder {
393        crate::new_client_builder(super::builder::system_policy_v_1::client::Factory)
394    }
395
396    /// Creates a new client from the provided stub.
397    ///
398    /// The most common case for calling this function is in tests mocking the
399    /// client's behavior.
400    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
401    where
402        T: super::stub::SystemPolicyV1 + 'static,
403    {
404        Self { inner: stub.into() }
405    }
406
407    pub(crate) async fn new(
408        config: gaxi::options::ClientConfig,
409    ) -> crate::ClientBuilderResult<Self> {
410        let inner = Self::build_inner(config).await?;
411        Ok(Self { inner })
412    }
413
414    async fn build_inner(
415        conf: gaxi::options::ClientConfig,
416    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SystemPolicyV1>> {
417        if gaxi::options::tracing_enabled(&conf) {
418            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
419        }
420        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
421    }
422
423    async fn build_transport(
424        conf: gaxi::options::ClientConfig,
425    ) -> crate::ClientBuilderResult<impl super::stub::SystemPolicyV1> {
426        super::transport::SystemPolicyV1::new(conf).await
427    }
428
429    async fn build_with_tracing(
430        conf: gaxi::options::ClientConfig,
431    ) -> crate::ClientBuilderResult<impl super::stub::SystemPolicyV1> {
432        Self::build_transport(conf)
433            .await
434            .map(super::tracing::SystemPolicyV1::new)
435    }
436
437    /// Gets the current system policy in the specified location.
438    ///
439    /// # Example
440    /// ```
441    /// # use google_cloud_binaryauthorization_v1::client::SystemPolicyV1;
442    /// use google_cloud_binaryauthorization_v1::Result;
443    /// async fn sample(
444    ///    client: &SystemPolicyV1, project_id: &str
445    /// ) -> Result<()> {
446    ///     let response = client.get_system_policy()
447    ///         .set_name(format!("projects/{project_id}/policy"))
448    ///         .send().await?;
449    ///     println!("response {:?}", response);
450    ///     Ok(())
451    /// }
452    /// ```
453    pub fn get_system_policy(&self) -> super::builder::system_policy_v_1::GetSystemPolicy {
454        super::builder::system_policy_v_1::GetSystemPolicy::new(self.inner.clone())
455    }
456}
457
458/// Implements a client for the Binary Authorization API.
459///
460/// # Example
461/// ```
462/// # use google_cloud_binaryauthorization_v1::client::ValidationHelperV1;
463/// async fn sample(
464/// ) -> anyhow::Result<()> {
465///     let client = ValidationHelperV1::builder().build().await?;
466///     let response = client.validate_attestation_occurrence()
467///         /* set fields */
468///         .send().await?;
469///     println!("response {:?}", response);
470///     Ok(())
471/// }
472/// ```
473///
474/// # Service Description
475///
476/// BinAuthz Attestor verification
477///
478/// # Configuration
479///
480/// To configure `ValidationHelperV1` use the `with_*` methods in the type returned
481/// by [builder()][ValidationHelperV1::builder]. The default configuration should
482/// work for most applications. Common configuration changes include
483///
484/// * [with_endpoint()]: by default this client uses the global default endpoint
485///   (`https://binaryauthorization.googleapis.com`). Applications using regional
486///   endpoints or running in restricted networks (e.g. a network configured
487//    with [Private Google Access with VPC Service Controls]) may want to
488///   override this default.
489/// * [with_credentials()]: by default this client uses
490///   [Application Default Credentials]. Applications using custom
491///   authentication may need to override this default.
492///
493/// [with_endpoint()]: super::builder::validation_helper_v_1::ClientBuilder::with_endpoint
494/// [with_credentials()]: super::builder::validation_helper_v_1::ClientBuilder::with_credentials
495/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
496/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
497///
498/// # Pooling and Cloning
499///
500/// `ValidationHelperV1` holds a connection pool internally, it is advised to
501/// create one and reuse it. You do not need to wrap `ValidationHelperV1` in
502/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
503/// already uses an `Arc` internally.
504#[derive(Clone, Debug)]
505pub struct ValidationHelperV1 {
506    inner: std::sync::Arc<dyn super::stub::dynamic::ValidationHelperV1>,
507}
508
509impl ValidationHelperV1 {
510    /// Returns a builder for [ValidationHelperV1].
511    ///
512    /// ```
513    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
514    /// # use google_cloud_binaryauthorization_v1::client::ValidationHelperV1;
515    /// let client = ValidationHelperV1::builder().build().await?;
516    /// # Ok(()) }
517    /// ```
518    pub fn builder() -> super::builder::validation_helper_v_1::ClientBuilder {
519        crate::new_client_builder(super::builder::validation_helper_v_1::client::Factory)
520    }
521
522    /// Creates a new client from the provided stub.
523    ///
524    /// The most common case for calling this function is in tests mocking the
525    /// client's behavior.
526    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
527    where
528        T: super::stub::ValidationHelperV1 + 'static,
529    {
530        Self { inner: stub.into() }
531    }
532
533    pub(crate) async fn new(
534        config: gaxi::options::ClientConfig,
535    ) -> crate::ClientBuilderResult<Self> {
536        let inner = Self::build_inner(config).await?;
537        Ok(Self { inner })
538    }
539
540    async fn build_inner(
541        conf: gaxi::options::ClientConfig,
542    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ValidationHelperV1>>
543    {
544        if gaxi::options::tracing_enabled(&conf) {
545            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
546        }
547        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
548    }
549
550    async fn build_transport(
551        conf: gaxi::options::ClientConfig,
552    ) -> crate::ClientBuilderResult<impl super::stub::ValidationHelperV1> {
553        super::transport::ValidationHelperV1::new(conf).await
554    }
555
556    async fn build_with_tracing(
557        conf: gaxi::options::ClientConfig,
558    ) -> crate::ClientBuilderResult<impl super::stub::ValidationHelperV1> {
559        Self::build_transport(conf)
560            .await
561            .map(super::tracing::ValidationHelperV1::new)
562    }
563
564    /// Returns whether the given Attestation for the given image URI
565    /// was signed by the given Attestor
566    ///
567    /// # Example
568    /// ```
569    /// # use google_cloud_binaryauthorization_v1::client::ValidationHelperV1;
570    /// use google_cloud_binaryauthorization_v1::Result;
571    /// async fn sample(
572    ///    client: &ValidationHelperV1
573    /// ) -> Result<()> {
574    ///     let response = client.validate_attestation_occurrence()
575    ///         /* set fields */
576    ///         .send().await?;
577    ///     println!("response {:?}", response);
578    ///     Ok(())
579    /// }
580    /// ```
581    pub fn validate_attestation_occurrence(
582        &self,
583    ) -> super::builder::validation_helper_v_1::ValidateAttestationOccurrence {
584        super::builder::validation_helper_v_1::ValidateAttestationOccurrence::new(
585            self.inner.clone(),
586        )
587    }
588}