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