google_cloud_confidentialcomputing_v1/
model.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#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate reqwest;
27extern crate rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// A Challenge from the server used to guarantee freshness of attestations
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Challenge {
43    /// Output only. The resource name for this Challenge in the format
44    /// `projects/*/locations/*/challenges/*`
45    pub name: std::string::String,
46
47    /// Output only. The time at which this Challenge was created
48    pub create_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. The time at which this Challenge will no longer be usable. It
51    /// is also the expiration time for any tokens generated from this Challenge.
52    pub expire_time: std::option::Option<wkt::Timestamp>,
53
54    /// Output only. Indicates if this challenge has been used to generate a token.
55    pub used: bool,
56
57    /// Output only. Identical to nonce, but as a string.
58    pub tpm_nonce: std::string::String,
59
60    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl Challenge {
64    pub fn new() -> Self {
65        std::default::Default::default()
66    }
67
68    /// Sets the value of [name][crate::model::Challenge::name].
69    ///
70    /// # Example
71    /// ```ignore,no_run
72    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
73    /// let x = Challenge::new().set_name("example");
74    /// ```
75    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.name = v.into();
77        self
78    }
79
80    /// Sets the value of [create_time][crate::model::Challenge::create_time].
81    ///
82    /// # Example
83    /// ```ignore,no_run
84    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
85    /// use wkt::Timestamp;
86    /// let x = Challenge::new().set_create_time(Timestamp::default()/* use setters */);
87    /// ```
88    pub fn set_create_time<T>(mut self, v: T) -> Self
89    where
90        T: std::convert::Into<wkt::Timestamp>,
91    {
92        self.create_time = std::option::Option::Some(v.into());
93        self
94    }
95
96    /// Sets or clears the value of [create_time][crate::model::Challenge::create_time].
97    ///
98    /// # Example
99    /// ```ignore,no_run
100    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
101    /// use wkt::Timestamp;
102    /// let x = Challenge::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
103    /// let x = Challenge::new().set_or_clear_create_time(None::<Timestamp>);
104    /// ```
105    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
106    where
107        T: std::convert::Into<wkt::Timestamp>,
108    {
109        self.create_time = v.map(|x| x.into());
110        self
111    }
112
113    /// Sets the value of [expire_time][crate::model::Challenge::expire_time].
114    ///
115    /// # Example
116    /// ```ignore,no_run
117    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
118    /// use wkt::Timestamp;
119    /// let x = Challenge::new().set_expire_time(Timestamp::default()/* use setters */);
120    /// ```
121    pub fn set_expire_time<T>(mut self, v: T) -> Self
122    where
123        T: std::convert::Into<wkt::Timestamp>,
124    {
125        self.expire_time = std::option::Option::Some(v.into());
126        self
127    }
128
129    /// Sets or clears the value of [expire_time][crate::model::Challenge::expire_time].
130    ///
131    /// # Example
132    /// ```ignore,no_run
133    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
134    /// use wkt::Timestamp;
135    /// let x = Challenge::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
136    /// let x = Challenge::new().set_or_clear_expire_time(None::<Timestamp>);
137    /// ```
138    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
139    where
140        T: std::convert::Into<wkt::Timestamp>,
141    {
142        self.expire_time = v.map(|x| x.into());
143        self
144    }
145
146    /// Sets the value of [used][crate::model::Challenge::used].
147    ///
148    /// # Example
149    /// ```ignore,no_run
150    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
151    /// let x = Challenge::new().set_used(true);
152    /// ```
153    pub fn set_used<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
154        self.used = v.into();
155        self
156    }
157
158    /// Sets the value of [tpm_nonce][crate::model::Challenge::tpm_nonce].
159    ///
160    /// # Example
161    /// ```ignore,no_run
162    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
163    /// let x = Challenge::new().set_tpm_nonce("example");
164    /// ```
165    pub fn set_tpm_nonce<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
166        self.tpm_nonce = v.into();
167        self
168    }
169}
170
171impl wkt::message::Message for Challenge {
172    fn typename() -> &'static str {
173        "type.googleapis.com/google.cloud.confidentialcomputing.v1.Challenge"
174    }
175}
176
177/// Message for creating a Challenge
178#[derive(Clone, Default, PartialEq)]
179#[non_exhaustive]
180pub struct CreateChallengeRequest {
181    /// Required. The resource name of the location where the Challenge will be
182    /// used, in the format `projects/*/locations/*`.
183    pub parent: std::string::String,
184
185    /// Required. The Challenge to be created. Currently this field can be empty as
186    /// all the Challenge fields are set by the server.
187    pub challenge: std::option::Option<crate::model::Challenge>,
188
189    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
190}
191
192impl CreateChallengeRequest {
193    pub fn new() -> Self {
194        std::default::Default::default()
195    }
196
197    /// Sets the value of [parent][crate::model::CreateChallengeRequest::parent].
198    ///
199    /// # Example
200    /// ```ignore,no_run
201    /// # use google_cloud_confidentialcomputing_v1::model::CreateChallengeRequest;
202    /// let x = CreateChallengeRequest::new().set_parent("example");
203    /// ```
204    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205        self.parent = v.into();
206        self
207    }
208
209    /// Sets the value of [challenge][crate::model::CreateChallengeRequest::challenge].
210    ///
211    /// # Example
212    /// ```ignore,no_run
213    /// # use google_cloud_confidentialcomputing_v1::model::CreateChallengeRequest;
214    /// use google_cloud_confidentialcomputing_v1::model::Challenge;
215    /// let x = CreateChallengeRequest::new().set_challenge(Challenge::default()/* use setters */);
216    /// ```
217    pub fn set_challenge<T>(mut self, v: T) -> Self
218    where
219        T: std::convert::Into<crate::model::Challenge>,
220    {
221        self.challenge = std::option::Option::Some(v.into());
222        self
223    }
224
225    /// Sets or clears the value of [challenge][crate::model::CreateChallengeRequest::challenge].
226    ///
227    /// # Example
228    /// ```ignore,no_run
229    /// # use google_cloud_confidentialcomputing_v1::model::CreateChallengeRequest;
230    /// use google_cloud_confidentialcomputing_v1::model::Challenge;
231    /// let x = CreateChallengeRequest::new().set_or_clear_challenge(Some(Challenge::default()/* use setters */));
232    /// let x = CreateChallengeRequest::new().set_or_clear_challenge(None::<Challenge>);
233    /// ```
234    pub fn set_or_clear_challenge<T>(mut self, v: std::option::Option<T>) -> Self
235    where
236        T: std::convert::Into<crate::model::Challenge>,
237    {
238        self.challenge = v.map(|x| x.into());
239        self
240    }
241}
242
243impl wkt::message::Message for CreateChallengeRequest {
244    fn typename() -> &'static str {
245        "type.googleapis.com/google.cloud.confidentialcomputing.v1.CreateChallengeRequest"
246    }
247}
248
249/// A request for an attestation token, providing all the necessary information
250/// needed for this service to verify the platform state of the requestor.
251#[derive(Clone, Default, PartialEq)]
252#[non_exhaustive]
253pub struct VerifyAttestationRequest {
254    /// Required. The name of the Challenge whose nonce was used to generate the
255    /// attestation, in the format `projects/*/locations/*/challenges/*`. The
256    /// provided Challenge will be consumed, and cannot be used again.
257    pub challenge: std::string::String,
258
259    /// Optional. Credentials used to populate the "emails" claim in the
260    /// claims_token.
261    pub gcp_credentials: std::option::Option<crate::model::GcpCredentials>,
262
263    /// Required. The TPM-specific data provided by the attesting platform, used to
264    /// populate any of the claims regarding platform state.
265    pub tpm_attestation: std::option::Option<crate::model::TpmAttestation>,
266
267    /// Optional. Optional information related to the Confidential Space TEE.
268    pub confidential_space_info: std::option::Option<crate::model::ConfidentialSpaceInfo>,
269
270    /// Optional. A collection of optional, workload-specified claims that modify
271    /// the token output.
272    pub token_options: std::option::Option<crate::model::TokenOptions>,
273
274    /// Optional. An optional indicator of the attester, only applies to certain
275    /// products.
276    pub attester: std::string::String,
277
278    /// An optional tee attestation report, used to populate hardware rooted
279    /// claims.
280    pub tee_attestation:
281        std::option::Option<crate::model::verify_attestation_request::TeeAttestation>,
282
283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
284}
285
286impl VerifyAttestationRequest {
287    pub fn new() -> Self {
288        std::default::Default::default()
289    }
290
291    /// Sets the value of [challenge][crate::model::VerifyAttestationRequest::challenge].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
296    /// let x = VerifyAttestationRequest::new().set_challenge("example");
297    /// ```
298    pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
299        self.challenge = v.into();
300        self
301    }
302
303    /// Sets the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
304    ///
305    /// # Example
306    /// ```ignore,no_run
307    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
308    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
309    /// let x = VerifyAttestationRequest::new().set_gcp_credentials(GcpCredentials::default()/* use setters */);
310    /// ```
311    pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
312    where
313        T: std::convert::Into<crate::model::GcpCredentials>,
314    {
315        self.gcp_credentials = std::option::Option::Some(v.into());
316        self
317    }
318
319    /// Sets or clears the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
320    ///
321    /// # Example
322    /// ```ignore,no_run
323    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
324    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
325    /// let x = VerifyAttestationRequest::new().set_or_clear_gcp_credentials(Some(GcpCredentials::default()/* use setters */));
326    /// let x = VerifyAttestationRequest::new().set_or_clear_gcp_credentials(None::<GcpCredentials>);
327    /// ```
328    pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
329    where
330        T: std::convert::Into<crate::model::GcpCredentials>,
331    {
332        self.gcp_credentials = v.map(|x| x.into());
333        self
334    }
335
336    /// Sets the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
337    ///
338    /// # Example
339    /// ```ignore,no_run
340    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
341    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
342    /// let x = VerifyAttestationRequest::new().set_tpm_attestation(TpmAttestation::default()/* use setters */);
343    /// ```
344    pub fn set_tpm_attestation<T>(mut self, v: T) -> Self
345    where
346        T: std::convert::Into<crate::model::TpmAttestation>,
347    {
348        self.tpm_attestation = std::option::Option::Some(v.into());
349        self
350    }
351
352    /// Sets or clears the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
353    ///
354    /// # Example
355    /// ```ignore,no_run
356    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
357    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
358    /// let x = VerifyAttestationRequest::new().set_or_clear_tpm_attestation(Some(TpmAttestation::default()/* use setters */));
359    /// let x = VerifyAttestationRequest::new().set_or_clear_tpm_attestation(None::<TpmAttestation>);
360    /// ```
361    pub fn set_or_clear_tpm_attestation<T>(mut self, v: std::option::Option<T>) -> Self
362    where
363        T: std::convert::Into<crate::model::TpmAttestation>,
364    {
365        self.tpm_attestation = v.map(|x| x.into());
366        self
367    }
368
369    /// Sets the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
370    ///
371    /// # Example
372    /// ```ignore,no_run
373    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
374    /// use google_cloud_confidentialcomputing_v1::model::ConfidentialSpaceInfo;
375    /// let x = VerifyAttestationRequest::new().set_confidential_space_info(ConfidentialSpaceInfo::default()/* use setters */);
376    /// ```
377    pub fn set_confidential_space_info<T>(mut self, v: T) -> Self
378    where
379        T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
380    {
381        self.confidential_space_info = std::option::Option::Some(v.into());
382        self
383    }
384
385    /// Sets or clears the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
386    ///
387    /// # Example
388    /// ```ignore,no_run
389    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
390    /// use google_cloud_confidentialcomputing_v1::model::ConfidentialSpaceInfo;
391    /// let x = VerifyAttestationRequest::new().set_or_clear_confidential_space_info(Some(ConfidentialSpaceInfo::default()/* use setters */));
392    /// let x = VerifyAttestationRequest::new().set_or_clear_confidential_space_info(None::<ConfidentialSpaceInfo>);
393    /// ```
394    pub fn set_or_clear_confidential_space_info<T>(mut self, v: std::option::Option<T>) -> Self
395    where
396        T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
397    {
398        self.confidential_space_info = v.map(|x| x.into());
399        self
400    }
401
402    /// Sets the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
403    ///
404    /// # Example
405    /// ```ignore,no_run
406    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
407    /// use google_cloud_confidentialcomputing_v1::model::TokenOptions;
408    /// let x = VerifyAttestationRequest::new().set_token_options(TokenOptions::default()/* use setters */);
409    /// ```
410    pub fn set_token_options<T>(mut self, v: T) -> Self
411    where
412        T: std::convert::Into<crate::model::TokenOptions>,
413    {
414        self.token_options = std::option::Option::Some(v.into());
415        self
416    }
417
418    /// Sets or clears the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
419    ///
420    /// # Example
421    /// ```ignore,no_run
422    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
423    /// use google_cloud_confidentialcomputing_v1::model::TokenOptions;
424    /// let x = VerifyAttestationRequest::new().set_or_clear_token_options(Some(TokenOptions::default()/* use setters */));
425    /// let x = VerifyAttestationRequest::new().set_or_clear_token_options(None::<TokenOptions>);
426    /// ```
427    pub fn set_or_clear_token_options<T>(mut self, v: std::option::Option<T>) -> Self
428    where
429        T: std::convert::Into<crate::model::TokenOptions>,
430    {
431        self.token_options = v.map(|x| x.into());
432        self
433    }
434
435    /// Sets the value of [attester][crate::model::VerifyAttestationRequest::attester].
436    ///
437    /// # Example
438    /// ```ignore,no_run
439    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
440    /// let x = VerifyAttestationRequest::new().set_attester("example");
441    /// ```
442    pub fn set_attester<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
443        self.attester = v.into();
444        self
445    }
446
447    /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation].
448    ///
449    /// Note that all the setters affecting `tee_attestation` are mutually
450    /// exclusive.
451    ///
452    /// # Example
453    /// ```ignore,no_run
454    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
455    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
456    /// let x = VerifyAttestationRequest::new().set_tee_attestation(Some(
457    ///     google_cloud_confidentialcomputing_v1::model::verify_attestation_request::TeeAttestation::TdCcel(TdxCcelAttestation::default().into())));
458    /// ```
459    pub fn set_tee_attestation<
460        T: std::convert::Into<
461                std::option::Option<crate::model::verify_attestation_request::TeeAttestation>,
462            >,
463    >(
464        mut self,
465        v: T,
466    ) -> Self {
467        self.tee_attestation = v.into();
468        self
469    }
470
471    /// The value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
472    /// if it holds a `TdCcel`, `None` if the field is not set or
473    /// holds a different branch.
474    pub fn td_ccel(
475        &self,
476    ) -> std::option::Option<&std::boxed::Box<crate::model::TdxCcelAttestation>> {
477        #[allow(unreachable_patterns)]
478        self.tee_attestation.as_ref().and_then(|v| match v {
479            crate::model::verify_attestation_request::TeeAttestation::TdCcel(v) => {
480                std::option::Option::Some(v)
481            }
482            _ => std::option::Option::None,
483        })
484    }
485
486    /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
487    /// to hold a `TdCcel`.
488    ///
489    /// Note that all the setters affecting `tee_attestation` are
490    /// mutually exclusive.
491    ///
492    /// # Example
493    /// ```ignore,no_run
494    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
495    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
496    /// let x = VerifyAttestationRequest::new().set_td_ccel(TdxCcelAttestation::default()/* use setters */);
497    /// assert!(x.td_ccel().is_some());
498    /// assert!(x.sev_snp_attestation().is_none());
499    /// ```
500    pub fn set_td_ccel<T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>>(
501        mut self,
502        v: T,
503    ) -> Self {
504        self.tee_attestation = std::option::Option::Some(
505            crate::model::verify_attestation_request::TeeAttestation::TdCcel(v.into()),
506        );
507        self
508    }
509
510    /// The value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
511    /// if it holds a `SevSnpAttestation`, `None` if the field is not set or
512    /// holds a different branch.
513    pub fn sev_snp_attestation(
514        &self,
515    ) -> std::option::Option<&std::boxed::Box<crate::model::SevSnpAttestation>> {
516        #[allow(unreachable_patterns)]
517        self.tee_attestation.as_ref().and_then(|v| match v {
518            crate::model::verify_attestation_request::TeeAttestation::SevSnpAttestation(v) => {
519                std::option::Option::Some(v)
520            }
521            _ => std::option::Option::None,
522        })
523    }
524
525    /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
526    /// to hold a `SevSnpAttestation`.
527    ///
528    /// Note that all the setters affecting `tee_attestation` are
529    /// mutually exclusive.
530    ///
531    /// # Example
532    /// ```ignore,no_run
533    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
534    /// use google_cloud_confidentialcomputing_v1::model::SevSnpAttestation;
535    /// let x = VerifyAttestationRequest::new().set_sev_snp_attestation(SevSnpAttestation::default()/* use setters */);
536    /// assert!(x.sev_snp_attestation().is_some());
537    /// assert!(x.td_ccel().is_none());
538    /// ```
539    pub fn set_sev_snp_attestation<
540        T: std::convert::Into<std::boxed::Box<crate::model::SevSnpAttestation>>,
541    >(
542        mut self,
543        v: T,
544    ) -> Self {
545        self.tee_attestation = std::option::Option::Some(
546            crate::model::verify_attestation_request::TeeAttestation::SevSnpAttestation(v.into()),
547        );
548        self
549    }
550}
551
552impl wkt::message::Message for VerifyAttestationRequest {
553    fn typename() -> &'static str {
554        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyAttestationRequest"
555    }
556}
557
558/// Defines additional types related to [VerifyAttestationRequest].
559pub mod verify_attestation_request {
560    #[allow(unused_imports)]
561    use super::*;
562
563    /// An optional tee attestation report, used to populate hardware rooted
564    /// claims.
565    #[derive(Clone, Debug, PartialEq)]
566    #[non_exhaustive]
567    pub enum TeeAttestation {
568        /// Optional. A TDX with CCEL and RTMR Attestation Quote.
569        TdCcel(std::boxed::Box<crate::model::TdxCcelAttestation>),
570        /// Optional. An SEV-SNP Attestation Report.
571        SevSnpAttestation(std::boxed::Box<crate::model::SevSnpAttestation>),
572    }
573}
574
575/// A TDX Attestation quote.
576#[derive(Clone, Default, PartialEq)]
577#[non_exhaustive]
578pub struct TdxCcelAttestation {
579    /// Optional. The Confidential Computing Event Log (CCEL) ACPI table. Formatted
580    /// as described in the ACPI Specification 6.5.
581    pub ccel_acpi_table: ::bytes::Bytes,
582
583    /// Optional. The CCEL event log. Formatted as described in the UEFI 2.10.
584    pub ccel_data: ::bytes::Bytes,
585
586    /// Optional. An Event Log containing additional events measured into the RTMR
587    /// that are not already present in the CCEL.
588    pub canonical_event_log: ::bytes::Bytes,
589
590    /// Optional. The TDX attestation quote from the guest. It contains the RTMR
591    /// values.
592    pub td_quote: ::bytes::Bytes,
593
594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
595}
596
597impl TdxCcelAttestation {
598    pub fn new() -> Self {
599        std::default::Default::default()
600    }
601
602    /// Sets the value of [ccel_acpi_table][crate::model::TdxCcelAttestation::ccel_acpi_table].
603    ///
604    /// # Example
605    /// ```ignore,no_run
606    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
607    /// let x = TdxCcelAttestation::new().set_ccel_acpi_table(bytes::Bytes::from_static(b"example"));
608    /// ```
609    pub fn set_ccel_acpi_table<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
610        self.ccel_acpi_table = v.into();
611        self
612    }
613
614    /// Sets the value of [ccel_data][crate::model::TdxCcelAttestation::ccel_data].
615    ///
616    /// # Example
617    /// ```ignore,no_run
618    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
619    /// let x = TdxCcelAttestation::new().set_ccel_data(bytes::Bytes::from_static(b"example"));
620    /// ```
621    pub fn set_ccel_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
622        self.ccel_data = v.into();
623        self
624    }
625
626    /// Sets the value of [canonical_event_log][crate::model::TdxCcelAttestation::canonical_event_log].
627    ///
628    /// # Example
629    /// ```ignore,no_run
630    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
631    /// let x = TdxCcelAttestation::new().set_canonical_event_log(bytes::Bytes::from_static(b"example"));
632    /// ```
633    pub fn set_canonical_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
634        self.canonical_event_log = v.into();
635        self
636    }
637
638    /// Sets the value of [td_quote][crate::model::TdxCcelAttestation::td_quote].
639    ///
640    /// # Example
641    /// ```ignore,no_run
642    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
643    /// let x = TdxCcelAttestation::new().set_td_quote(bytes::Bytes::from_static(b"example"));
644    /// ```
645    pub fn set_td_quote<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
646        self.td_quote = v.into();
647        self
648    }
649}
650
651impl wkt::message::Message for TdxCcelAttestation {
652    fn typename() -> &'static str {
653        "type.googleapis.com/google.cloud.confidentialcomputing.v1.TdxCcelAttestation"
654    }
655}
656
657/// An SEV-SNP Attestation Report.
658/// Contains the attestation report and the certificate bundle that the client
659/// collects.
660#[derive(Clone, Default, PartialEq)]
661#[non_exhaustive]
662pub struct SevSnpAttestation {
663    /// Optional. The SEV-SNP Attestation Report
664    /// Format is in revision 1.55, §7.3 Attestation, Table 22. ATTESTATION_REPORT
665    /// Structure in this document:
666    /// <https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56860.pdf>
667    pub report: ::bytes::Bytes,
668
669    /// Optional. Certificate bundle defined in the GHCB protocol definition
670    /// Format is documented in GHCB revision 2.03, section 4.1.8.1 struct
671    /// cert_table in this document:
672    /// <https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56421.pdf>
673    pub aux_blob: ::bytes::Bytes,
674
675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
676}
677
678impl SevSnpAttestation {
679    pub fn new() -> Self {
680        std::default::Default::default()
681    }
682
683    /// Sets the value of [report][crate::model::SevSnpAttestation::report].
684    ///
685    /// # Example
686    /// ```ignore,no_run
687    /// # use google_cloud_confidentialcomputing_v1::model::SevSnpAttestation;
688    /// let x = SevSnpAttestation::new().set_report(bytes::Bytes::from_static(b"example"));
689    /// ```
690    pub fn set_report<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
691        self.report = v.into();
692        self
693    }
694
695    /// Sets the value of [aux_blob][crate::model::SevSnpAttestation::aux_blob].
696    ///
697    /// # Example
698    /// ```ignore,no_run
699    /// # use google_cloud_confidentialcomputing_v1::model::SevSnpAttestation;
700    /// let x = SevSnpAttestation::new().set_aux_blob(bytes::Bytes::from_static(b"example"));
701    /// ```
702    pub fn set_aux_blob<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
703        self.aux_blob = v.into();
704        self
705    }
706}
707
708impl wkt::message::Message for SevSnpAttestation {
709    fn typename() -> &'static str {
710        "type.googleapis.com/google.cloud.confidentialcomputing.v1.SevSnpAttestation"
711    }
712}
713
714/// A response once an attestation has been successfully verified, containing a
715/// signed attestation token.
716#[derive(Clone, Default, PartialEq)]
717#[non_exhaustive]
718pub struct VerifyAttestationResponse {
719    /// Output only. Same as claims_token, but as a string.
720    pub oidc_claims_token: std::string::String,
721
722    /// Output only. A list of messages that carry the partial error details
723    /// related to VerifyAttestation.
724    pub partial_errors: std::vec::Vec<rpc::model::Status>,
725
726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
727}
728
729impl VerifyAttestationResponse {
730    pub fn new() -> Self {
731        std::default::Default::default()
732    }
733
734    /// Sets the value of [oidc_claims_token][crate::model::VerifyAttestationResponse::oidc_claims_token].
735    ///
736    /// # Example
737    /// ```ignore,no_run
738    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationResponse;
739    /// let x = VerifyAttestationResponse::new().set_oidc_claims_token("example");
740    /// ```
741    pub fn set_oidc_claims_token<T: std::convert::Into<std::string::String>>(
742        mut self,
743        v: T,
744    ) -> Self {
745        self.oidc_claims_token = v.into();
746        self
747    }
748
749    /// Sets the value of [partial_errors][crate::model::VerifyAttestationResponse::partial_errors].
750    ///
751    /// # Example
752    /// ```ignore,no_run
753    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationResponse;
754    /// use rpc::model::Status;
755    /// let x = VerifyAttestationResponse::new()
756    ///     .set_partial_errors([
757    ///         Status::default()/* use setters */,
758    ///         Status::default()/* use (different) setters */,
759    ///     ]);
760    /// ```
761    pub fn set_partial_errors<T, V>(mut self, v: T) -> Self
762    where
763        T: std::iter::IntoIterator<Item = V>,
764        V: std::convert::Into<rpc::model::Status>,
765    {
766        use std::iter::Iterator;
767        self.partial_errors = v.into_iter().map(|i| i.into()).collect();
768        self
769    }
770}
771
772impl wkt::message::Message for VerifyAttestationResponse {
773    fn typename() -> &'static str {
774        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyAttestationResponse"
775    }
776}
777
778/// Credentials issued by GCP which are linked to the platform attestation. These
779/// will be verified server-side as part of attestaion verification.
780#[derive(Clone, Default, PartialEq)]
781#[non_exhaustive]
782pub struct GcpCredentials {
783    /// Same as id_tokens, but as a string.
784    pub service_account_id_tokens: std::vec::Vec<std::string::String>,
785
786    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
787}
788
789impl GcpCredentials {
790    pub fn new() -> Self {
791        std::default::Default::default()
792    }
793
794    /// Sets the value of [service_account_id_tokens][crate::model::GcpCredentials::service_account_id_tokens].
795    ///
796    /// # Example
797    /// ```ignore,no_run
798    /// # use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
799    /// let x = GcpCredentials::new().set_service_account_id_tokens(["a", "b", "c"]);
800    /// ```
801    pub fn set_service_account_id_tokens<T, V>(mut self, v: T) -> Self
802    where
803        T: std::iter::IntoIterator<Item = V>,
804        V: std::convert::Into<std::string::String>,
805    {
806        use std::iter::Iterator;
807        self.service_account_id_tokens = v.into_iter().map(|i| i.into()).collect();
808        self
809    }
810}
811
812impl wkt::message::Message for GcpCredentials {
813    fn typename() -> &'static str {
814        "type.googleapis.com/google.cloud.confidentialcomputing.v1.GcpCredentials"
815    }
816}
817
818/// Options to modify claims in the token to generate custom-purpose tokens.
819#[derive(Clone, Default, PartialEq)]
820#[non_exhaustive]
821pub struct TokenOptions {
822    /// Optional. Optional string to issue the token with a custom audience claim.
823    /// Required if one or more nonces are specified.
824    pub audience: std::string::String,
825
826    /// Optional. Optional parameter to place one or more nonces in the eat_nonce
827    /// claim in the output token. The minimum size for JSON-encoded EATs is 10
828    /// bytes and the maximum size is 74 bytes.
829    pub nonce: std::vec::Vec<std::string::String>,
830
831    /// Optional. Optional token type to select what type of token to return.
832    pub token_type: crate::model::TokenType,
833
834    /// An optional additional configuration per token type.
835    pub token_type_options: std::option::Option<crate::model::token_options::TokenTypeOptions>,
836
837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
838}
839
840impl TokenOptions {
841    pub fn new() -> Self {
842        std::default::Default::default()
843    }
844
845    /// Sets the value of [audience][crate::model::TokenOptions::audience].
846    ///
847    /// # Example
848    /// ```ignore,no_run
849    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
850    /// let x = TokenOptions::new().set_audience("example");
851    /// ```
852    pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
853        self.audience = v.into();
854        self
855    }
856
857    /// Sets the value of [nonce][crate::model::TokenOptions::nonce].
858    ///
859    /// # Example
860    /// ```ignore,no_run
861    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
862    /// let x = TokenOptions::new().set_nonce(["a", "b", "c"]);
863    /// ```
864    pub fn set_nonce<T, V>(mut self, v: T) -> Self
865    where
866        T: std::iter::IntoIterator<Item = V>,
867        V: std::convert::Into<std::string::String>,
868    {
869        use std::iter::Iterator;
870        self.nonce = v.into_iter().map(|i| i.into()).collect();
871        self
872    }
873
874    /// Sets the value of [token_type][crate::model::TokenOptions::token_type].
875    ///
876    /// # Example
877    /// ```ignore,no_run
878    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
879    /// use google_cloud_confidentialcomputing_v1::model::TokenType;
880    /// let x0 = TokenOptions::new().set_token_type(TokenType::Oidc);
881    /// let x1 = TokenOptions::new().set_token_type(TokenType::Pki);
882    /// let x2 = TokenOptions::new().set_token_type(TokenType::LimitedAws);
883    /// ```
884    pub fn set_token_type<T: std::convert::Into<crate::model::TokenType>>(mut self, v: T) -> Self {
885        self.token_type = v.into();
886        self
887    }
888
889    /// Sets the value of [token_type_options][crate::model::TokenOptions::token_type_options].
890    ///
891    /// Note that all the setters affecting `token_type_options` are mutually
892    /// exclusive.
893    ///
894    /// # Example
895    /// ```ignore,no_run
896    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
897    /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
898    /// let x = TokenOptions::new().set_token_type_options(Some(
899    ///     google_cloud_confidentialcomputing_v1::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(AwsPrincipalTagsOptions::default().into())));
900    /// ```
901    pub fn set_token_type_options<
902        T: std::convert::Into<std::option::Option<crate::model::token_options::TokenTypeOptions>>,
903    >(
904        mut self,
905        v: T,
906    ) -> Self {
907        self.token_type_options = v.into();
908        self
909    }
910
911    /// The value of [token_type_options][crate::model::TokenOptions::token_type_options]
912    /// if it holds a `AwsPrincipalTagsOptions`, `None` if the field is not set or
913    /// holds a different branch.
914    pub fn aws_principal_tags_options(
915        &self,
916    ) -> std::option::Option<&std::boxed::Box<crate::model::AwsPrincipalTagsOptions>> {
917        #[allow(unreachable_patterns)]
918        self.token_type_options.as_ref().and_then(|v| match v {
919            crate::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(v) => {
920                std::option::Option::Some(v)
921            }
922            _ => std::option::Option::None,
923        })
924    }
925
926    /// Sets the value of [token_type_options][crate::model::TokenOptions::token_type_options]
927    /// to hold a `AwsPrincipalTagsOptions`.
928    ///
929    /// Note that all the setters affecting `token_type_options` are
930    /// mutually exclusive.
931    ///
932    /// # Example
933    /// ```ignore,no_run
934    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
935    /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
936    /// let x = TokenOptions::new().set_aws_principal_tags_options(AwsPrincipalTagsOptions::default()/* use setters */);
937    /// assert!(x.aws_principal_tags_options().is_some());
938    /// ```
939    pub fn set_aws_principal_tags_options<
940        T: std::convert::Into<std::boxed::Box<crate::model::AwsPrincipalTagsOptions>>,
941    >(
942        mut self,
943        v: T,
944    ) -> Self {
945        self.token_type_options = std::option::Option::Some(
946            crate::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(v.into()),
947        );
948        self
949    }
950}
951
952impl wkt::message::Message for TokenOptions {
953    fn typename() -> &'static str {
954        "type.googleapis.com/google.cloud.confidentialcomputing.v1.TokenOptions"
955    }
956}
957
958/// Defines additional types related to [TokenOptions].
959pub mod token_options {
960    #[allow(unused_imports)]
961    use super::*;
962
963    /// An optional additional configuration per token type.
964    #[derive(Clone, Debug, PartialEq)]
965    #[non_exhaustive]
966    pub enum TokenTypeOptions {
967        /// Optional. Options for AWS token type.
968        AwsPrincipalTagsOptions(std::boxed::Box<crate::model::AwsPrincipalTagsOptions>),
969    }
970}
971
972/// Token options that only apply to the AWS Principal Tags token type.
973#[derive(Clone, Default, PartialEq)]
974#[non_exhaustive]
975pub struct AwsPrincipalTagsOptions {
976    /// Optional. Principal tags to allow in the token.
977    pub allowed_principal_tags:
978        std::option::Option<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
979
980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
981}
982
983impl AwsPrincipalTagsOptions {
984    pub fn new() -> Self {
985        std::default::Default::default()
986    }
987
988    /// Sets the value of [allowed_principal_tags][crate::model::AwsPrincipalTagsOptions::allowed_principal_tags].
989    ///
990    /// # Example
991    /// ```ignore,no_run
992    /// # use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
993    /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
994    /// let x = AwsPrincipalTagsOptions::new().set_allowed_principal_tags(AllowedPrincipalTags::default()/* use setters */);
995    /// ```
996    pub fn set_allowed_principal_tags<T>(mut self, v: T) -> Self
997    where
998        T: std::convert::Into<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
999    {
1000        self.allowed_principal_tags = std::option::Option::Some(v.into());
1001        self
1002    }
1003
1004    /// Sets or clears the value of [allowed_principal_tags][crate::model::AwsPrincipalTagsOptions::allowed_principal_tags].
1005    ///
1006    /// # Example
1007    /// ```ignore,no_run
1008    /// # use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1009    /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1010    /// let x = AwsPrincipalTagsOptions::new().set_or_clear_allowed_principal_tags(Some(AllowedPrincipalTags::default()/* use setters */));
1011    /// let x = AwsPrincipalTagsOptions::new().set_or_clear_allowed_principal_tags(None::<AllowedPrincipalTags>);
1012    /// ```
1013    pub fn set_or_clear_allowed_principal_tags<T>(mut self, v: std::option::Option<T>) -> Self
1014    where
1015        T: std::convert::Into<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
1016    {
1017        self.allowed_principal_tags = v.map(|x| x.into());
1018        self
1019    }
1020}
1021
1022impl wkt::message::Message for AwsPrincipalTagsOptions {
1023    fn typename() -> &'static str {
1024        "type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions"
1025    }
1026}
1027
1028/// Defines additional types related to [AwsPrincipalTagsOptions].
1029pub mod aws_principal_tags_options {
1030    #[allow(unused_imports)]
1031    use super::*;
1032
1033    /// Allowed principal tags is used to define what principal tags will be
1034    /// placed in the token.
1035    #[derive(Clone, Default, PartialEq)]
1036    #[non_exhaustive]
1037    pub struct AllowedPrincipalTags {
1038
1039        /// Optional. Container image signatures allowed in the token.
1040        pub container_image_signatures: std::option::Option<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>,
1041
1042        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1043    }
1044
1045    impl AllowedPrincipalTags {
1046        pub fn new() -> Self {
1047            std::default::Default::default()
1048        }
1049
1050        /// Sets the value of [container_image_signatures][crate::model::aws_principal_tags_options::AllowedPrincipalTags::container_image_signatures].
1051        ///
1052        /// # Example
1053        /// ```ignore,no_run
1054        /// # use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1055        /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures;
1056        /// let x = AllowedPrincipalTags::new().set_container_image_signatures(ContainerImageSignatures::default()/* use setters */);
1057        /// ```
1058        pub fn set_container_image_signatures<T>(mut self, v: T) -> Self
1059        where T: std::convert::Into<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>
1060        {
1061            self.container_image_signatures = std::option::Option::Some(v.into());
1062            self
1063        }
1064
1065        /// Sets or clears the value of [container_image_signatures][crate::model::aws_principal_tags_options::AllowedPrincipalTags::container_image_signatures].
1066        ///
1067        /// # Example
1068        /// ```ignore,no_run
1069        /// # use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1070        /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures;
1071        /// let x = AllowedPrincipalTags::new().set_or_clear_container_image_signatures(Some(ContainerImageSignatures::default()/* use setters */));
1072        /// let x = AllowedPrincipalTags::new().set_or_clear_container_image_signatures(None::<ContainerImageSignatures>);
1073        /// ```
1074        pub fn set_or_clear_container_image_signatures<T>(mut self, v: std::option::Option<T>) -> Self
1075        where T: std::convert::Into<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>
1076        {
1077            self.container_image_signatures = v.map(|x| x.into());
1078            self
1079        }
1080    }
1081
1082    impl wkt::message::Message for AllowedPrincipalTags {
1083        fn typename() -> &'static str {
1084            "type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions.AllowedPrincipalTags"
1085        }
1086    }
1087
1088    /// Defines additional types related to [AllowedPrincipalTags].
1089    pub mod allowed_principal_tags {
1090        #[allow(unused_imports)]
1091        use super::*;
1092
1093        /// Allowed Container Image Signatures. Key IDs are required to allow
1094        /// this claim to fit within the narrow AWS IAM restrictions.
1095        #[derive(Clone, Default, PartialEq)]
1096        #[non_exhaustive]
1097        pub struct ContainerImageSignatures {
1098            /// Optional. List of key ids to filter into the Principal tags. Only keys
1099            /// that have been validated and added to the token will be filtered into
1100            /// principal tags. Unrecognized key ids will be ignored.
1101            pub key_ids: std::vec::Vec<std::string::String>,
1102
1103            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1104        }
1105
1106        impl ContainerImageSignatures {
1107            pub fn new() -> Self {
1108                std::default::Default::default()
1109            }
1110
1111            /// Sets the value of [key_ids][crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures::key_ids].
1112            ///
1113            /// # Example
1114            /// ```ignore,no_run
1115            /// # use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures;
1116            /// let x = ContainerImageSignatures::new().set_key_ids(["a", "b", "c"]);
1117            /// ```
1118            pub fn set_key_ids<T, V>(mut self, v: T) -> Self
1119            where
1120                T: std::iter::IntoIterator<Item = V>,
1121                V: std::convert::Into<std::string::String>,
1122            {
1123                use std::iter::Iterator;
1124                self.key_ids = v.into_iter().map(|i| i.into()).collect();
1125                self
1126            }
1127        }
1128
1129        impl wkt::message::Message for ContainerImageSignatures {
1130            fn typename() -> &'static str {
1131                "type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions.AllowedPrincipalTags.ContainerImageSignatures"
1132            }
1133        }
1134    }
1135}
1136
1137/// TPM2 data containing everything necessary to validate any platform state
1138/// measured into the TPM.
1139#[derive(Clone, Default, PartialEq)]
1140#[non_exhaustive]
1141pub struct TpmAttestation {
1142    /// TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
1143    pub quotes: std::vec::Vec<crate::model::tpm_attestation::Quote>,
1144
1145    /// The binary TCG Event Log containing events measured into the TPM by the
1146    /// platform firmware and operating system. Formatted as described in the
1147    /// "TCG PC Client Platform Firmware Profile Specification".
1148    pub tcg_event_log: ::bytes::Bytes,
1149
1150    /// An Event Log containing additional events measured into the TPM that are
1151    /// not already present in the tcg_event_log. Formatted as described in the
1152    /// "Canonical Event Log Format" TCG Specification.
1153    pub canonical_event_log: ::bytes::Bytes,
1154
1155    /// DER-encoded X.509 certificate of the Attestation Key (otherwise known as
1156    /// an AK or a TPM restricted signing key) used to generate the quotes.
1157    pub ak_cert: ::bytes::Bytes,
1158
1159    /// List of DER-encoded X.509 certificates which, together with the ak_cert,
1160    /// chain back to a trusted Root Certificate.
1161    pub cert_chain: std::vec::Vec<::bytes::Bytes>,
1162
1163    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1164}
1165
1166impl TpmAttestation {
1167    pub fn new() -> Self {
1168        std::default::Default::default()
1169    }
1170
1171    /// Sets the value of [quotes][crate::model::TpmAttestation::quotes].
1172    ///
1173    /// # Example
1174    /// ```ignore,no_run
1175    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1176    /// use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
1177    /// let x = TpmAttestation::new()
1178    ///     .set_quotes([
1179    ///         Quote::default()/* use setters */,
1180    ///         Quote::default()/* use (different) setters */,
1181    ///     ]);
1182    /// ```
1183    pub fn set_quotes<T, V>(mut self, v: T) -> Self
1184    where
1185        T: std::iter::IntoIterator<Item = V>,
1186        V: std::convert::Into<crate::model::tpm_attestation::Quote>,
1187    {
1188        use std::iter::Iterator;
1189        self.quotes = v.into_iter().map(|i| i.into()).collect();
1190        self
1191    }
1192
1193    /// Sets the value of [tcg_event_log][crate::model::TpmAttestation::tcg_event_log].
1194    ///
1195    /// # Example
1196    /// ```ignore,no_run
1197    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1198    /// let x = TpmAttestation::new().set_tcg_event_log(bytes::Bytes::from_static(b"example"));
1199    /// ```
1200    pub fn set_tcg_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1201        self.tcg_event_log = v.into();
1202        self
1203    }
1204
1205    /// Sets the value of [canonical_event_log][crate::model::TpmAttestation::canonical_event_log].
1206    ///
1207    /// # Example
1208    /// ```ignore,no_run
1209    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1210    /// let x = TpmAttestation::new().set_canonical_event_log(bytes::Bytes::from_static(b"example"));
1211    /// ```
1212    pub fn set_canonical_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1213        self.canonical_event_log = v.into();
1214        self
1215    }
1216
1217    /// Sets the value of [ak_cert][crate::model::TpmAttestation::ak_cert].
1218    ///
1219    /// # Example
1220    /// ```ignore,no_run
1221    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1222    /// let x = TpmAttestation::new().set_ak_cert(bytes::Bytes::from_static(b"example"));
1223    /// ```
1224    pub fn set_ak_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1225        self.ak_cert = v.into();
1226        self
1227    }
1228
1229    /// Sets the value of [cert_chain][crate::model::TpmAttestation::cert_chain].
1230    ///
1231    /// # Example
1232    /// ```ignore,no_run
1233    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1234    /// let b1 = bytes::Bytes::from_static(b"abc");
1235    /// let b2 = bytes::Bytes::from_static(b"xyz");
1236    /// let x = TpmAttestation::new().set_cert_chain([b1, b2]);
1237    /// ```
1238    pub fn set_cert_chain<T, V>(mut self, v: T) -> Self
1239    where
1240        T: std::iter::IntoIterator<Item = V>,
1241        V: std::convert::Into<::bytes::Bytes>,
1242    {
1243        use std::iter::Iterator;
1244        self.cert_chain = v.into_iter().map(|i| i.into()).collect();
1245        self
1246    }
1247}
1248
1249impl wkt::message::Message for TpmAttestation {
1250    fn typename() -> &'static str {
1251        "type.googleapis.com/google.cloud.confidentialcomputing.v1.TpmAttestation"
1252    }
1253}
1254
1255/// Defines additional types related to [TpmAttestation].
1256pub mod tpm_attestation {
1257    #[allow(unused_imports)]
1258    use super::*;
1259
1260    /// Information about Platform Control Registers (PCRs) including a signature
1261    /// over their values, which can be used for remote validation.
1262    #[derive(Clone, Default, PartialEq)]
1263    #[non_exhaustive]
1264    pub struct Quote {
1265        /// The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
1266        pub hash_algo: i32,
1267
1268        /// Raw binary values of each PCRs being quoted.
1269        pub pcr_values: std::collections::HashMap<i32, ::bytes::Bytes>,
1270
1271        /// TPM2 quote, encoded as a TPMS_ATTEST
1272        pub raw_quote: ::bytes::Bytes,
1273
1274        /// TPM2 signature, encoded as a TPMT_SIGNATURE
1275        pub raw_signature: ::bytes::Bytes,
1276
1277        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1278    }
1279
1280    impl Quote {
1281        pub fn new() -> Self {
1282            std::default::Default::default()
1283        }
1284
1285        /// Sets the value of [hash_algo][crate::model::tpm_attestation::Quote::hash_algo].
1286        ///
1287        /// # Example
1288        /// ```ignore,no_run
1289        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
1290        /// let x = Quote::new().set_hash_algo(42);
1291        /// ```
1292        pub fn set_hash_algo<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1293            self.hash_algo = v.into();
1294            self
1295        }
1296
1297        /// Sets the value of [pcr_values][crate::model::tpm_attestation::Quote::pcr_values].
1298        ///
1299        /// # Example
1300        /// ```ignore,no_run
1301        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
1302        /// let x = Quote::new().set_pcr_values([
1303        ///     (0, bytes::Bytes::from_static(b"abc")),
1304        ///     (1, bytes::Bytes::from_static(b"xyz")),
1305        /// ]);
1306        /// ```
1307        pub fn set_pcr_values<T, K, V>(mut self, v: T) -> Self
1308        where
1309            T: std::iter::IntoIterator<Item = (K, V)>,
1310            K: std::convert::Into<i32>,
1311            V: std::convert::Into<::bytes::Bytes>,
1312        {
1313            use std::iter::Iterator;
1314            self.pcr_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1315            self
1316        }
1317
1318        /// Sets the value of [raw_quote][crate::model::tpm_attestation::Quote::raw_quote].
1319        ///
1320        /// # Example
1321        /// ```ignore,no_run
1322        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
1323        /// let x = Quote::new().set_raw_quote(bytes::Bytes::from_static(b"example"));
1324        /// ```
1325        pub fn set_raw_quote<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1326            self.raw_quote = v.into();
1327            self
1328        }
1329
1330        /// Sets the value of [raw_signature][crate::model::tpm_attestation::Quote::raw_signature].
1331        ///
1332        /// # Example
1333        /// ```ignore,no_run
1334        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
1335        /// let x = Quote::new().set_raw_signature(bytes::Bytes::from_static(b"example"));
1336        /// ```
1337        pub fn set_raw_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1338            self.raw_signature = v.into();
1339            self
1340        }
1341    }
1342
1343    impl wkt::message::Message for Quote {
1344        fn typename() -> &'static str {
1345            "type.googleapis.com/google.cloud.confidentialcomputing.v1.TpmAttestation.Quote"
1346        }
1347    }
1348}
1349
1350/// ConfidentialSpaceInfo contains information related to the Confidential Space
1351/// TEE.
1352#[derive(Clone, Default, PartialEq)]
1353#[non_exhaustive]
1354pub struct ConfidentialSpaceInfo {
1355    /// Optional. A list of signed entities containing container image signatures
1356    /// that can be used for server-side signature verification.
1357    pub signed_entities: std::vec::Vec<crate::model::SignedEntity>,
1358
1359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1360}
1361
1362impl ConfidentialSpaceInfo {
1363    pub fn new() -> Self {
1364        std::default::Default::default()
1365    }
1366
1367    /// Sets the value of [signed_entities][crate::model::ConfidentialSpaceInfo::signed_entities].
1368    ///
1369    /// # Example
1370    /// ```ignore,no_run
1371    /// # use google_cloud_confidentialcomputing_v1::model::ConfidentialSpaceInfo;
1372    /// use google_cloud_confidentialcomputing_v1::model::SignedEntity;
1373    /// let x = ConfidentialSpaceInfo::new()
1374    ///     .set_signed_entities([
1375    ///         SignedEntity::default()/* use setters */,
1376    ///         SignedEntity::default()/* use (different) setters */,
1377    ///     ]);
1378    /// ```
1379    pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
1380    where
1381        T: std::iter::IntoIterator<Item = V>,
1382        V: std::convert::Into<crate::model::SignedEntity>,
1383    {
1384        use std::iter::Iterator;
1385        self.signed_entities = v.into_iter().map(|i| i.into()).collect();
1386        self
1387    }
1388}
1389
1390impl wkt::message::Message for ConfidentialSpaceInfo {
1391    fn typename() -> &'static str {
1392        "type.googleapis.com/google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo"
1393    }
1394}
1395
1396/// SignedEntity represents an OCI image object containing everything necessary
1397/// to verify container image signatures.
1398#[derive(Clone, Default, PartialEq)]
1399#[non_exhaustive]
1400pub struct SignedEntity {
1401    /// Optional. A list of container image signatures attached to an OCI image
1402    /// object.
1403    pub container_image_signatures: std::vec::Vec<crate::model::ContainerImageSignature>,
1404
1405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1406}
1407
1408impl SignedEntity {
1409    pub fn new() -> Self {
1410        std::default::Default::default()
1411    }
1412
1413    /// Sets the value of [container_image_signatures][crate::model::SignedEntity::container_image_signatures].
1414    ///
1415    /// # Example
1416    /// ```ignore,no_run
1417    /// # use google_cloud_confidentialcomputing_v1::model::SignedEntity;
1418    /// use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
1419    /// let x = SignedEntity::new()
1420    ///     .set_container_image_signatures([
1421    ///         ContainerImageSignature::default()/* use setters */,
1422    ///         ContainerImageSignature::default()/* use (different) setters */,
1423    ///     ]);
1424    /// ```
1425    pub fn set_container_image_signatures<T, V>(mut self, v: T) -> Self
1426    where
1427        T: std::iter::IntoIterator<Item = V>,
1428        V: std::convert::Into<crate::model::ContainerImageSignature>,
1429    {
1430        use std::iter::Iterator;
1431        self.container_image_signatures = v.into_iter().map(|i| i.into()).collect();
1432        self
1433    }
1434}
1435
1436impl wkt::message::Message for SignedEntity {
1437    fn typename() -> &'static str {
1438        "type.googleapis.com/google.cloud.confidentialcomputing.v1.SignedEntity"
1439    }
1440}
1441
1442/// ContainerImageSignature holds necessary metadata to verify a container image
1443/// signature.
1444#[derive(Clone, Default, PartialEq)]
1445#[non_exhaustive]
1446pub struct ContainerImageSignature {
1447    /// Optional. The binary signature payload following the SimpleSigning format
1448    /// <https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing>.
1449    /// This payload includes the container image digest.
1450    pub payload: ::bytes::Bytes,
1451
1452    /// Optional. A signature over the payload.
1453    /// The container image digest is incorporated into the signature as follows:
1454    ///
1455    /// 1. Generate a SimpleSigning format payload that includes the container
1456    ///    image digest.
1457    /// 1. Generate a signature over SHA256 digest of the payload.
1458    ///    The signature generation process can be represented as follows:
1459    ///    `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
1460    pub signature: ::bytes::Bytes,
1461
1462    /// Optional. Reserved for future use.
1463    pub public_key: ::bytes::Bytes,
1464
1465    /// Optional. Reserved for future use.
1466    pub sig_alg: crate::model::SigningAlgorithm,
1467
1468    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1469}
1470
1471impl ContainerImageSignature {
1472    pub fn new() -> Self {
1473        std::default::Default::default()
1474    }
1475
1476    /// Sets the value of [payload][crate::model::ContainerImageSignature::payload].
1477    ///
1478    /// # Example
1479    /// ```ignore,no_run
1480    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
1481    /// let x = ContainerImageSignature::new().set_payload(bytes::Bytes::from_static(b"example"));
1482    /// ```
1483    pub fn set_payload<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1484        self.payload = v.into();
1485        self
1486    }
1487
1488    /// Sets the value of [signature][crate::model::ContainerImageSignature::signature].
1489    ///
1490    /// # Example
1491    /// ```ignore,no_run
1492    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
1493    /// let x = ContainerImageSignature::new().set_signature(bytes::Bytes::from_static(b"example"));
1494    /// ```
1495    pub fn set_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1496        self.signature = v.into();
1497        self
1498    }
1499
1500    /// Sets the value of [public_key][crate::model::ContainerImageSignature::public_key].
1501    ///
1502    /// # Example
1503    /// ```ignore,no_run
1504    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
1505    /// let x = ContainerImageSignature::new().set_public_key(bytes::Bytes::from_static(b"example"));
1506    /// ```
1507    pub fn set_public_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1508        self.public_key = v.into();
1509        self
1510    }
1511
1512    /// Sets the value of [sig_alg][crate::model::ContainerImageSignature::sig_alg].
1513    ///
1514    /// # Example
1515    /// ```ignore,no_run
1516    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
1517    /// use google_cloud_confidentialcomputing_v1::model::SigningAlgorithm;
1518    /// let x0 = ContainerImageSignature::new().set_sig_alg(SigningAlgorithm::RsassaPssSha256);
1519    /// let x1 = ContainerImageSignature::new().set_sig_alg(SigningAlgorithm::RsassaPkcs1V15Sha256);
1520    /// let x2 = ContainerImageSignature::new().set_sig_alg(SigningAlgorithm::EcdsaP256Sha256);
1521    /// ```
1522    pub fn set_sig_alg<T: std::convert::Into<crate::model::SigningAlgorithm>>(
1523        mut self,
1524        v: T,
1525    ) -> Self {
1526        self.sig_alg = v.into();
1527        self
1528    }
1529}
1530
1531impl wkt::message::Message for ContainerImageSignature {
1532    fn typename() -> &'static str {
1533        "type.googleapis.com/google.cloud.confidentialcomputing.v1.ContainerImageSignature"
1534    }
1535}
1536
1537/// A request for an attestation token, providing all the necessary information
1538/// needed for this service to verify the platform state of the requestor.
1539#[derive(Clone, Default, PartialEq)]
1540#[non_exhaustive]
1541pub struct VerifyConfidentialSpaceRequest {
1542    /// Required. The name of the Challenge whose nonce was used to generate the
1543    /// attestation, in the format `projects/*/locations/*/challenges/*`. The
1544    /// provided Challenge will be consumed, and cannot be used again.
1545    pub challenge: std::string::String,
1546
1547    /// Optional. Credentials used to populate the "emails" claim in the
1548    /// claims_token. If not present, token will not contain the "emails" claim.
1549    pub gcp_credentials: std::option::Option<crate::model::GcpCredentials>,
1550
1551    /// Optional. A list of signed entities containing container image signatures
1552    /// that can be used for server-side signature verification.
1553    pub signed_entities: std::vec::Vec<crate::model::SignedEntity>,
1554
1555    /// Optional. Information about the associated Compute Engine instance.
1556    /// Required for td_ccel requests only - tpm_attestation requests will provide
1557    /// this information in the attestation.
1558    pub gce_shielded_identity: std::option::Option<crate::model::GceShieldedIdentity>,
1559
1560    /// Optional. A collection of fields that modify the token output.
1561    pub options: std::option::Option<
1562        crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
1563    >,
1564
1565    /// Required. A tee attestation report, used to populate hardware rooted
1566    /// claims.
1567    pub tee_attestation:
1568        std::option::Option<crate::model::verify_confidential_space_request::TeeAttestation>,
1569
1570    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1571}
1572
1573impl VerifyConfidentialSpaceRequest {
1574    pub fn new() -> Self {
1575        std::default::Default::default()
1576    }
1577
1578    /// Sets the value of [challenge][crate::model::VerifyConfidentialSpaceRequest::challenge].
1579    ///
1580    /// # Example
1581    /// ```ignore,no_run
1582    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1583    /// let x = VerifyConfidentialSpaceRequest::new().set_challenge("example");
1584    /// ```
1585    pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1586        self.challenge = v.into();
1587        self
1588    }
1589
1590    /// Sets the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
1591    ///
1592    /// # Example
1593    /// ```ignore,no_run
1594    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1595    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
1596    /// let x = VerifyConfidentialSpaceRequest::new().set_gcp_credentials(GcpCredentials::default()/* use setters */);
1597    /// ```
1598    pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
1599    where
1600        T: std::convert::Into<crate::model::GcpCredentials>,
1601    {
1602        self.gcp_credentials = std::option::Option::Some(v.into());
1603        self
1604    }
1605
1606    /// Sets or clears the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
1607    ///
1608    /// # Example
1609    /// ```ignore,no_run
1610    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1611    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
1612    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gcp_credentials(Some(GcpCredentials::default()/* use setters */));
1613    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gcp_credentials(None::<GcpCredentials>);
1614    /// ```
1615    pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
1616    where
1617        T: std::convert::Into<crate::model::GcpCredentials>,
1618    {
1619        self.gcp_credentials = v.map(|x| x.into());
1620        self
1621    }
1622
1623    /// Sets the value of [signed_entities][crate::model::VerifyConfidentialSpaceRequest::signed_entities].
1624    ///
1625    /// # Example
1626    /// ```ignore,no_run
1627    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1628    /// use google_cloud_confidentialcomputing_v1::model::SignedEntity;
1629    /// let x = VerifyConfidentialSpaceRequest::new()
1630    ///     .set_signed_entities([
1631    ///         SignedEntity::default()/* use setters */,
1632    ///         SignedEntity::default()/* use (different) setters */,
1633    ///     ]);
1634    /// ```
1635    pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
1636    where
1637        T: std::iter::IntoIterator<Item = V>,
1638        V: std::convert::Into<crate::model::SignedEntity>,
1639    {
1640        use std::iter::Iterator;
1641        self.signed_entities = v.into_iter().map(|i| i.into()).collect();
1642        self
1643    }
1644
1645    /// Sets the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
1646    ///
1647    /// # Example
1648    /// ```ignore,no_run
1649    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1650    /// use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
1651    /// let x = VerifyConfidentialSpaceRequest::new().set_gce_shielded_identity(GceShieldedIdentity::default()/* use setters */);
1652    /// ```
1653    pub fn set_gce_shielded_identity<T>(mut self, v: T) -> Self
1654    where
1655        T: std::convert::Into<crate::model::GceShieldedIdentity>,
1656    {
1657        self.gce_shielded_identity = std::option::Option::Some(v.into());
1658        self
1659    }
1660
1661    /// Sets or clears the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
1662    ///
1663    /// # Example
1664    /// ```ignore,no_run
1665    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1666    /// use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
1667    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gce_shielded_identity(Some(GceShieldedIdentity::default()/* use setters */));
1668    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gce_shielded_identity(None::<GceShieldedIdentity>);
1669    /// ```
1670    pub fn set_or_clear_gce_shielded_identity<T>(mut self, v: std::option::Option<T>) -> Self
1671    where
1672        T: std::convert::Into<crate::model::GceShieldedIdentity>,
1673    {
1674        self.gce_shielded_identity = v.map(|x| x.into());
1675        self
1676    }
1677
1678    /// Sets the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
1679    ///
1680    /// # Example
1681    /// ```ignore,no_run
1682    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1683    /// use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1684    /// let x = VerifyConfidentialSpaceRequest::new().set_options(ConfidentialSpaceOptions::default()/* use setters */);
1685    /// ```
1686    pub fn set_options<T>(mut self, v: T) -> Self
1687    where
1688        T: std::convert::Into<
1689                crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
1690            >,
1691    {
1692        self.options = std::option::Option::Some(v.into());
1693        self
1694    }
1695
1696    /// Sets or clears the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
1697    ///
1698    /// # Example
1699    /// ```ignore,no_run
1700    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1701    /// use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1702    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_options(Some(ConfidentialSpaceOptions::default()/* use setters */));
1703    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_options(None::<ConfidentialSpaceOptions>);
1704    /// ```
1705    pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1706    where
1707        T: std::convert::Into<
1708                crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
1709            >,
1710    {
1711        self.options = v.map(|x| x.into());
1712        self
1713    }
1714
1715    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation].
1716    ///
1717    /// Note that all the setters affecting `tee_attestation` are mutually
1718    /// exclusive.
1719    ///
1720    /// # Example
1721    /// ```ignore,no_run
1722    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1723    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
1724    /// let x = VerifyConfidentialSpaceRequest::new().set_tee_attestation(Some(
1725    ///     google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::TeeAttestation::TdCcel(TdxCcelAttestation::default().into())));
1726    /// ```
1727    pub fn set_tee_attestation<
1728        T: std::convert::Into<
1729                std::option::Option<
1730                    crate::model::verify_confidential_space_request::TeeAttestation,
1731                >,
1732            >,
1733    >(
1734        mut self,
1735        v: T,
1736    ) -> Self {
1737        self.tee_attestation = v.into();
1738        self
1739    }
1740
1741    /// The value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
1742    /// if it holds a `TdCcel`, `None` if the field is not set or
1743    /// holds a different branch.
1744    pub fn td_ccel(
1745        &self,
1746    ) -> std::option::Option<&std::boxed::Box<crate::model::TdxCcelAttestation>> {
1747        #[allow(unreachable_patterns)]
1748        self.tee_attestation.as_ref().and_then(|v| match v {
1749            crate::model::verify_confidential_space_request::TeeAttestation::TdCcel(v) => {
1750                std::option::Option::Some(v)
1751            }
1752            _ => std::option::Option::None,
1753        })
1754    }
1755
1756    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
1757    /// to hold a `TdCcel`.
1758    ///
1759    /// Note that all the setters affecting `tee_attestation` are
1760    /// mutually exclusive.
1761    ///
1762    /// # Example
1763    /// ```ignore,no_run
1764    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1765    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
1766    /// let x = VerifyConfidentialSpaceRequest::new().set_td_ccel(TdxCcelAttestation::default()/* use setters */);
1767    /// assert!(x.td_ccel().is_some());
1768    /// assert!(x.tpm_attestation().is_none());
1769    /// ```
1770    pub fn set_td_ccel<T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>>(
1771        mut self,
1772        v: T,
1773    ) -> Self {
1774        self.tee_attestation = std::option::Option::Some(
1775            crate::model::verify_confidential_space_request::TeeAttestation::TdCcel(v.into()),
1776        );
1777        self
1778    }
1779
1780    /// The value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
1781    /// if it holds a `TpmAttestation`, `None` if the field is not set or
1782    /// holds a different branch.
1783    pub fn tpm_attestation(
1784        &self,
1785    ) -> std::option::Option<&std::boxed::Box<crate::model::TpmAttestation>> {
1786        #[allow(unreachable_patterns)]
1787        self.tee_attestation.as_ref().and_then(|v| match v {
1788            crate::model::verify_confidential_space_request::TeeAttestation::TpmAttestation(v) => {
1789                std::option::Option::Some(v)
1790            }
1791            _ => std::option::Option::None,
1792        })
1793    }
1794
1795    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
1796    /// to hold a `TpmAttestation`.
1797    ///
1798    /// Note that all the setters affecting `tee_attestation` are
1799    /// mutually exclusive.
1800    ///
1801    /// # Example
1802    /// ```ignore,no_run
1803    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
1804    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1805    /// let x = VerifyConfidentialSpaceRequest::new().set_tpm_attestation(TpmAttestation::default()/* use setters */);
1806    /// assert!(x.tpm_attestation().is_some());
1807    /// assert!(x.td_ccel().is_none());
1808    /// ```
1809    pub fn set_tpm_attestation<
1810        T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
1811    >(
1812        mut self,
1813        v: T,
1814    ) -> Self {
1815        self.tee_attestation = std::option::Option::Some(
1816            crate::model::verify_confidential_space_request::TeeAttestation::TpmAttestation(
1817                v.into(),
1818            ),
1819        );
1820        self
1821    }
1822}
1823
1824impl wkt::message::Message for VerifyConfidentialSpaceRequest {
1825    fn typename() -> &'static str {
1826        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest"
1827    }
1828}
1829
1830/// Defines additional types related to [VerifyConfidentialSpaceRequest].
1831pub mod verify_confidential_space_request {
1832    #[allow(unused_imports)]
1833    use super::*;
1834
1835    /// Token options for Confidential Space attestation.
1836    #[derive(Clone, Default, PartialEq)]
1837    #[non_exhaustive]
1838    pub struct ConfidentialSpaceOptions {
1839
1840        /// Optional. Optional string to issue the token with a custom audience
1841        /// claim. Required if custom nonces are specified.
1842        pub audience: std::string::String,
1843
1844        /// Optional. Optional specification for token claims profile.
1845        pub token_profile: crate::model::TokenProfile,
1846
1847        /// Optional. Optional parameter to place one or more nonces in the eat_nonce
1848        /// claim in the output token. The minimum size for JSON-encoded EATs is 10
1849        /// bytes and the maximum size is 74 bytes.
1850        pub nonce: std::vec::Vec<std::string::String>,
1851
1852        /// Optional. Optional specification for how to sign the attestation token.
1853        /// Defaults to SIGNATURE_TYPE_OIDC if unspecified.
1854        pub signature_type: crate::model::SignatureType,
1855
1856        /// An optional additional configuration per token type.
1857        pub token_profile_options: std::option::Option<crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions>,
1858
1859        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1860    }
1861
1862    impl ConfidentialSpaceOptions {
1863        pub fn new() -> Self {
1864            std::default::Default::default()
1865        }
1866
1867        /// Sets the value of [audience][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::audience].
1868        ///
1869        /// # Example
1870        /// ```ignore,no_run
1871        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1872        /// let x = ConfidentialSpaceOptions::new().set_audience("example");
1873        /// ```
1874        pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875            self.audience = v.into();
1876            self
1877        }
1878
1879        /// Sets the value of [token_profile][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile].
1880        ///
1881        /// # Example
1882        /// ```ignore,no_run
1883        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1884        /// use google_cloud_confidentialcomputing_v1::model::TokenProfile;
1885        /// let x0 = ConfidentialSpaceOptions::new().set_token_profile(TokenProfile::DefaultEat);
1886        /// let x1 = ConfidentialSpaceOptions::new().set_token_profile(TokenProfile::Aws);
1887        /// ```
1888        pub fn set_token_profile<T: std::convert::Into<crate::model::TokenProfile>>(
1889            mut self,
1890            v: T,
1891        ) -> Self {
1892            self.token_profile = v.into();
1893            self
1894        }
1895
1896        /// Sets the value of [nonce][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::nonce].
1897        ///
1898        /// # Example
1899        /// ```ignore,no_run
1900        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1901        /// let x = ConfidentialSpaceOptions::new().set_nonce(["a", "b", "c"]);
1902        /// ```
1903        pub fn set_nonce<T, V>(mut self, v: T) -> Self
1904        where
1905            T: std::iter::IntoIterator<Item = V>,
1906            V: std::convert::Into<std::string::String>,
1907        {
1908            use std::iter::Iterator;
1909            self.nonce = v.into_iter().map(|i| i.into()).collect();
1910            self
1911        }
1912
1913        /// Sets the value of [signature_type][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::signature_type].
1914        ///
1915        /// # Example
1916        /// ```ignore,no_run
1917        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1918        /// use google_cloud_confidentialcomputing_v1::model::SignatureType;
1919        /// let x0 = ConfidentialSpaceOptions::new().set_signature_type(SignatureType::Oidc);
1920        /// let x1 = ConfidentialSpaceOptions::new().set_signature_type(SignatureType::Pki);
1921        /// ```
1922        pub fn set_signature_type<T: std::convert::Into<crate::model::SignatureType>>(
1923            mut self,
1924            v: T,
1925        ) -> Self {
1926            self.signature_type = v.into();
1927            self
1928        }
1929
1930        /// Sets the value of [token_profile_options][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile_options].
1931        ///
1932        /// Note that all the setters affecting `token_profile_options` are mutually
1933        /// exclusive.
1934        ///
1935        /// # Example
1936        /// ```ignore,no_run
1937        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1938        /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1939        /// let x = ConfidentialSpaceOptions::new().set_token_profile_options(Some(
1940        ///     google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(AwsPrincipalTagsOptions::default().into())));
1941        /// ```
1942        pub fn set_token_profile_options<T: std::convert::Into<std::option::Option<crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions>>>(mut self, v: T) -> Self
1943        {
1944            self.token_profile_options = v.into();
1945            self
1946        }
1947
1948        /// The value of [token_profile_options][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile_options]
1949        /// if it holds a `AwsPrincipalTagsOptions`, `None` if the field is not set or
1950        /// holds a different branch.
1951        pub fn aws_principal_tags_options(
1952            &self,
1953        ) -> std::option::Option<&std::boxed::Box<crate::model::AwsPrincipalTagsOptions>> {
1954            #[allow(unreachable_patterns)]
1955            self.token_profile_options.as_ref().and_then(|v| match v {
1956                crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(v) => std::option::Option::Some(v),
1957                _ => std::option::Option::None,
1958            })
1959        }
1960
1961        /// Sets the value of [token_profile_options][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile_options]
1962        /// to hold a `AwsPrincipalTagsOptions`.
1963        ///
1964        /// Note that all the setters affecting `token_profile_options` are
1965        /// mutually exclusive.
1966        ///
1967        /// # Example
1968        /// ```ignore,no_run
1969        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
1970        /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1971        /// let x = ConfidentialSpaceOptions::new().set_aws_principal_tags_options(AwsPrincipalTagsOptions::default()/* use setters */);
1972        /// assert!(x.aws_principal_tags_options().is_some());
1973        /// ```
1974        pub fn set_aws_principal_tags_options<
1975            T: std::convert::Into<std::boxed::Box<crate::model::AwsPrincipalTagsOptions>>,
1976        >(
1977            mut self,
1978            v: T,
1979        ) -> Self {
1980            self.token_profile_options = std::option::Option::Some(
1981                crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(
1982                    v.into()
1983                )
1984            );
1985            self
1986        }
1987    }
1988
1989    impl wkt::message::Message for ConfidentialSpaceOptions {
1990        fn typename() -> &'static str {
1991            "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest.ConfidentialSpaceOptions"
1992        }
1993    }
1994
1995    /// Defines additional types related to [ConfidentialSpaceOptions].
1996    pub mod confidential_space_options {
1997        #[allow(unused_imports)]
1998        use super::*;
1999
2000        /// An optional additional configuration per token type.
2001        #[derive(Clone, Debug, PartialEq)]
2002        #[non_exhaustive]
2003        pub enum TokenProfileOptions {
2004            /// Optional. Options for the AWS token type.
2005            AwsPrincipalTagsOptions(std::boxed::Box<crate::model::AwsPrincipalTagsOptions>),
2006        }
2007    }
2008
2009    /// Required. A tee attestation report, used to populate hardware rooted
2010    /// claims.
2011    #[derive(Clone, Debug, PartialEq)]
2012    #[non_exhaustive]
2013    pub enum TeeAttestation {
2014        /// Input only. A TDX with CCEL and RTMR Attestation Quote.
2015        TdCcel(std::boxed::Box<crate::model::TdxCcelAttestation>),
2016        /// Input only. The TPM-specific data provided by the attesting platform,
2017        /// used to populate any of the claims regarding platform state.
2018        TpmAttestation(std::boxed::Box<crate::model::TpmAttestation>),
2019    }
2020}
2021
2022/// GceShieldedIdentity contains information about a Compute Engine instance.
2023#[derive(Clone, Default, PartialEq)]
2024#[non_exhaustive]
2025pub struct GceShieldedIdentity {
2026    /// Optional. DER-encoded X.509 certificate of the Attestation Key (otherwise
2027    /// known as an AK or a TPM restricted signing key) used to generate the
2028    /// quotes.
2029    pub ak_cert: ::bytes::Bytes,
2030
2031    /// Optional. List of DER-encoded X.509 certificates which, together with the
2032    /// ak_cert, chain back to a trusted Root Certificate.
2033    pub ak_cert_chain: std::vec::Vec<::bytes::Bytes>,
2034
2035    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2036}
2037
2038impl GceShieldedIdentity {
2039    pub fn new() -> Self {
2040        std::default::Default::default()
2041    }
2042
2043    /// Sets the value of [ak_cert][crate::model::GceShieldedIdentity::ak_cert].
2044    ///
2045    /// # Example
2046    /// ```ignore,no_run
2047    /// # use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
2048    /// let x = GceShieldedIdentity::new().set_ak_cert(bytes::Bytes::from_static(b"example"));
2049    /// ```
2050    pub fn set_ak_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2051        self.ak_cert = v.into();
2052        self
2053    }
2054
2055    /// Sets the value of [ak_cert_chain][crate::model::GceShieldedIdentity::ak_cert_chain].
2056    ///
2057    /// # Example
2058    /// ```ignore,no_run
2059    /// # use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
2060    /// let b1 = bytes::Bytes::from_static(b"abc");
2061    /// let b2 = bytes::Bytes::from_static(b"xyz");
2062    /// let x = GceShieldedIdentity::new().set_ak_cert_chain([b1, b2]);
2063    /// ```
2064    pub fn set_ak_cert_chain<T, V>(mut self, v: T) -> Self
2065    where
2066        T: std::iter::IntoIterator<Item = V>,
2067        V: std::convert::Into<::bytes::Bytes>,
2068    {
2069        use std::iter::Iterator;
2070        self.ak_cert_chain = v.into_iter().map(|i| i.into()).collect();
2071        self
2072    }
2073}
2074
2075impl wkt::message::Message for GceShieldedIdentity {
2076    fn typename() -> &'static str {
2077        "type.googleapis.com/google.cloud.confidentialcomputing.v1.GceShieldedIdentity"
2078    }
2079}
2080
2081/// VerifyConfidentialSpaceResponse is returned once a Confidential Space
2082/// attestation has been successfully verified, containing a signed token.
2083#[derive(Clone, Default, PartialEq)]
2084#[non_exhaustive]
2085pub struct VerifyConfidentialSpaceResponse {
2086    /// Output only. The attestation token issued by this service. It contains
2087    /// specific platform claims based on the contents of the provided attestation.
2088    pub attestation_token: std::string::String,
2089
2090    /// Output only. A list of messages that carry the partial error details
2091    /// related to VerifyConfidentialSpace. This field is populated by errors
2092    /// during container image signature verification, which may reflect problems
2093    /// in the provided image signatures. This does not block the issuing of an
2094    /// attestation token, but the token will not contain claims for the failed
2095    /// image signatures.
2096    pub partial_errors: std::vec::Vec<rpc::model::Status>,
2097
2098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2099}
2100
2101impl VerifyConfidentialSpaceResponse {
2102    pub fn new() -> Self {
2103        std::default::Default::default()
2104    }
2105
2106    /// Sets the value of [attestation_token][crate::model::VerifyConfidentialSpaceResponse::attestation_token].
2107    ///
2108    /// # Example
2109    /// ```ignore,no_run
2110    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceResponse;
2111    /// let x = VerifyConfidentialSpaceResponse::new().set_attestation_token("example");
2112    /// ```
2113    pub fn set_attestation_token<T: std::convert::Into<std::string::String>>(
2114        mut self,
2115        v: T,
2116    ) -> Self {
2117        self.attestation_token = v.into();
2118        self
2119    }
2120
2121    /// Sets the value of [partial_errors][crate::model::VerifyConfidentialSpaceResponse::partial_errors].
2122    ///
2123    /// # Example
2124    /// ```ignore,no_run
2125    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceResponse;
2126    /// use rpc::model::Status;
2127    /// let x = VerifyConfidentialSpaceResponse::new()
2128    ///     .set_partial_errors([
2129    ///         Status::default()/* use setters */,
2130    ///         Status::default()/* use (different) setters */,
2131    ///     ]);
2132    /// ```
2133    pub fn set_partial_errors<T, V>(mut self, v: T) -> Self
2134    where
2135        T: std::iter::IntoIterator<Item = V>,
2136        V: std::convert::Into<rpc::model::Status>,
2137    {
2138        use std::iter::Iterator;
2139        self.partial_errors = v.into_iter().map(|i| i.into()).collect();
2140        self
2141    }
2142}
2143
2144impl wkt::message::Message for VerifyConfidentialSpaceResponse {
2145    fn typename() -> &'static str {
2146        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceResponse"
2147    }
2148}
2149
2150/// A request for an attestation token, providing all the necessary information
2151/// needed for this service to verify Confidential GKE platform state of the
2152/// requestor.
2153#[derive(Clone, Default, PartialEq)]
2154#[non_exhaustive]
2155pub struct VerifyConfidentialGkeRequest {
2156    /// Required. The name of the Challenge whose nonce was used to generate the
2157    /// attestation, in the format projects/*/locations/*/challenges/*. The
2158    /// provided Challenge will be consumed, and cannot be used again.
2159    pub challenge: std::string::String,
2160
2161    /// Required. A tee attestation report, used to populate hardware rooted
2162    /// claims.
2163    pub tee_attestation:
2164        std::option::Option<crate::model::verify_confidential_gke_request::TeeAttestation>,
2165
2166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2167}
2168
2169impl VerifyConfidentialGkeRequest {
2170    pub fn new() -> Self {
2171        std::default::Default::default()
2172    }
2173
2174    /// Sets the value of [challenge][crate::model::VerifyConfidentialGkeRequest::challenge].
2175    ///
2176    /// # Example
2177    /// ```ignore,no_run
2178    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
2179    /// let x = VerifyConfidentialGkeRequest::new().set_challenge("example");
2180    /// ```
2181    pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2182        self.challenge = v.into();
2183        self
2184    }
2185
2186    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation].
2187    ///
2188    /// Note that all the setters affecting `tee_attestation` are mutually
2189    /// exclusive.
2190    ///
2191    /// # Example
2192    /// ```ignore,no_run
2193    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
2194    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2195    /// let x = VerifyConfidentialGkeRequest::new().set_tee_attestation(Some(
2196    ///     google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(TpmAttestation::default().into())));
2197    /// ```
2198    pub fn set_tee_attestation<
2199        T: std::convert::Into<
2200                std::option::Option<crate::model::verify_confidential_gke_request::TeeAttestation>,
2201            >,
2202    >(
2203        mut self,
2204        v: T,
2205    ) -> Self {
2206        self.tee_attestation = v.into();
2207        self
2208    }
2209
2210    /// The value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
2211    /// if it holds a `TpmAttestation`, `None` if the field is not set or
2212    /// holds a different branch.
2213    pub fn tpm_attestation(
2214        &self,
2215    ) -> std::option::Option<&std::boxed::Box<crate::model::TpmAttestation>> {
2216        #[allow(unreachable_patterns)]
2217        self.tee_attestation.as_ref().and_then(|v| match v {
2218            crate::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(v) => {
2219                std::option::Option::Some(v)
2220            }
2221            _ => std::option::Option::None,
2222        })
2223    }
2224
2225    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
2226    /// to hold a `TpmAttestation`.
2227    ///
2228    /// Note that all the setters affecting `tee_attestation` are
2229    /// mutually exclusive.
2230    ///
2231    /// # Example
2232    /// ```ignore,no_run
2233    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
2234    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2235    /// let x = VerifyConfidentialGkeRequest::new().set_tpm_attestation(TpmAttestation::default()/* use setters */);
2236    /// assert!(x.tpm_attestation().is_some());
2237    /// ```
2238    pub fn set_tpm_attestation<
2239        T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
2240    >(
2241        mut self,
2242        v: T,
2243    ) -> Self {
2244        self.tee_attestation = std::option::Option::Some(
2245            crate::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(v.into()),
2246        );
2247        self
2248    }
2249}
2250
2251impl wkt::message::Message for VerifyConfidentialGkeRequest {
2252    fn typename() -> &'static str {
2253        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest"
2254    }
2255}
2256
2257/// Defines additional types related to [VerifyConfidentialGkeRequest].
2258pub mod verify_confidential_gke_request {
2259    #[allow(unused_imports)]
2260    use super::*;
2261
2262    /// Required. A tee attestation report, used to populate hardware rooted
2263    /// claims.
2264    #[derive(Clone, Debug, PartialEq)]
2265    #[non_exhaustive]
2266    pub enum TeeAttestation {
2267        /// The TPM-specific data provided by the attesting platform, used to
2268        /// populate any of the claims regarding platform state.
2269        TpmAttestation(std::boxed::Box<crate::model::TpmAttestation>),
2270    }
2271}
2272
2273/// VerifyConfidentialGkeResponse response is returened once a Confidential GKE
2274/// attestation has been successfully verified, containing a signed OIDC token.
2275#[derive(Clone, Default, PartialEq)]
2276#[non_exhaustive]
2277pub struct VerifyConfidentialGkeResponse {
2278    /// Output only. The attestation token issued by this service for Confidential
2279    /// GKE. It contains specific platform claims based on the contents of the
2280    /// provided attestation.
2281    pub attestation_token: std::string::String,
2282
2283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2284}
2285
2286impl VerifyConfidentialGkeResponse {
2287    pub fn new() -> Self {
2288        std::default::Default::default()
2289    }
2290
2291    /// Sets the value of [attestation_token][crate::model::VerifyConfidentialGkeResponse::attestation_token].
2292    ///
2293    /// # Example
2294    /// ```ignore,no_run
2295    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeResponse;
2296    /// let x = VerifyConfidentialGkeResponse::new().set_attestation_token("example");
2297    /// ```
2298    pub fn set_attestation_token<T: std::convert::Into<std::string::String>>(
2299        mut self,
2300        v: T,
2301    ) -> Self {
2302        self.attestation_token = v.into();
2303        self
2304    }
2305}
2306
2307impl wkt::message::Message for VerifyConfidentialGkeResponse {
2308    fn typename() -> &'static str {
2309        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeResponse"
2310    }
2311}
2312
2313/// SigningAlgorithm enumerates all the supported signing algorithms.
2314///
2315/// # Working with unknown values
2316///
2317/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2318/// additional enum variants at any time. Adding new variants is not considered
2319/// a breaking change. Applications should write their code in anticipation of:
2320///
2321/// - New values appearing in future releases of the client library, **and**
2322/// - New values received dynamically, without application changes.
2323///
2324/// Please consult the [Working with enums] section in the user guide for some
2325/// guidelines.
2326///
2327/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2328#[derive(Clone, Debug, PartialEq)]
2329#[non_exhaustive]
2330pub enum SigningAlgorithm {
2331    /// Unspecified signing algorithm.
2332    Unspecified,
2333    /// RSASSA-PSS with a SHA256 digest.
2334    RsassaPssSha256,
2335    /// RSASSA-PKCS1 v1.5 with a SHA256 digest.
2336    RsassaPkcs1V15Sha256,
2337    /// ECDSA on the P-256 Curve with a SHA256 digest.
2338    EcdsaP256Sha256,
2339    /// If set, the enum was initialized with an unknown value.
2340    ///
2341    /// Applications can examine the value using [SigningAlgorithm::value] or
2342    /// [SigningAlgorithm::name].
2343    UnknownValue(signing_algorithm::UnknownValue),
2344}
2345
2346#[doc(hidden)]
2347pub mod signing_algorithm {
2348    #[allow(unused_imports)]
2349    use super::*;
2350    #[derive(Clone, Debug, PartialEq)]
2351    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2352}
2353
2354impl SigningAlgorithm {
2355    /// Gets the enum value.
2356    ///
2357    /// Returns `None` if the enum contains an unknown value deserialized from
2358    /// the string representation of enums.
2359    pub fn value(&self) -> std::option::Option<i32> {
2360        match self {
2361            Self::Unspecified => std::option::Option::Some(0),
2362            Self::RsassaPssSha256 => std::option::Option::Some(1),
2363            Self::RsassaPkcs1V15Sha256 => std::option::Option::Some(2),
2364            Self::EcdsaP256Sha256 => std::option::Option::Some(3),
2365            Self::UnknownValue(u) => u.0.value(),
2366        }
2367    }
2368
2369    /// Gets the enum value as a string.
2370    ///
2371    /// Returns `None` if the enum contains an unknown value deserialized from
2372    /// the integer representation of enums.
2373    pub fn name(&self) -> std::option::Option<&str> {
2374        match self {
2375            Self::Unspecified => std::option::Option::Some("SIGNING_ALGORITHM_UNSPECIFIED"),
2376            Self::RsassaPssSha256 => std::option::Option::Some("RSASSA_PSS_SHA256"),
2377            Self::RsassaPkcs1V15Sha256 => std::option::Option::Some("RSASSA_PKCS1V15_SHA256"),
2378            Self::EcdsaP256Sha256 => std::option::Option::Some("ECDSA_P256_SHA256"),
2379            Self::UnknownValue(u) => u.0.name(),
2380        }
2381    }
2382}
2383
2384impl std::default::Default for SigningAlgorithm {
2385    fn default() -> Self {
2386        use std::convert::From;
2387        Self::from(0)
2388    }
2389}
2390
2391impl std::fmt::Display for SigningAlgorithm {
2392    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2393        wkt::internal::display_enum(f, self.name(), self.value())
2394    }
2395}
2396
2397impl std::convert::From<i32> for SigningAlgorithm {
2398    fn from(value: i32) -> Self {
2399        match value {
2400            0 => Self::Unspecified,
2401            1 => Self::RsassaPssSha256,
2402            2 => Self::RsassaPkcs1V15Sha256,
2403            3 => Self::EcdsaP256Sha256,
2404            _ => Self::UnknownValue(signing_algorithm::UnknownValue(
2405                wkt::internal::UnknownEnumValue::Integer(value),
2406            )),
2407        }
2408    }
2409}
2410
2411impl std::convert::From<&str> for SigningAlgorithm {
2412    fn from(value: &str) -> Self {
2413        use std::string::ToString;
2414        match value {
2415            "SIGNING_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
2416            "RSASSA_PSS_SHA256" => Self::RsassaPssSha256,
2417            "RSASSA_PKCS1V15_SHA256" => Self::RsassaPkcs1V15Sha256,
2418            "ECDSA_P256_SHA256" => Self::EcdsaP256Sha256,
2419            _ => Self::UnknownValue(signing_algorithm::UnknownValue(
2420                wkt::internal::UnknownEnumValue::String(value.to_string()),
2421            )),
2422        }
2423    }
2424}
2425
2426impl serde::ser::Serialize for SigningAlgorithm {
2427    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2428    where
2429        S: serde::Serializer,
2430    {
2431        match self {
2432            Self::Unspecified => serializer.serialize_i32(0),
2433            Self::RsassaPssSha256 => serializer.serialize_i32(1),
2434            Self::RsassaPkcs1V15Sha256 => serializer.serialize_i32(2),
2435            Self::EcdsaP256Sha256 => serializer.serialize_i32(3),
2436            Self::UnknownValue(u) => u.0.serialize(serializer),
2437        }
2438    }
2439}
2440
2441impl<'de> serde::de::Deserialize<'de> for SigningAlgorithm {
2442    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2443    where
2444        D: serde::Deserializer<'de>,
2445    {
2446        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SigningAlgorithm>::new(
2447            ".google.cloud.confidentialcomputing.v1.SigningAlgorithm",
2448        ))
2449    }
2450}
2451
2452/// Token type enum contains the different types of token responses Confidential
2453/// Space supports
2454///
2455/// # Working with unknown values
2456///
2457/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2458/// additional enum variants at any time. Adding new variants is not considered
2459/// a breaking change. Applications should write their code in anticipation of:
2460///
2461/// - New values appearing in future releases of the client library, **and**
2462/// - New values received dynamically, without application changes.
2463///
2464/// Please consult the [Working with enums] section in the user guide for some
2465/// guidelines.
2466///
2467/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2468#[derive(Clone, Debug, PartialEq)]
2469#[non_exhaustive]
2470pub enum TokenType {
2471    /// Unspecified token type
2472    Unspecified,
2473    /// OpenID Connect (OIDC) token type
2474    Oidc,
2475    /// Public Key Infrastructure (PKI) token type
2476    Pki,
2477    /// Limited claim token type for AWS integration
2478    LimitedAws,
2479    /// Principal-tag-based token for AWS integration
2480    AwsPrincipaltags,
2481    /// If set, the enum was initialized with an unknown value.
2482    ///
2483    /// Applications can examine the value using [TokenType::value] or
2484    /// [TokenType::name].
2485    UnknownValue(token_type::UnknownValue),
2486}
2487
2488#[doc(hidden)]
2489pub mod token_type {
2490    #[allow(unused_imports)]
2491    use super::*;
2492    #[derive(Clone, Debug, PartialEq)]
2493    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2494}
2495
2496impl TokenType {
2497    /// Gets the enum value.
2498    ///
2499    /// Returns `None` if the enum contains an unknown value deserialized from
2500    /// the string representation of enums.
2501    pub fn value(&self) -> std::option::Option<i32> {
2502        match self {
2503            Self::Unspecified => std::option::Option::Some(0),
2504            Self::Oidc => std::option::Option::Some(1),
2505            Self::Pki => std::option::Option::Some(2),
2506            Self::LimitedAws => std::option::Option::Some(3),
2507            Self::AwsPrincipaltags => std::option::Option::Some(4),
2508            Self::UnknownValue(u) => u.0.value(),
2509        }
2510    }
2511
2512    /// Gets the enum value as a string.
2513    ///
2514    /// Returns `None` if the enum contains an unknown value deserialized from
2515    /// the integer representation of enums.
2516    pub fn name(&self) -> std::option::Option<&str> {
2517        match self {
2518            Self::Unspecified => std::option::Option::Some("TOKEN_TYPE_UNSPECIFIED"),
2519            Self::Oidc => std::option::Option::Some("TOKEN_TYPE_OIDC"),
2520            Self::Pki => std::option::Option::Some("TOKEN_TYPE_PKI"),
2521            Self::LimitedAws => std::option::Option::Some("TOKEN_TYPE_LIMITED_AWS"),
2522            Self::AwsPrincipaltags => std::option::Option::Some("TOKEN_TYPE_AWS_PRINCIPALTAGS"),
2523            Self::UnknownValue(u) => u.0.name(),
2524        }
2525    }
2526}
2527
2528impl std::default::Default for TokenType {
2529    fn default() -> Self {
2530        use std::convert::From;
2531        Self::from(0)
2532    }
2533}
2534
2535impl std::fmt::Display for TokenType {
2536    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2537        wkt::internal::display_enum(f, self.name(), self.value())
2538    }
2539}
2540
2541impl std::convert::From<i32> for TokenType {
2542    fn from(value: i32) -> Self {
2543        match value {
2544            0 => Self::Unspecified,
2545            1 => Self::Oidc,
2546            2 => Self::Pki,
2547            3 => Self::LimitedAws,
2548            4 => Self::AwsPrincipaltags,
2549            _ => Self::UnknownValue(token_type::UnknownValue(
2550                wkt::internal::UnknownEnumValue::Integer(value),
2551            )),
2552        }
2553    }
2554}
2555
2556impl std::convert::From<&str> for TokenType {
2557    fn from(value: &str) -> Self {
2558        use std::string::ToString;
2559        match value {
2560            "TOKEN_TYPE_UNSPECIFIED" => Self::Unspecified,
2561            "TOKEN_TYPE_OIDC" => Self::Oidc,
2562            "TOKEN_TYPE_PKI" => Self::Pki,
2563            "TOKEN_TYPE_LIMITED_AWS" => Self::LimitedAws,
2564            "TOKEN_TYPE_AWS_PRINCIPALTAGS" => Self::AwsPrincipaltags,
2565            _ => Self::UnknownValue(token_type::UnknownValue(
2566                wkt::internal::UnknownEnumValue::String(value.to_string()),
2567            )),
2568        }
2569    }
2570}
2571
2572impl serde::ser::Serialize for TokenType {
2573    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2574    where
2575        S: serde::Serializer,
2576    {
2577        match self {
2578            Self::Unspecified => serializer.serialize_i32(0),
2579            Self::Oidc => serializer.serialize_i32(1),
2580            Self::Pki => serializer.serialize_i32(2),
2581            Self::LimitedAws => serializer.serialize_i32(3),
2582            Self::AwsPrincipaltags => serializer.serialize_i32(4),
2583            Self::UnknownValue(u) => u.0.serialize(serializer),
2584        }
2585    }
2586}
2587
2588impl<'de> serde::de::Deserialize<'de> for TokenType {
2589    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2590    where
2591        D: serde::Deserializer<'de>,
2592    {
2593        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenType>::new(
2594            ".google.cloud.confidentialcomputing.v1.TokenType",
2595        ))
2596    }
2597}
2598
2599/// SignatureType enumerates supported signature types for attestation tokens.
2600///
2601/// # Working with unknown values
2602///
2603/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2604/// additional enum variants at any time. Adding new variants is not considered
2605/// a breaking change. Applications should write their code in anticipation of:
2606///
2607/// - New values appearing in future releases of the client library, **and**
2608/// - New values received dynamically, without application changes.
2609///
2610/// Please consult the [Working with enums] section in the user guide for some
2611/// guidelines.
2612///
2613/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2614#[derive(Clone, Debug, PartialEq)]
2615#[non_exhaustive]
2616pub enum SignatureType {
2617    /// Unspecified signature type.
2618    Unspecified,
2619    /// Google OIDC signature.
2620    Oidc,
2621    /// Public Key Infrastructure (PKI) signature.
2622    Pki,
2623    /// If set, the enum was initialized with an unknown value.
2624    ///
2625    /// Applications can examine the value using [SignatureType::value] or
2626    /// [SignatureType::name].
2627    UnknownValue(signature_type::UnknownValue),
2628}
2629
2630#[doc(hidden)]
2631pub mod signature_type {
2632    #[allow(unused_imports)]
2633    use super::*;
2634    #[derive(Clone, Debug, PartialEq)]
2635    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2636}
2637
2638impl SignatureType {
2639    /// Gets the enum value.
2640    ///
2641    /// Returns `None` if the enum contains an unknown value deserialized from
2642    /// the string representation of enums.
2643    pub fn value(&self) -> std::option::Option<i32> {
2644        match self {
2645            Self::Unspecified => std::option::Option::Some(0),
2646            Self::Oidc => std::option::Option::Some(1),
2647            Self::Pki => std::option::Option::Some(2),
2648            Self::UnknownValue(u) => u.0.value(),
2649        }
2650    }
2651
2652    /// Gets the enum value as a string.
2653    ///
2654    /// Returns `None` if the enum contains an unknown value deserialized from
2655    /// the integer representation of enums.
2656    pub fn name(&self) -> std::option::Option<&str> {
2657        match self {
2658            Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
2659            Self::Oidc => std::option::Option::Some("SIGNATURE_TYPE_OIDC"),
2660            Self::Pki => std::option::Option::Some("SIGNATURE_TYPE_PKI"),
2661            Self::UnknownValue(u) => u.0.name(),
2662        }
2663    }
2664}
2665
2666impl std::default::Default for SignatureType {
2667    fn default() -> Self {
2668        use std::convert::From;
2669        Self::from(0)
2670    }
2671}
2672
2673impl std::fmt::Display for SignatureType {
2674    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2675        wkt::internal::display_enum(f, self.name(), self.value())
2676    }
2677}
2678
2679impl std::convert::From<i32> for SignatureType {
2680    fn from(value: i32) -> Self {
2681        match value {
2682            0 => Self::Unspecified,
2683            1 => Self::Oidc,
2684            2 => Self::Pki,
2685            _ => Self::UnknownValue(signature_type::UnknownValue(
2686                wkt::internal::UnknownEnumValue::Integer(value),
2687            )),
2688        }
2689    }
2690}
2691
2692impl std::convert::From<&str> for SignatureType {
2693    fn from(value: &str) -> Self {
2694        use std::string::ToString;
2695        match value {
2696            "SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
2697            "SIGNATURE_TYPE_OIDC" => Self::Oidc,
2698            "SIGNATURE_TYPE_PKI" => Self::Pki,
2699            _ => Self::UnknownValue(signature_type::UnknownValue(
2700                wkt::internal::UnknownEnumValue::String(value.to_string()),
2701            )),
2702        }
2703    }
2704}
2705
2706impl serde::ser::Serialize for SignatureType {
2707    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2708    where
2709        S: serde::Serializer,
2710    {
2711        match self {
2712            Self::Unspecified => serializer.serialize_i32(0),
2713            Self::Oidc => serializer.serialize_i32(1),
2714            Self::Pki => serializer.serialize_i32(2),
2715            Self::UnknownValue(u) => u.0.serialize(serializer),
2716        }
2717    }
2718}
2719
2720impl<'de> serde::de::Deserialize<'de> for SignatureType {
2721    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2722    where
2723        D: serde::Deserializer<'de>,
2724    {
2725        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
2726            ".google.cloud.confidentialcomputing.v1.SignatureType",
2727        ))
2728    }
2729}
2730
2731/// TokenProfile enumerates the supported token claims profiles.
2732///
2733/// # Working with unknown values
2734///
2735/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2736/// additional enum variants at any time. Adding new variants is not considered
2737/// a breaking change. Applications should write their code in anticipation of:
2738///
2739/// - New values appearing in future releases of the client library, **and**
2740/// - New values received dynamically, without application changes.
2741///
2742/// Please consult the [Working with enums] section in the user guide for some
2743/// guidelines.
2744///
2745/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2746#[derive(Clone, Debug, PartialEq)]
2747#[non_exhaustive]
2748pub enum TokenProfile {
2749    /// Unspecified token profile.
2750    Unspecified,
2751    /// EAT claims.
2752    DefaultEat,
2753    /// AWS Principal Tags claims.
2754    Aws,
2755    /// If set, the enum was initialized with an unknown value.
2756    ///
2757    /// Applications can examine the value using [TokenProfile::value] or
2758    /// [TokenProfile::name].
2759    UnknownValue(token_profile::UnknownValue),
2760}
2761
2762#[doc(hidden)]
2763pub mod token_profile {
2764    #[allow(unused_imports)]
2765    use super::*;
2766    #[derive(Clone, Debug, PartialEq)]
2767    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2768}
2769
2770impl TokenProfile {
2771    /// Gets the enum value.
2772    ///
2773    /// Returns `None` if the enum contains an unknown value deserialized from
2774    /// the string representation of enums.
2775    pub fn value(&self) -> std::option::Option<i32> {
2776        match self {
2777            Self::Unspecified => std::option::Option::Some(0),
2778            Self::DefaultEat => std::option::Option::Some(1),
2779            Self::Aws => std::option::Option::Some(2),
2780            Self::UnknownValue(u) => u.0.value(),
2781        }
2782    }
2783
2784    /// Gets the enum value as a string.
2785    ///
2786    /// Returns `None` if the enum contains an unknown value deserialized from
2787    /// the integer representation of enums.
2788    pub fn name(&self) -> std::option::Option<&str> {
2789        match self {
2790            Self::Unspecified => std::option::Option::Some("TOKEN_PROFILE_UNSPECIFIED"),
2791            Self::DefaultEat => std::option::Option::Some("TOKEN_PROFILE_DEFAULT_EAT"),
2792            Self::Aws => std::option::Option::Some("TOKEN_PROFILE_AWS"),
2793            Self::UnknownValue(u) => u.0.name(),
2794        }
2795    }
2796}
2797
2798impl std::default::Default for TokenProfile {
2799    fn default() -> Self {
2800        use std::convert::From;
2801        Self::from(0)
2802    }
2803}
2804
2805impl std::fmt::Display for TokenProfile {
2806    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2807        wkt::internal::display_enum(f, self.name(), self.value())
2808    }
2809}
2810
2811impl std::convert::From<i32> for TokenProfile {
2812    fn from(value: i32) -> Self {
2813        match value {
2814            0 => Self::Unspecified,
2815            1 => Self::DefaultEat,
2816            2 => Self::Aws,
2817            _ => Self::UnknownValue(token_profile::UnknownValue(
2818                wkt::internal::UnknownEnumValue::Integer(value),
2819            )),
2820        }
2821    }
2822}
2823
2824impl std::convert::From<&str> for TokenProfile {
2825    fn from(value: &str) -> Self {
2826        use std::string::ToString;
2827        match value {
2828            "TOKEN_PROFILE_UNSPECIFIED" => Self::Unspecified,
2829            "TOKEN_PROFILE_DEFAULT_EAT" => Self::DefaultEat,
2830            "TOKEN_PROFILE_AWS" => Self::Aws,
2831            _ => Self::UnknownValue(token_profile::UnknownValue(
2832                wkt::internal::UnknownEnumValue::String(value.to_string()),
2833            )),
2834        }
2835    }
2836}
2837
2838impl serde::ser::Serialize for TokenProfile {
2839    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2840    where
2841        S: serde::Serializer,
2842    {
2843        match self {
2844            Self::Unspecified => serializer.serialize_i32(0),
2845            Self::DefaultEat => serializer.serialize_i32(1),
2846            Self::Aws => serializer.serialize_i32(2),
2847            Self::UnknownValue(u) => u.0.serialize(serializer),
2848        }
2849    }
2850}
2851
2852impl<'de> serde::de::Deserialize<'de> for TokenProfile {
2853    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2854    where
2855        D: serde::Deserializer<'de>,
2856    {
2857        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenProfile>::new(
2858            ".google.cloud.confidentialcomputing.v1.TokenProfile",
2859        ))
2860    }
2861}