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 [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation].
298        ///
299        /// Note that all the setters affecting `tee_attestation` are
300        /// mutually exclusive.
301        pub fn set_tee_attestation<
302            T: Into<Option<crate::model::verify_attestation_request::TeeAttestation>>,
303        >(
304            mut self,
305            v: T,
306        ) -> Self {
307            self.0.request.tee_attestation = v.into();
308            self
309        }
310
311        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
312        /// to hold a `TdCcel`.
313        ///
314        /// Note that all the setters affecting `tee_attestation` are
315        /// mutually exclusive.
316        pub fn set_td_ccel<
317            T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>,
318        >(
319            mut self,
320            v: T,
321        ) -> Self {
322            self.0.request = self.0.request.set_td_ccel(v);
323            self
324        }
325
326        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
327        /// to hold a `SevSnpAttestation`.
328        ///
329        /// Note that all the setters affecting `tee_attestation` are
330        /// mutually exclusive.
331        pub fn set_sev_snp_attestation<
332            T: std::convert::Into<std::boxed::Box<crate::model::SevSnpAttestation>>,
333        >(
334            mut self,
335            v: T,
336        ) -> Self {
337            self.0.request = self.0.request.set_sev_snp_attestation(v);
338            self
339        }
340
341        /// Sets the value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation].
342        ///
343        /// Note that all the setters affecting `device_attestation` are
344        /// mutually exclusive.
345        pub fn set_device_attestation<
346            T: Into<Option<crate::model::verify_attestation_request::DeviceAttestation>>,
347        >(
348            mut self,
349            v: T,
350        ) -> Self {
351            self.0.request.device_attestation = v.into();
352            self
353        }
354
355        /// Sets the value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation]
356        /// to hold a `NvidiaAttestation`.
357        ///
358        /// Note that all the setters affecting `device_attestation` are
359        /// mutually exclusive.
360        pub fn set_nvidia_attestation<
361            T: std::convert::Into<std::boxed::Box<crate::model::NvidiaAttestation>>,
362        >(
363            mut self,
364            v: T,
365        ) -> Self {
366            self.0.request = self.0.request.set_nvidia_attestation(v);
367            self
368        }
369    }
370
371    #[doc(hidden)]
372    impl crate::RequestBuilder for VerifyAttestation {
373        fn request_options(&mut self) -> &mut crate::RequestOptions {
374            &mut self.0.options
375        }
376    }
377
378    /// The request builder for [ConfidentialComputing::verify_confidential_space][crate::client::ConfidentialComputing::verify_confidential_space] calls.
379    ///
380    /// # Example
381    /// ```
382    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::VerifyConfidentialSpace;
383    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
384    ///
385    /// let builder = prepare_request_builder();
386    /// let response = builder.send().await?;
387    /// # Ok(()) }
388    ///
389    /// fn prepare_request_builder() -> VerifyConfidentialSpace {
390    ///   # panic!();
391    ///   // ... details omitted ...
392    /// }
393    /// ```
394    #[derive(Clone, Debug)]
395    pub struct VerifyConfidentialSpace(
396        RequestBuilder<crate::model::VerifyConfidentialSpaceRequest>,
397    );
398
399    impl VerifyConfidentialSpace {
400        pub(crate) fn new(
401            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
402        ) -> Self {
403            Self(RequestBuilder::new(stub))
404        }
405
406        /// Sets the full request, replacing any prior values.
407        pub fn with_request<V: Into<crate::model::VerifyConfidentialSpaceRequest>>(
408            mut self,
409            v: V,
410        ) -> Self {
411            self.0.request = v.into();
412            self
413        }
414
415        /// Sets all the options, replacing any prior values.
416        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
417            self.0.options = v.into();
418            self
419        }
420
421        /// Sends the request.
422        pub async fn send(self) -> Result<crate::model::VerifyConfidentialSpaceResponse> {
423            (*self.0.stub)
424                .verify_confidential_space(self.0.request, self.0.options)
425                .await
426                .map(crate::Response::into_body)
427        }
428
429        /// Sets the value of [challenge][crate::model::VerifyConfidentialSpaceRequest::challenge].
430        ///
431        /// This is a **required** field for requests.
432        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
433            self.0.request.challenge = v.into();
434            self
435        }
436
437        /// Sets the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
438        pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
439        where
440            T: std::convert::Into<crate::model::GcpCredentials>,
441        {
442            self.0.request.gcp_credentials = std::option::Option::Some(v.into());
443            self
444        }
445
446        /// Sets or clears the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
447        pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
448        where
449            T: std::convert::Into<crate::model::GcpCredentials>,
450        {
451            self.0.request.gcp_credentials = v.map(|x| x.into());
452            self
453        }
454
455        /// Sets the value of [signed_entities][crate::model::VerifyConfidentialSpaceRequest::signed_entities].
456        pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
457        where
458            T: std::iter::IntoIterator<Item = V>,
459            V: std::convert::Into<crate::model::SignedEntity>,
460        {
461            use std::iter::Iterator;
462            self.0.request.signed_entities = v.into_iter().map(|i| i.into()).collect();
463            self
464        }
465
466        /// Sets the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
467        pub fn set_gce_shielded_identity<T>(mut self, v: T) -> Self
468        where
469            T: std::convert::Into<crate::model::GceShieldedIdentity>,
470        {
471            self.0.request.gce_shielded_identity = std::option::Option::Some(v.into());
472            self
473        }
474
475        /// Sets or clears the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
476        pub fn set_or_clear_gce_shielded_identity<T>(mut self, v: std::option::Option<T>) -> Self
477        where
478            T: std::convert::Into<crate::model::GceShieldedIdentity>,
479        {
480            self.0.request.gce_shielded_identity = v.map(|x| x.into());
481            self
482        }
483
484        /// Sets the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
485        pub fn set_options<T>(mut self, v: T) -> Self
486        where
487            T: std::convert::Into<
488                    crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
489                >,
490        {
491            self.0.request.options = std::option::Option::Some(v.into());
492            self
493        }
494
495        /// Sets or clears the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
496        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
497        where
498            T: std::convert::Into<
499                    crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
500                >,
501        {
502            self.0.request.options = v.map(|x| x.into());
503            self
504        }
505
506        /// Sets the value of [nvidia_attestation][crate::model::VerifyConfidentialSpaceRequest::nvidia_attestation].
507        pub fn set_nvidia_attestation<T>(mut self, v: T) -> Self
508        where
509            T: std::convert::Into<crate::model::NvidiaAttestation>,
510        {
511            self.0.request.nvidia_attestation = std::option::Option::Some(v.into());
512            self
513        }
514
515        /// Sets or clears the value of [nvidia_attestation][crate::model::VerifyConfidentialSpaceRequest::nvidia_attestation].
516        pub fn set_or_clear_nvidia_attestation<T>(mut self, v: std::option::Option<T>) -> Self
517        where
518            T: std::convert::Into<crate::model::NvidiaAttestation>,
519        {
520            self.0.request.nvidia_attestation = v.map(|x| x.into());
521            self
522        }
523
524        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation].
525        ///
526        /// Note that all the setters affecting `tee_attestation` are
527        /// mutually exclusive.
528        pub fn set_tee_attestation<
529            T: Into<Option<crate::model::verify_confidential_space_request::TeeAttestation>>,
530        >(
531            mut self,
532            v: T,
533        ) -> Self {
534            self.0.request.tee_attestation = v.into();
535            self
536        }
537
538        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
539        /// to hold a `TdCcel`.
540        ///
541        /// Note that all the setters affecting `tee_attestation` are
542        /// mutually exclusive.
543        pub fn set_td_ccel<
544            T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>,
545        >(
546            mut self,
547            v: T,
548        ) -> Self {
549            self.0.request = self.0.request.set_td_ccel(v);
550            self
551        }
552
553        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
554        /// to hold a `TpmAttestation`.
555        ///
556        /// Note that all the setters affecting `tee_attestation` are
557        /// mutually exclusive.
558        pub fn set_tpm_attestation<
559            T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
560        >(
561            mut self,
562            v: T,
563        ) -> Self {
564            self.0.request = self.0.request.set_tpm_attestation(v);
565            self
566        }
567    }
568
569    #[doc(hidden)]
570    impl crate::RequestBuilder for VerifyConfidentialSpace {
571        fn request_options(&mut self) -> &mut crate::RequestOptions {
572            &mut self.0.options
573        }
574    }
575
576    /// The request builder for [ConfidentialComputing::verify_confidential_gke][crate::client::ConfidentialComputing::verify_confidential_gke] calls.
577    ///
578    /// # Example
579    /// ```
580    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::VerifyConfidentialGke;
581    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
582    ///
583    /// let builder = prepare_request_builder();
584    /// let response = builder.send().await?;
585    /// # Ok(()) }
586    ///
587    /// fn prepare_request_builder() -> VerifyConfidentialGke {
588    ///   # panic!();
589    ///   // ... details omitted ...
590    /// }
591    /// ```
592    #[derive(Clone, Debug)]
593    pub struct VerifyConfidentialGke(RequestBuilder<crate::model::VerifyConfidentialGkeRequest>);
594
595    impl VerifyConfidentialGke {
596        pub(crate) fn new(
597            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
598        ) -> Self {
599            Self(RequestBuilder::new(stub))
600        }
601
602        /// Sets the full request, replacing any prior values.
603        pub fn with_request<V: Into<crate::model::VerifyConfidentialGkeRequest>>(
604            mut self,
605            v: V,
606        ) -> Self {
607            self.0.request = v.into();
608            self
609        }
610
611        /// Sets all the options, replacing any prior values.
612        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
613            self.0.options = v.into();
614            self
615        }
616
617        /// Sends the request.
618        pub async fn send(self) -> Result<crate::model::VerifyConfidentialGkeResponse> {
619            (*self.0.stub)
620                .verify_confidential_gke(self.0.request, self.0.options)
621                .await
622                .map(crate::Response::into_body)
623        }
624
625        /// Sets the value of [challenge][crate::model::VerifyConfidentialGkeRequest::challenge].
626        ///
627        /// This is a **required** field for requests.
628        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
629            self.0.request.challenge = v.into();
630            self
631        }
632
633        /// Sets the value of [options][crate::model::VerifyConfidentialGkeRequest::options].
634        pub fn set_options<T>(mut self, v: T) -> Self
635        where
636            T: std::convert::Into<
637                    crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
638                >,
639        {
640            self.0.request.options = std::option::Option::Some(v.into());
641            self
642        }
643
644        /// Sets or clears the value of [options][crate::model::VerifyConfidentialGkeRequest::options].
645        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
646        where
647            T: std::convert::Into<
648                    crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
649                >,
650        {
651            self.0.request.options = v.map(|x| x.into());
652            self
653        }
654
655        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation].
656        ///
657        /// Note that all the setters affecting `tee_attestation` are
658        /// mutually exclusive.
659        pub fn set_tee_attestation<
660            T: Into<Option<crate::model::verify_confidential_gke_request::TeeAttestation>>,
661        >(
662            mut self,
663            v: T,
664        ) -> Self {
665            self.0.request.tee_attestation = v.into();
666            self
667        }
668
669        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
670        /// to hold a `TpmAttestation`.
671        ///
672        /// Note that all the setters affecting `tee_attestation` are
673        /// mutually exclusive.
674        pub fn set_tpm_attestation<
675            T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
676        >(
677            mut self,
678            v: T,
679        ) -> Self {
680            self.0.request = self.0.request.set_tpm_attestation(v);
681            self
682        }
683    }
684
685    #[doc(hidden)]
686    impl crate::RequestBuilder for VerifyConfidentialGke {
687        fn request_options(&mut self) -> &mut crate::RequestOptions {
688            &mut self.0.options
689        }
690    }
691
692    /// The request builder for [ConfidentialComputing::list_locations][crate::client::ConfidentialComputing::list_locations] calls.
693    ///
694    /// # Example
695    /// ```
696    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::ListLocations;
697    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
698    /// use google_cloud_gax::paginator::ItemPaginator;
699    ///
700    /// let builder = prepare_request_builder();
701    /// let mut items = builder.by_item();
702    /// while let Some(result) = items.next().await {
703    ///   let item = result?;
704    /// }
705    /// # Ok(()) }
706    ///
707    /// fn prepare_request_builder() -> ListLocations {
708    ///   # panic!();
709    ///   // ... details omitted ...
710    /// }
711    /// ```
712    #[derive(Clone, Debug)]
713    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
714
715    impl ListLocations {
716        pub(crate) fn new(
717            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
718        ) -> Self {
719            Self(RequestBuilder::new(stub))
720        }
721
722        /// Sets the full request, replacing any prior values.
723        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
724            mut self,
725            v: V,
726        ) -> Self {
727            self.0.request = v.into();
728            self
729        }
730
731        /// Sets all the options, replacing any prior values.
732        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
733            self.0.options = v.into();
734            self
735        }
736
737        /// Sends the request.
738        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
739            (*self.0.stub)
740                .list_locations(self.0.request, self.0.options)
741                .await
742                .map(crate::Response::into_body)
743        }
744
745        /// Streams each page in the collection.
746        pub fn by_page(
747            self,
748        ) -> impl google_cloud_gax::paginator::Paginator<
749            google_cloud_location::model::ListLocationsResponse,
750            crate::Error,
751        > {
752            use std::clone::Clone;
753            let token = self.0.request.page_token.clone();
754            let execute = move |token: String| {
755                let mut builder = self.clone();
756                builder.0.request = builder.0.request.set_page_token(token);
757                builder.send()
758            };
759            google_cloud_gax::paginator::internal::new_paginator(token, execute)
760        }
761
762        /// Streams each item in the collection.
763        pub fn by_item(
764            self,
765        ) -> impl google_cloud_gax::paginator::ItemPaginator<
766            google_cloud_location::model::ListLocationsResponse,
767            crate::Error,
768        > {
769            use google_cloud_gax::paginator::Paginator;
770            self.by_page().items()
771        }
772
773        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
774        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
775            self.0.request.name = v.into();
776            self
777        }
778
779        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
780        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
781            self.0.request.filter = v.into();
782            self
783        }
784
785        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
786        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
787            self.0.request.page_size = v.into();
788            self
789        }
790
791        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
792        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
793            self.0.request.page_token = v.into();
794            self
795        }
796    }
797
798    #[doc(hidden)]
799    impl crate::RequestBuilder for ListLocations {
800        fn request_options(&mut self) -> &mut crate::RequestOptions {
801            &mut self.0.options
802        }
803    }
804
805    /// The request builder for [ConfidentialComputing::get_location][crate::client::ConfidentialComputing::get_location] calls.
806    ///
807    /// # Example
808    /// ```
809    /// # use google_cloud_confidentialcomputing_v1::builder::confidential_computing::GetLocation;
810    /// # async fn sample() -> google_cloud_confidentialcomputing_v1::Result<()> {
811    ///
812    /// let builder = prepare_request_builder();
813    /// let response = builder.send().await?;
814    /// # Ok(()) }
815    ///
816    /// fn prepare_request_builder() -> GetLocation {
817    ///   # panic!();
818    ///   // ... details omitted ...
819    /// }
820    /// ```
821    #[derive(Clone, Debug)]
822    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
823
824    impl GetLocation {
825        pub(crate) fn new(
826            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
827        ) -> Self {
828            Self(RequestBuilder::new(stub))
829        }
830
831        /// Sets the full request, replacing any prior values.
832        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
833            mut self,
834            v: V,
835        ) -> Self {
836            self.0.request = v.into();
837            self
838        }
839
840        /// Sets all the options, replacing any prior values.
841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
842            self.0.options = v.into();
843            self
844        }
845
846        /// Sends the request.
847        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
848            (*self.0.stub)
849                .get_location(self.0.request, self.0.options)
850                .await
851                .map(crate::Response::into_body)
852        }
853
854        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
855        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
856            self.0.request.name = v.into();
857            self
858        }
859    }
860
861    #[doc(hidden)]
862    impl crate::RequestBuilder for GetLocation {
863        fn request_options(&mut self) -> &mut crate::RequestOptions {
864            &mut self.0.options
865        }
866    }
867}