Skip to main content

google_cloud_confidentialcomputing_v1/
builder.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
17/// Request and client builders for [ConfidentialComputing][crate::client::ConfidentialComputing].
18pub mod confidential_computing {
19    use crate::Result;
20
21    /// A builder for [ConfidentialComputing][crate::client::ConfidentialComputing].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_confidentialcomputing_v1::*;
26    /// # use builder::confidential_computing::ClientBuilder;
27    /// # use client::ConfidentialComputing;
28    /// let builder : ClientBuilder = ConfidentialComputing::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://confidentialcomputing.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::ConfidentialComputing;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = ConfidentialComputing;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::ConfidentialComputing] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [ConfidentialComputing::create_challenge][crate::client::ConfidentialComputing::create_challenge] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::CreateChallenge;
79    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> CreateChallenge {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct CreateChallenge(RequestBuilder<crate::model::CreateChallengeRequest>);
92
93    impl CreateChallenge {
94        pub(crate) fn new(
95            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
96        ) -> Self {
97            Self(RequestBuilder::new(stub))
98        }
99
100        /// Sets the full request, replacing any prior values.
101        pub fn with_request<V: Into<crate::model::CreateChallengeRequest>>(mut self, v: V) -> Self {
102            self.0.request = v.into();
103            self
104        }
105
106        /// Sets all the options, replacing any prior values.
107        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108            self.0.options = v.into();
109            self
110        }
111
112        /// Sends the request.
113        pub async fn send(self) -> Result<crate::model::Challenge> {
114            (*self.0.stub)
115                .create_challenge(self.0.request, self.0.options)
116                .await
117                .map(crate::Response::into_body)
118        }
119
120        /// Sets the value of [parent][crate::model::CreateChallengeRequest::parent].
121        ///
122        /// This is a **required** field for requests.
123        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
124            self.0.request.parent = v.into();
125            self
126        }
127
128        /// Sets the value of [challenge][crate::model::CreateChallengeRequest::challenge].
129        ///
130        /// This is a **required** field for requests.
131        pub fn set_challenge<T>(mut self, v: T) -> Self
132        where
133            T: std::convert::Into<crate::model::Challenge>,
134        {
135            self.0.request.challenge = std::option::Option::Some(v.into());
136            self
137        }
138
139        /// Sets or clears the value of [challenge][crate::model::CreateChallengeRequest::challenge].
140        ///
141        /// This is a **required** field for requests.
142        pub fn set_or_clear_challenge<T>(mut self, v: std::option::Option<T>) -> Self
143        where
144            T: std::convert::Into<crate::model::Challenge>,
145        {
146            self.0.request.challenge = v.map(|x| x.into());
147            self
148        }
149    }
150
151    #[doc(hidden)]
152    impl crate::RequestBuilder for CreateChallenge {
153        fn request_options(&mut self) -> &mut crate::RequestOptions {
154            &mut self.0.options
155        }
156    }
157
158    /// The request builder for [ConfidentialComputing::verify_attestation][crate::client::ConfidentialComputing::verify_attestation] calls.
159    ///
160    /// # Example
161    /// ```
162    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::VerifyAttestation;
163    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
164    ///
165    /// let builder = prepare_request_builder();
166    /// let response = builder.send().await?;
167    /// # Ok(()) }
168    ///
169    /// fn prepare_request_builder() -> VerifyAttestation {
170    ///   # panic!();
171    ///   // ... details omitted ...
172    /// }
173    /// ```
174    #[derive(Clone, Debug)]
175    pub struct VerifyAttestation(RequestBuilder<crate::model::VerifyAttestationRequest>);
176
177    impl VerifyAttestation {
178        pub(crate) fn new(
179            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
180        ) -> Self {
181            Self(RequestBuilder::new(stub))
182        }
183
184        /// Sets the full request, replacing any prior values.
185        pub fn with_request<V: Into<crate::model::VerifyAttestationRequest>>(
186            mut self,
187            v: V,
188        ) -> Self {
189            self.0.request = v.into();
190            self
191        }
192
193        /// Sets all the options, replacing any prior values.
194        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
195            self.0.options = v.into();
196            self
197        }
198
199        /// Sends the request.
200        pub async fn send(self) -> Result<crate::model::VerifyAttestationResponse> {
201            (*self.0.stub)
202                .verify_attestation(self.0.request, self.0.options)
203                .await
204                .map(crate::Response::into_body)
205        }
206
207        /// Sets the value of [challenge][crate::model::VerifyAttestationRequest::challenge].
208        ///
209        /// This is a **required** field for requests.
210        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
211            self.0.request.challenge = v.into();
212            self
213        }
214
215        /// Sets the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
216        pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
217        where
218            T: std::convert::Into<crate::model::GcpCredentials>,
219        {
220            self.0.request.gcp_credentials = std::option::Option::Some(v.into());
221            self
222        }
223
224        /// Sets or clears the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
225        pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
226        where
227            T: std::convert::Into<crate::model::GcpCredentials>,
228        {
229            self.0.request.gcp_credentials = v.map(|x| x.into());
230            self
231        }
232
233        /// Sets the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
234        ///
235        /// This is a **required** field for requests.
236        pub fn set_tpm_attestation<T>(mut self, v: T) -> Self
237        where
238            T: std::convert::Into<crate::model::TpmAttestation>,
239        {
240            self.0.request.tpm_attestation = std::option::Option::Some(v.into());
241            self
242        }
243
244        /// Sets or clears the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
245        ///
246        /// This is a **required** field for requests.
247        pub fn set_or_clear_tpm_attestation<T>(mut self, v: std::option::Option<T>) -> Self
248        where
249            T: std::convert::Into<crate::model::TpmAttestation>,
250        {
251            self.0.request.tpm_attestation = v.map(|x| x.into());
252            self
253        }
254
255        /// Sets the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
256        pub fn set_confidential_space_info<T>(mut self, v: T) -> Self
257        where
258            T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
259        {
260            self.0.request.confidential_space_info = std::option::Option::Some(v.into());
261            self
262        }
263
264        /// Sets or clears the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
265        pub fn set_or_clear_confidential_space_info<T>(mut self, v: std::option::Option<T>) -> Self
266        where
267            T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
268        {
269            self.0.request.confidential_space_info = v.map(|x| x.into());
270            self
271        }
272
273        /// Sets the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
274        pub fn set_token_options<T>(mut self, v: T) -> Self
275        where
276            T: std::convert::Into<crate::model::TokenOptions>,
277        {
278            self.0.request.token_options = std::option::Option::Some(v.into());
279            self
280        }
281
282        /// Sets or clears the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
283        pub fn set_or_clear_token_options<T>(mut self, v: std::option::Option<T>) -> Self
284        where
285            T: std::convert::Into<crate::model::TokenOptions>,
286        {
287            self.0.request.token_options = v.map(|x| x.into());
288            self
289        }
290
291        /// Sets the value of [attester][crate::model::VerifyAttestationRequest::attester].
292        pub fn set_attester<T: Into<std::string::String>>(mut self, v: T) -> Self {
293            self.0.request.attester = v.into();
294            self
295        }
296
297        /// Sets the value of [instance][crate::model::VerifyAttestationRequest::instance].
298        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
299            self.0.request.instance = v.into();
300            self
301        }
302
303        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation].
304        ///
305        /// Note that all the setters affecting `tee_attestation` are
306        /// mutually exclusive.
307        pub fn set_tee_attestation<
308            T: Into<Option<crate::model::verify_attestation_request::TeeAttestation>>,
309        >(
310            mut self,
311            v: T,
312        ) -> Self {
313            self.0.request.tee_attestation = v.into();
314            self
315        }
316
317        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
318        /// to hold a `TdCcel`.
319        ///
320        /// Note that all the setters affecting `tee_attestation` are
321        /// mutually exclusive.
322        pub fn set_td_ccel<
323            T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>,
324        >(
325            mut self,
326            v: T,
327        ) -> Self {
328            self.0.request = self.0.request.set_td_ccel(v);
329            self
330        }
331
332        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
333        /// to hold a `SevSnpAttestation`.
334        ///
335        /// Note that all the setters affecting `tee_attestation` are
336        /// mutually exclusive.
337        pub fn set_sev_snp_attestation<
338            T: std::convert::Into<std::boxed::Box<crate::model::SevSnpAttestation>>,
339        >(
340            mut self,
341            v: T,
342        ) -> Self {
343            self.0.request = self.0.request.set_sev_snp_attestation(v);
344            self
345        }
346
347        /// Sets the value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation].
348        ///
349        /// Note that all the setters affecting `device_attestation` are
350        /// mutually exclusive.
351        pub fn set_device_attestation<
352            T: Into<Option<crate::model::verify_attestation_request::DeviceAttestation>>,
353        >(
354            mut self,
355            v: T,
356        ) -> Self {
357            self.0.request.device_attestation = v.into();
358            self
359        }
360
361        /// Sets the value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation]
362        /// to hold a `NvidiaAttestation`.
363        ///
364        /// Note that all the setters affecting `device_attestation` are
365        /// mutually exclusive.
366        pub fn set_nvidia_attestation<
367            T: std::convert::Into<std::boxed::Box<crate::model::NvidiaAttestation>>,
368        >(
369            mut self,
370            v: T,
371        ) -> Self {
372            self.0.request = self.0.request.set_nvidia_attestation(v);
373            self
374        }
375    }
376
377    #[doc(hidden)]
378    impl crate::RequestBuilder for VerifyAttestation {
379        fn request_options(&mut self) -> &mut crate::RequestOptions {
380            &mut self.0.options
381        }
382    }
383
384    /// The request builder for [ConfidentialComputing::verify_confidential_space][crate::client::ConfidentialComputing::verify_confidential_space] calls.
385    ///
386    /// # Example
387    /// ```
388    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::VerifyConfidentialSpace;
389    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
390    ///
391    /// let builder = prepare_request_builder();
392    /// let response = builder.send().await?;
393    /// # Ok(()) }
394    ///
395    /// fn prepare_request_builder() -> VerifyConfidentialSpace {
396    ///   # panic!();
397    ///   // ... details omitted ...
398    /// }
399    /// ```
400    #[derive(Clone, Debug)]
401    pub struct VerifyConfidentialSpace(
402        RequestBuilder<crate::model::VerifyConfidentialSpaceRequest>,
403    );
404
405    impl VerifyConfidentialSpace {
406        pub(crate) fn new(
407            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
408        ) -> Self {
409            Self(RequestBuilder::new(stub))
410        }
411
412        /// Sets the full request, replacing any prior values.
413        pub fn with_request<V: Into<crate::model::VerifyConfidentialSpaceRequest>>(
414            mut self,
415            v: V,
416        ) -> Self {
417            self.0.request = v.into();
418            self
419        }
420
421        /// Sets all the options, replacing any prior values.
422        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
423            self.0.options = v.into();
424            self
425        }
426
427        /// Sends the request.
428        pub async fn send(self) -> Result<crate::model::VerifyConfidentialSpaceResponse> {
429            (*self.0.stub)
430                .verify_confidential_space(self.0.request, self.0.options)
431                .await
432                .map(crate::Response::into_body)
433        }
434
435        /// Sets the value of [challenge][crate::model::VerifyConfidentialSpaceRequest::challenge].
436        ///
437        /// This is a **required** field for requests.
438        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
439            self.0.request.challenge = v.into();
440            self
441        }
442
443        /// Sets the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
444        pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
445        where
446            T: std::convert::Into<crate::model::GcpCredentials>,
447        {
448            self.0.request.gcp_credentials = std::option::Option::Some(v.into());
449            self
450        }
451
452        /// Sets or clears the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
453        pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
454        where
455            T: std::convert::Into<crate::model::GcpCredentials>,
456        {
457            self.0.request.gcp_credentials = v.map(|x| x.into());
458            self
459        }
460
461        /// Sets the value of [signed_entities][crate::model::VerifyConfidentialSpaceRequest::signed_entities].
462        pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
463        where
464            T: std::iter::IntoIterator<Item = V>,
465            V: std::convert::Into<crate::model::SignedEntity>,
466        {
467            use std::iter::Iterator;
468            self.0.request.signed_entities = v.into_iter().map(|i| i.into()).collect();
469            self
470        }
471
472        /// Sets the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
473        pub fn set_gce_shielded_identity<T>(mut self, v: T) -> Self
474        where
475            T: std::convert::Into<crate::model::GceShieldedIdentity>,
476        {
477            self.0.request.gce_shielded_identity = std::option::Option::Some(v.into());
478            self
479        }
480
481        /// Sets or clears the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
482        pub fn set_or_clear_gce_shielded_identity<T>(mut self, v: std::option::Option<T>) -> Self
483        where
484            T: std::convert::Into<crate::model::GceShieldedIdentity>,
485        {
486            self.0.request.gce_shielded_identity = v.map(|x| x.into());
487            self
488        }
489
490        /// Sets the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
491        pub fn set_options<T>(mut self, v: T) -> Self
492        where
493            T: std::convert::Into<
494                    crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
495                >,
496        {
497            self.0.request.options = std::option::Option::Some(v.into());
498            self
499        }
500
501        /// Sets or clears the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
502        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
503        where
504            T: std::convert::Into<
505                    crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
506                >,
507        {
508            self.0.request.options = v.map(|x| x.into());
509            self
510        }
511
512        /// Sets the value of [nvidia_attestation][crate::model::VerifyConfidentialSpaceRequest::nvidia_attestation].
513        pub fn set_nvidia_attestation<T>(mut self, v: T) -> Self
514        where
515            T: std::convert::Into<crate::model::NvidiaAttestation>,
516        {
517            self.0.request.nvidia_attestation = std::option::Option::Some(v.into());
518            self
519        }
520
521        /// Sets or clears the value of [nvidia_attestation][crate::model::VerifyConfidentialSpaceRequest::nvidia_attestation].
522        pub fn set_or_clear_nvidia_attestation<T>(mut self, v: std::option::Option<T>) -> Self
523        where
524            T: std::convert::Into<crate::model::NvidiaAttestation>,
525        {
526            self.0.request.nvidia_attestation = v.map(|x| x.into());
527            self
528        }
529
530        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation].
531        ///
532        /// Note that all the setters affecting `tee_attestation` are
533        /// mutually exclusive.
534        pub fn set_tee_attestation<
535            T: Into<Option<crate::model::verify_confidential_space_request::TeeAttestation>>,
536        >(
537            mut self,
538            v: T,
539        ) -> Self {
540            self.0.request.tee_attestation = v.into();
541            self
542        }
543
544        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
545        /// to hold a `TdCcel`.
546        ///
547        /// Note that all the setters affecting `tee_attestation` are
548        /// mutually exclusive.
549        pub fn set_td_ccel<
550            T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>,
551        >(
552            mut self,
553            v: T,
554        ) -> Self {
555            self.0.request = self.0.request.set_td_ccel(v);
556            self
557        }
558
559        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
560        /// to hold a `TpmAttestation`.
561        ///
562        /// Note that all the setters affecting `tee_attestation` are
563        /// mutually exclusive.
564        pub fn set_tpm_attestation<
565            T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
566        >(
567            mut self,
568            v: T,
569        ) -> Self {
570            self.0.request = self.0.request.set_tpm_attestation(v);
571            self
572        }
573    }
574
575    #[doc(hidden)]
576    impl crate::RequestBuilder for VerifyConfidentialSpace {
577        fn request_options(&mut self) -> &mut crate::RequestOptions {
578            &mut self.0.options
579        }
580    }
581
582    /// The request builder for [ConfidentialComputing::verify_confidential_gke][crate::client::ConfidentialComputing::verify_confidential_gke] calls.
583    ///
584    /// # Example
585    /// ```
586    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::VerifyConfidentialGke;
587    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
588    ///
589    /// let builder = prepare_request_builder();
590    /// let response = builder.send().await?;
591    /// # Ok(()) }
592    ///
593    /// fn prepare_request_builder() -> VerifyConfidentialGke {
594    ///   # panic!();
595    ///   // ... details omitted ...
596    /// }
597    /// ```
598    #[derive(Clone, Debug)]
599    pub struct VerifyConfidentialGke(RequestBuilder<crate::model::VerifyConfidentialGkeRequest>);
600
601    impl VerifyConfidentialGke {
602        pub(crate) fn new(
603            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
604        ) -> Self {
605            Self(RequestBuilder::new(stub))
606        }
607
608        /// Sets the full request, replacing any prior values.
609        pub fn with_request<V: Into<crate::model::VerifyConfidentialGkeRequest>>(
610            mut self,
611            v: V,
612        ) -> Self {
613            self.0.request = v.into();
614            self
615        }
616
617        /// Sets all the options, replacing any prior values.
618        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
619            self.0.options = v.into();
620            self
621        }
622
623        /// Sends the request.
624        pub async fn send(self) -> Result<crate::model::VerifyConfidentialGkeResponse> {
625            (*self.0.stub)
626                .verify_confidential_gke(self.0.request, self.0.options)
627                .await
628                .map(crate::Response::into_body)
629        }
630
631        /// Sets the value of [challenge][crate::model::VerifyConfidentialGkeRequest::challenge].
632        ///
633        /// This is a **required** field for requests.
634        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
635            self.0.request.challenge = v.into();
636            self
637        }
638
639        /// Sets the value of [options][crate::model::VerifyConfidentialGkeRequest::options].
640        pub fn set_options<T>(mut self, v: T) -> Self
641        where
642            T: std::convert::Into<
643                    crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
644                >,
645        {
646            self.0.request.options = std::option::Option::Some(v.into());
647            self
648        }
649
650        /// Sets or clears the value of [options][crate::model::VerifyConfidentialGkeRequest::options].
651        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
652        where
653            T: std::convert::Into<
654                    crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
655                >,
656        {
657            self.0.request.options = v.map(|x| x.into());
658            self
659        }
660
661        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation].
662        ///
663        /// Note that all the setters affecting `tee_attestation` are
664        /// mutually exclusive.
665        pub fn set_tee_attestation<
666            T: Into<Option<crate::model::verify_confidential_gke_request::TeeAttestation>>,
667        >(
668            mut self,
669            v: T,
670        ) -> Self {
671            self.0.request.tee_attestation = v.into();
672            self
673        }
674
675        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
676        /// to hold a `TpmAttestation`.
677        ///
678        /// Note that all the setters affecting `tee_attestation` are
679        /// mutually exclusive.
680        pub fn set_tpm_attestation<
681            T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
682        >(
683            mut self,
684            v: T,
685        ) -> Self {
686            self.0.request = self.0.request.set_tpm_attestation(v);
687            self
688        }
689    }
690
691    #[doc(hidden)]
692    impl crate::RequestBuilder for VerifyConfidentialGke {
693        fn request_options(&mut self) -> &mut crate::RequestOptions {
694            &mut self.0.options
695        }
696    }
697
698    /// The request builder for [ConfidentialComputing::list_locations][crate::client::ConfidentialComputing::list_locations] calls.
699    ///
700    /// # Example
701    /// ```
702    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::ListLocations;
703    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
704    /// use google_cloud_gax::paginator::ItemPaginator;
705    ///
706    /// let builder = prepare_request_builder();
707    /// let mut items = builder.by_item();
708    /// while let Some(result) = items.next().await {
709    ///   let item = result?;
710    /// }
711    /// # Ok(()) }
712    ///
713    /// fn prepare_request_builder() -> ListLocations {
714    ///   # panic!();
715    ///   // ... details omitted ...
716    /// }
717    /// ```
718    #[derive(Clone, Debug)]
719    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
720
721    impl ListLocations {
722        pub(crate) fn new(
723            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
724        ) -> Self {
725            Self(RequestBuilder::new(stub))
726        }
727
728        /// Sets the full request, replacing any prior values.
729        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
730            mut self,
731            v: V,
732        ) -> Self {
733            self.0.request = v.into();
734            self
735        }
736
737        /// Sets all the options, replacing any prior values.
738        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
739            self.0.options = v.into();
740            self
741        }
742
743        /// Sends the request.
744        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
745            (*self.0.stub)
746                .list_locations(self.0.request, self.0.options)
747                .await
748                .map(crate::Response::into_body)
749        }
750
751        /// Streams each page in the collection.
752        pub fn by_page(
753            self,
754        ) -> impl google_cloud_gax::paginator::Paginator<
755            google_cloud_location::model::ListLocationsResponse,
756            crate::Error,
757        > {
758            use std::clone::Clone;
759            let token = self.0.request.page_token.clone();
760            let execute = move |token: String| {
761                let mut builder = self.clone();
762                builder.0.request = builder.0.request.set_page_token(token);
763                builder.send()
764            };
765            google_cloud_gax::paginator::internal::new_paginator(token, execute)
766        }
767
768        /// Streams each item in the collection.
769        pub fn by_item(
770            self,
771        ) -> impl google_cloud_gax::paginator::ItemPaginator<
772            google_cloud_location::model::ListLocationsResponse,
773            crate::Error,
774        > {
775            use google_cloud_gax::paginator::Paginator;
776            self.by_page().items()
777        }
778
779        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
780        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
781            self.0.request.name = v.into();
782            self
783        }
784
785        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
786        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
787            self.0.request.filter = v.into();
788            self
789        }
790
791        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
792        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
793            self.0.request.page_size = v.into();
794            self
795        }
796
797        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
798        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
799            self.0.request.page_token = v.into();
800            self
801        }
802    }
803
804    #[doc(hidden)]
805    impl crate::RequestBuilder for ListLocations {
806        fn request_options(&mut self) -> &mut crate::RequestOptions {
807            &mut self.0.options
808        }
809    }
810
811    /// The request builder for [ConfidentialComputing::get_location][crate::client::ConfidentialComputing::get_location] calls.
812    ///
813    /// # Example
814    /// ```
815    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::GetLocation;
816    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
817    ///
818    /// let builder = prepare_request_builder();
819    /// let response = builder.send().await?;
820    /// # Ok(()) }
821    ///
822    /// fn prepare_request_builder() -> GetLocation {
823    ///   # panic!();
824    ///   // ... details omitted ...
825    /// }
826    /// ```
827    #[derive(Clone, Debug)]
828    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
829
830    impl GetLocation {
831        pub(crate) fn new(
832            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
833        ) -> Self {
834            Self(RequestBuilder::new(stub))
835        }
836
837        /// Sets the full request, replacing any prior values.
838        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
839            mut self,
840            v: V,
841        ) -> Self {
842            self.0.request = v.into();
843            self
844        }
845
846        /// Sets all the options, replacing any prior values.
847        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
848            self.0.options = v.into();
849            self
850        }
851
852        /// Sends the request.
853        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
854            (*self.0.stub)
855                .get_location(self.0.request, self.0.options)
856                .await
857                .map(crate::Response::into_body)
858        }
859
860        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
861        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
862            self.0.request.name = v.into();
863            self
864        }
865    }
866
867    #[doc(hidden)]
868    impl crate::RequestBuilder for GetLocation {
869        fn request_options(&mut self) -> &mut crate::RequestOptions {
870            &mut self.0.options
871        }
872    }
873}