Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_rpc;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// A Challenge from the server used to guarantee freshness of attestations
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct Challenge {
41    /// Output only. The resource name for this Challenge in the format
42    /// `projects/*/locations/*/challenges/*`
43    pub name: std::string::String,
44
45    /// Output only. The time at which this Challenge was created
46    pub create_time: std::option::Option<wkt::Timestamp>,
47
48    /// Output only. The time at which this Challenge will no longer be usable. It
49    /// is also the expiration time for any tokens generated from this Challenge.
50    pub expire_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Indicates if this challenge has been used to generate a token.
53    pub used: bool,
54
55    /// Output only. Identical to nonce, but as a string.
56    pub tpm_nonce: std::string::String,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl Challenge {
62    /// Creates a new default instance.
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [name][crate::model::Challenge::name].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
72    /// # let project_id = "project_id";
73    /// # let location_id = "location_id";
74    /// # let uuid_id = "uuid_id";
75    /// let x = Challenge::new().set_name(format!("projects/{project_id}/locations/{location_id}/challenges/{uuid_id}"));
76    /// ```
77    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
78        self.name = v.into();
79        self
80    }
81
82    /// Sets the value of [create_time][crate::model::Challenge::create_time].
83    ///
84    /// # Example
85    /// ```ignore,no_run
86    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
87    /// use wkt::Timestamp;
88    /// let x = Challenge::new().set_create_time(Timestamp::default()/* use setters */);
89    /// ```
90    pub fn set_create_time<T>(mut self, v: T) -> Self
91    where
92        T: std::convert::Into<wkt::Timestamp>,
93    {
94        self.create_time = std::option::Option::Some(v.into());
95        self
96    }
97
98    /// Sets or clears the value of [create_time][crate::model::Challenge::create_time].
99    ///
100    /// # Example
101    /// ```ignore,no_run
102    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
103    /// use wkt::Timestamp;
104    /// let x = Challenge::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
105    /// let x = Challenge::new().set_or_clear_create_time(None::<Timestamp>);
106    /// ```
107    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
108    where
109        T: std::convert::Into<wkt::Timestamp>,
110    {
111        self.create_time = v.map(|x| x.into());
112        self
113    }
114
115    /// Sets the value of [expire_time][crate::model::Challenge::expire_time].
116    ///
117    /// # Example
118    /// ```ignore,no_run
119    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
120    /// use wkt::Timestamp;
121    /// let x = Challenge::new().set_expire_time(Timestamp::default()/* use setters */);
122    /// ```
123    pub fn set_expire_time<T>(mut self, v: T) -> Self
124    where
125        T: std::convert::Into<wkt::Timestamp>,
126    {
127        self.expire_time = std::option::Option::Some(v.into());
128        self
129    }
130
131    /// Sets or clears the value of [expire_time][crate::model::Challenge::expire_time].
132    ///
133    /// # Example
134    /// ```ignore,no_run
135    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
136    /// use wkt::Timestamp;
137    /// let x = Challenge::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
138    /// let x = Challenge::new().set_or_clear_expire_time(None::<Timestamp>);
139    /// ```
140    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
141    where
142        T: std::convert::Into<wkt::Timestamp>,
143    {
144        self.expire_time = v.map(|x| x.into());
145        self
146    }
147
148    /// Sets the value of [used][crate::model::Challenge::used].
149    ///
150    /// # Example
151    /// ```ignore,no_run
152    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
153    /// let x = Challenge::new().set_used(true);
154    /// ```
155    pub fn set_used<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
156        self.used = v.into();
157        self
158    }
159
160    /// Sets the value of [tpm_nonce][crate::model::Challenge::tpm_nonce].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_confidentialcomputing_v1::model::Challenge;
165    /// let x = Challenge::new().set_tpm_nonce("example");
166    /// ```
167    pub fn set_tpm_nonce<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
168        self.tpm_nonce = v.into();
169        self
170    }
171}
172
173impl wkt::message::Message for Challenge {
174    fn typename() -> &'static str {
175        "type.googleapis.com/google.cloud.confidentialcomputing.v1.Challenge"
176    }
177}
178
179/// Message for creating a Challenge
180#[derive(Clone, Default, PartialEq)]
181#[non_exhaustive]
182pub struct CreateChallengeRequest {
183    /// Required. The resource name of the location where the Challenge will be
184    /// used, in the format `projects/*/locations/*`.
185    pub parent: std::string::String,
186
187    /// Required. The Challenge to be created. Currently this field can be empty as
188    /// all the Challenge fields are set by the server.
189    pub challenge: std::option::Option<crate::model::Challenge>,
190
191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
192}
193
194impl CreateChallengeRequest {
195    /// Creates a new default instance.
196    pub fn new() -> Self {
197        std::default::Default::default()
198    }
199
200    /// Sets the value of [parent][crate::model::CreateChallengeRequest::parent].
201    ///
202    /// # Example
203    /// ```ignore,no_run
204    /// # use google_cloud_confidentialcomputing_v1::model::CreateChallengeRequest;
205    /// let x = CreateChallengeRequest::new().set_parent("example");
206    /// ```
207    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
208        self.parent = v.into();
209        self
210    }
211
212    /// Sets the value of [challenge][crate::model::CreateChallengeRequest::challenge].
213    ///
214    /// # Example
215    /// ```ignore,no_run
216    /// # use google_cloud_confidentialcomputing_v1::model::CreateChallengeRequest;
217    /// use google_cloud_confidentialcomputing_v1::model::Challenge;
218    /// let x = CreateChallengeRequest::new().set_challenge(Challenge::default()/* use setters */);
219    /// ```
220    pub fn set_challenge<T>(mut self, v: T) -> Self
221    where
222        T: std::convert::Into<crate::model::Challenge>,
223    {
224        self.challenge = std::option::Option::Some(v.into());
225        self
226    }
227
228    /// Sets or clears the value of [challenge][crate::model::CreateChallengeRequest::challenge].
229    ///
230    /// # Example
231    /// ```ignore,no_run
232    /// # use google_cloud_confidentialcomputing_v1::model::CreateChallengeRequest;
233    /// use google_cloud_confidentialcomputing_v1::model::Challenge;
234    /// let x = CreateChallengeRequest::new().set_or_clear_challenge(Some(Challenge::default()/* use setters */));
235    /// let x = CreateChallengeRequest::new().set_or_clear_challenge(None::<Challenge>);
236    /// ```
237    pub fn set_or_clear_challenge<T>(mut self, v: std::option::Option<T>) -> Self
238    where
239        T: std::convert::Into<crate::model::Challenge>,
240    {
241        self.challenge = v.map(|x| x.into());
242        self
243    }
244}
245
246impl wkt::message::Message for CreateChallengeRequest {
247    fn typename() -> &'static str {
248        "type.googleapis.com/google.cloud.confidentialcomputing.v1.CreateChallengeRequest"
249    }
250}
251
252/// A request for an attestation token, providing all the necessary information
253/// needed for this service to verify the platform state of the requestor.
254#[derive(Clone, Default, PartialEq)]
255#[non_exhaustive]
256pub struct VerifyAttestationRequest {
257    /// Required. The name of the Challenge whose nonce was used to generate the
258    /// attestation, in the format `projects/*/locations/*/challenges/*`. The
259    /// provided Challenge will be consumed, and cannot be used again.
260    pub challenge: std::string::String,
261
262    /// Optional. Credentials used to populate the "emails" claim in the
263    /// claims_token.
264    pub gcp_credentials: std::option::Option<crate::model::GcpCredentials>,
265
266    /// Required. The TPM-specific data provided by the attesting platform, used to
267    /// populate any of the claims regarding platform state.
268    pub tpm_attestation: std::option::Option<crate::model::TpmAttestation>,
269
270    /// Optional. Optional information related to the Confidential Space TEE.
271    pub confidential_space_info: std::option::Option<crate::model::ConfidentialSpaceInfo>,
272
273    /// Optional. A collection of optional, workload-specified claims that modify
274    /// the token output.
275    pub token_options: std::option::Option<crate::model::TokenOptions>,
276
277    /// Optional. An optional indicator of the attester, only applies to certain
278    /// products.
279    pub attester: std::string::String,
280
281    /// Optional. Optional resource link of the Compute Engine instance.
282    /// Format:
283    /// `projects/{project_number}/zones/{zone}/instances/{instance_id}`
284    pub instance: std::string::String,
285
286    /// An optional tee attestation report, used to populate hardware rooted
287    /// claims.
288    pub tee_attestation:
289        std::option::Option<crate::model::verify_attestation_request::TeeAttestation>,
290
291    /// An optional device attestation report.
292    pub device_attestation:
293        std::option::Option<crate::model::verify_attestation_request::DeviceAttestation>,
294
295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
296}
297
298impl VerifyAttestationRequest {
299    /// Creates a new default instance.
300    pub fn new() -> Self {
301        std::default::Default::default()
302    }
303
304    /// Sets the value of [challenge][crate::model::VerifyAttestationRequest::challenge].
305    ///
306    /// # Example
307    /// ```ignore,no_run
308    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
309    /// # let project_id = "project_id";
310    /// # let location_id = "location_id";
311    /// # let uuid_id = "uuid_id";
312    /// let x = VerifyAttestationRequest::new().set_challenge(format!("projects/{project_id}/locations/{location_id}/challenges/{uuid_id}"));
313    /// ```
314    pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
315        self.challenge = v.into();
316        self
317    }
318
319    /// Sets 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_gcp_credentials(GcpCredentials::default()/* use setters */);
326    /// ```
327    pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
328    where
329        T: std::convert::Into<crate::model::GcpCredentials>,
330    {
331        self.gcp_credentials = std::option::Option::Some(v.into());
332        self
333    }
334
335    /// Sets or clears the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
336    ///
337    /// # Example
338    /// ```ignore,no_run
339    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
340    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
341    /// let x = VerifyAttestationRequest::new().set_or_clear_gcp_credentials(Some(GcpCredentials::default()/* use setters */));
342    /// let x = VerifyAttestationRequest::new().set_or_clear_gcp_credentials(None::<GcpCredentials>);
343    /// ```
344    pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
345    where
346        T: std::convert::Into<crate::model::GcpCredentials>,
347    {
348        self.gcp_credentials = v.map(|x| x.into());
349        self
350    }
351
352    /// Sets 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_tpm_attestation(TpmAttestation::default()/* use setters */);
359    /// ```
360    pub fn set_tpm_attestation<T>(mut self, v: T) -> Self
361    where
362        T: std::convert::Into<crate::model::TpmAttestation>,
363    {
364        self.tpm_attestation = std::option::Option::Some(v.into());
365        self
366    }
367
368    /// Sets or clears the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
369    ///
370    /// # Example
371    /// ```ignore,no_run
372    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
373    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
374    /// let x = VerifyAttestationRequest::new().set_or_clear_tpm_attestation(Some(TpmAttestation::default()/* use setters */));
375    /// let x = VerifyAttestationRequest::new().set_or_clear_tpm_attestation(None::<TpmAttestation>);
376    /// ```
377    pub fn set_or_clear_tpm_attestation<T>(mut self, v: std::option::Option<T>) -> Self
378    where
379        T: std::convert::Into<crate::model::TpmAttestation>,
380    {
381        self.tpm_attestation = v.map(|x| x.into());
382        self
383    }
384
385    /// Sets 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_confidential_space_info(ConfidentialSpaceInfo::default()/* use setters */);
392    /// ```
393    pub fn set_confidential_space_info<T>(mut self, v: T) -> Self
394    where
395        T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
396    {
397        self.confidential_space_info = std::option::Option::Some(v.into());
398        self
399    }
400
401    /// Sets or clears the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
402    ///
403    /// # Example
404    /// ```ignore,no_run
405    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
406    /// use google_cloud_confidentialcomputing_v1::model::ConfidentialSpaceInfo;
407    /// let x = VerifyAttestationRequest::new().set_or_clear_confidential_space_info(Some(ConfidentialSpaceInfo::default()/* use setters */));
408    /// let x = VerifyAttestationRequest::new().set_or_clear_confidential_space_info(None::<ConfidentialSpaceInfo>);
409    /// ```
410    pub fn set_or_clear_confidential_space_info<T>(mut self, v: std::option::Option<T>) -> Self
411    where
412        T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
413    {
414        self.confidential_space_info = v.map(|x| x.into());
415        self
416    }
417
418    /// Sets 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_token_options(TokenOptions::default()/* use setters */);
425    /// ```
426    pub fn set_token_options<T>(mut self, v: T) -> Self
427    where
428        T: std::convert::Into<crate::model::TokenOptions>,
429    {
430        self.token_options = std::option::Option::Some(v.into());
431        self
432    }
433
434    /// Sets or clears the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
435    ///
436    /// # Example
437    /// ```ignore,no_run
438    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
439    /// use google_cloud_confidentialcomputing_v1::model::TokenOptions;
440    /// let x = VerifyAttestationRequest::new().set_or_clear_token_options(Some(TokenOptions::default()/* use setters */));
441    /// let x = VerifyAttestationRequest::new().set_or_clear_token_options(None::<TokenOptions>);
442    /// ```
443    pub fn set_or_clear_token_options<T>(mut self, v: std::option::Option<T>) -> Self
444    where
445        T: std::convert::Into<crate::model::TokenOptions>,
446    {
447        self.token_options = v.map(|x| x.into());
448        self
449    }
450
451    /// Sets the value of [attester][crate::model::VerifyAttestationRequest::attester].
452    ///
453    /// # Example
454    /// ```ignore,no_run
455    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
456    /// let x = VerifyAttestationRequest::new().set_attester("example");
457    /// ```
458    pub fn set_attester<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
459        self.attester = v.into();
460        self
461    }
462
463    /// Sets the value of [instance][crate::model::VerifyAttestationRequest::instance].
464    ///
465    /// # Example
466    /// ```ignore,no_run
467    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
468    /// let x = VerifyAttestationRequest::new().set_instance("example");
469    /// ```
470    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
471        self.instance = v.into();
472        self
473    }
474
475    /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation].
476    ///
477    /// Note that all the setters affecting `tee_attestation` are mutually
478    /// exclusive.
479    ///
480    /// # Example
481    /// ```ignore,no_run
482    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
483    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
484    /// let x = VerifyAttestationRequest::new().set_tee_attestation(Some(
485    ///     google_cloud_confidentialcomputing_v1::model::verify_attestation_request::TeeAttestation::TdCcel(TdxCcelAttestation::default().into())));
486    /// ```
487    pub fn set_tee_attestation<
488        T: std::convert::Into<
489                std::option::Option<crate::model::verify_attestation_request::TeeAttestation>,
490            >,
491    >(
492        mut self,
493        v: T,
494    ) -> Self {
495        self.tee_attestation = v.into();
496        self
497    }
498
499    /// The value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
500    /// if it holds a `TdCcel`, `None` if the field is not set or
501    /// holds a different branch.
502    pub fn td_ccel(
503        &self,
504    ) -> std::option::Option<&std::boxed::Box<crate::model::TdxCcelAttestation>> {
505        #[allow(unreachable_patterns)]
506        self.tee_attestation.as_ref().and_then(|v| match v {
507            crate::model::verify_attestation_request::TeeAttestation::TdCcel(v) => {
508                std::option::Option::Some(v)
509            }
510            _ => std::option::Option::None,
511        })
512    }
513
514    /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
515    /// to hold a `TdCcel`.
516    ///
517    /// Note that all the setters affecting `tee_attestation` are
518    /// mutually exclusive.
519    ///
520    /// # Example
521    /// ```ignore,no_run
522    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
523    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
524    /// let x = VerifyAttestationRequest::new().set_td_ccel(TdxCcelAttestation::default()/* use setters */);
525    /// assert!(x.td_ccel().is_some());
526    /// assert!(x.sev_snp_attestation().is_none());
527    /// ```
528    pub fn set_td_ccel<T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>>(
529        mut self,
530        v: T,
531    ) -> Self {
532        self.tee_attestation = std::option::Option::Some(
533            crate::model::verify_attestation_request::TeeAttestation::TdCcel(v.into()),
534        );
535        self
536    }
537
538    /// The value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
539    /// if it holds a `SevSnpAttestation`, `None` if the field is not set or
540    /// holds a different branch.
541    pub fn sev_snp_attestation(
542        &self,
543    ) -> std::option::Option<&std::boxed::Box<crate::model::SevSnpAttestation>> {
544        #[allow(unreachable_patterns)]
545        self.tee_attestation.as_ref().and_then(|v| match v {
546            crate::model::verify_attestation_request::TeeAttestation::SevSnpAttestation(v) => {
547                std::option::Option::Some(v)
548            }
549            _ => std::option::Option::None,
550        })
551    }
552
553    /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
554    /// to hold a `SevSnpAttestation`.
555    ///
556    /// Note that all the setters affecting `tee_attestation` are
557    /// mutually exclusive.
558    ///
559    /// # Example
560    /// ```ignore,no_run
561    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
562    /// use google_cloud_confidentialcomputing_v1::model::SevSnpAttestation;
563    /// let x = VerifyAttestationRequest::new().set_sev_snp_attestation(SevSnpAttestation::default()/* use setters */);
564    /// assert!(x.sev_snp_attestation().is_some());
565    /// assert!(x.td_ccel().is_none());
566    /// ```
567    pub fn set_sev_snp_attestation<
568        T: std::convert::Into<std::boxed::Box<crate::model::SevSnpAttestation>>,
569    >(
570        mut self,
571        v: T,
572    ) -> Self {
573        self.tee_attestation = std::option::Option::Some(
574            crate::model::verify_attestation_request::TeeAttestation::SevSnpAttestation(v.into()),
575        );
576        self
577    }
578
579    /// Sets the value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation].
580    ///
581    /// Note that all the setters affecting `device_attestation` are mutually
582    /// exclusive.
583    ///
584    /// # Example
585    /// ```ignore,no_run
586    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
587    /// use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
588    /// let x = VerifyAttestationRequest::new().set_device_attestation(Some(
589    ///     google_cloud_confidentialcomputing_v1::model::verify_attestation_request::DeviceAttestation::NvidiaAttestation(NvidiaAttestation::default().into())));
590    /// ```
591    pub fn set_device_attestation<
592        T: std::convert::Into<
593                std::option::Option<crate::model::verify_attestation_request::DeviceAttestation>,
594            >,
595    >(
596        mut self,
597        v: T,
598    ) -> Self {
599        self.device_attestation = v.into();
600        self
601    }
602
603    /// The value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation]
604    /// if it holds a `NvidiaAttestation`, `None` if the field is not set or
605    /// holds a different branch.
606    pub fn nvidia_attestation(
607        &self,
608    ) -> std::option::Option<&std::boxed::Box<crate::model::NvidiaAttestation>> {
609        #[allow(unreachable_patterns)]
610        self.device_attestation.as_ref().and_then(|v| match v {
611            crate::model::verify_attestation_request::DeviceAttestation::NvidiaAttestation(v) => {
612                std::option::Option::Some(v)
613            }
614            _ => std::option::Option::None,
615        })
616    }
617
618    /// Sets the value of [device_attestation][crate::model::VerifyAttestationRequest::device_attestation]
619    /// to hold a `NvidiaAttestation`.
620    ///
621    /// Note that all the setters affecting `device_attestation` are
622    /// mutually exclusive.
623    ///
624    /// # Example
625    /// ```ignore,no_run
626    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationRequest;
627    /// use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
628    /// let x = VerifyAttestationRequest::new().set_nvidia_attestation(NvidiaAttestation::default()/* use setters */);
629    /// assert!(x.nvidia_attestation().is_some());
630    /// ```
631    pub fn set_nvidia_attestation<
632        T: std::convert::Into<std::boxed::Box<crate::model::NvidiaAttestation>>,
633    >(
634        mut self,
635        v: T,
636    ) -> Self {
637        self.device_attestation = std::option::Option::Some(
638            crate::model::verify_attestation_request::DeviceAttestation::NvidiaAttestation(
639                v.into(),
640            ),
641        );
642        self
643    }
644}
645
646impl wkt::message::Message for VerifyAttestationRequest {
647    fn typename() -> &'static str {
648        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyAttestationRequest"
649    }
650}
651
652/// Defines additional types related to [VerifyAttestationRequest].
653pub mod verify_attestation_request {
654    #[allow(unused_imports)]
655    use super::*;
656
657    /// An optional tee attestation report, used to populate hardware rooted
658    /// claims.
659    #[derive(Clone, Debug, PartialEq)]
660    #[non_exhaustive]
661    pub enum TeeAttestation {
662        /// Optional. A TDX with CCEL and RTMR Attestation Quote.
663        TdCcel(std::boxed::Box<crate::model::TdxCcelAttestation>),
664        /// Optional. An SEV-SNP Attestation Report.
665        SevSnpAttestation(std::boxed::Box<crate::model::SevSnpAttestation>),
666    }
667
668    /// An optional device attestation report.
669    #[derive(Clone, Debug, PartialEq)]
670    #[non_exhaustive]
671    pub enum DeviceAttestation {
672        /// Optional. An Nvidia attestation report for GPU and NVSwitch devices.
673        NvidiaAttestation(std::boxed::Box<crate::model::NvidiaAttestation>),
674    }
675}
676
677/// An Nvidia attestation report for GPU and NVSwitch devices.
678/// Contains necessary attestation evidence that the client collects for
679/// verification.
680#[derive(Clone, Default, PartialEq)]
681#[non_exhaustive]
682pub struct NvidiaAttestation {
683    /// The Confidential Computing feature that the attestation is for.
684    pub cc_feature: std::option::Option<crate::model::nvidia_attestation::CcFeature>,
685
686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
687}
688
689impl NvidiaAttestation {
690    /// Creates a new default instance.
691    pub fn new() -> Self {
692        std::default::Default::default()
693    }
694
695    /// Sets the value of [cc_feature][crate::model::NvidiaAttestation::cc_feature].
696    ///
697    /// Note that all the setters affecting `cc_feature` are mutually
698    /// exclusive.
699    ///
700    /// # Example
701    /// ```ignore,no_run
702    /// # use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
703    /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SinglePassthroughAttestation;
704    /// let x = NvidiaAttestation::new().set_cc_feature(Some(
705    ///     google_cloud_confidentialcomputing_v1::model::nvidia_attestation::CcFeature::Spt(SinglePassthroughAttestation::default().into())));
706    /// ```
707    pub fn set_cc_feature<
708        T: std::convert::Into<std::option::Option<crate::model::nvidia_attestation::CcFeature>>,
709    >(
710        mut self,
711        v: T,
712    ) -> Self {
713        self.cc_feature = v.into();
714        self
715    }
716
717    /// The value of [cc_feature][crate::model::NvidiaAttestation::cc_feature]
718    /// if it holds a `Spt`, `None` if the field is not set or
719    /// holds a different branch.
720    pub fn spt(
721        &self,
722    ) -> std::option::Option<
723        &std::boxed::Box<crate::model::nvidia_attestation::SinglePassthroughAttestation>,
724    > {
725        #[allow(unreachable_patterns)]
726        self.cc_feature.as_ref().and_then(|v| match v {
727            crate::model::nvidia_attestation::CcFeature::Spt(v) => std::option::Option::Some(v),
728            _ => std::option::Option::None,
729        })
730    }
731
732    /// Sets the value of [cc_feature][crate::model::NvidiaAttestation::cc_feature]
733    /// to hold a `Spt`.
734    ///
735    /// Note that all the setters affecting `cc_feature` are
736    /// mutually exclusive.
737    ///
738    /// # Example
739    /// ```ignore,no_run
740    /// # use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
741    /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SinglePassthroughAttestation;
742    /// let x = NvidiaAttestation::new().set_spt(SinglePassthroughAttestation::default()/* use setters */);
743    /// assert!(x.spt().is_some());
744    /// assert!(x.ppcie().is_none());
745    /// assert!(x.mpt().is_none());
746    /// ```
747    pub fn set_spt<
748        T: std::convert::Into<
749                std::boxed::Box<crate::model::nvidia_attestation::SinglePassthroughAttestation>,
750            >,
751    >(
752        mut self,
753        v: T,
754    ) -> Self {
755        self.cc_feature =
756            std::option::Option::Some(crate::model::nvidia_attestation::CcFeature::Spt(v.into()));
757        self
758    }
759
760    /// The value of [cc_feature][crate::model::NvidiaAttestation::cc_feature]
761    /// if it holds a `Ppcie`, `None` if the field is not set or
762    /// holds a different branch.
763    pub fn ppcie(
764        &self,
765    ) -> std::option::Option<
766        &std::boxed::Box<crate::model::nvidia_attestation::ProtectedPcieAttestation>,
767    > {
768        #[allow(unreachable_patterns)]
769        self.cc_feature.as_ref().and_then(|v| match v {
770            crate::model::nvidia_attestation::CcFeature::Ppcie(v) => std::option::Option::Some(v),
771            _ => std::option::Option::None,
772        })
773    }
774
775    /// Sets the value of [cc_feature][crate::model::NvidiaAttestation::cc_feature]
776    /// to hold a `Ppcie`.
777    ///
778    /// Note that all the setters affecting `cc_feature` are
779    /// mutually exclusive.
780    ///
781    /// # Example
782    /// ```ignore,no_run
783    /// # use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
784    /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::ProtectedPcieAttestation;
785    /// let x = NvidiaAttestation::new().set_ppcie(ProtectedPcieAttestation::default()/* use setters */);
786    /// assert!(x.ppcie().is_some());
787    /// assert!(x.spt().is_none());
788    /// assert!(x.mpt().is_none());
789    /// ```
790    pub fn set_ppcie<
791        T: std::convert::Into<
792                std::boxed::Box<crate::model::nvidia_attestation::ProtectedPcieAttestation>,
793            >,
794    >(
795        mut self,
796        v: T,
797    ) -> Self {
798        self.cc_feature =
799            std::option::Option::Some(crate::model::nvidia_attestation::CcFeature::Ppcie(v.into()));
800        self
801    }
802
803    /// The value of [cc_feature][crate::model::NvidiaAttestation::cc_feature]
804    /// if it holds a `Mpt`, `None` if the field is not set or
805    /// holds a different branch.
806    pub fn mpt(
807        &self,
808    ) -> std::option::Option<
809        &std::boxed::Box<crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation>,
810    > {
811        #[allow(unreachable_patterns)]
812        self.cc_feature.as_ref().and_then(|v| match v {
813            crate::model::nvidia_attestation::CcFeature::Mpt(v) => std::option::Option::Some(v),
814            _ => std::option::Option::None,
815        })
816    }
817
818    /// Sets the value of [cc_feature][crate::model::NvidiaAttestation::cc_feature]
819    /// to hold a `Mpt`.
820    ///
821    /// Note that all the setters affecting `cc_feature` are
822    /// mutually exclusive.
823    ///
824    /// # Example
825    /// ```ignore,no_run
826    /// # use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
827    /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation;
828    /// let x = NvidiaAttestation::new().set_mpt(MultiGpuSecurePassthroughAttestation::default()/* use setters */);
829    /// assert!(x.mpt().is_some());
830    /// assert!(x.spt().is_none());
831    /// assert!(x.ppcie().is_none());
832    /// ```
833    pub fn set_mpt<
834        T: std::convert::Into<
835                std::boxed::Box<
836                    crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation,
837                >,
838            >,
839    >(
840        mut self,
841        v: T,
842    ) -> Self {
843        self.cc_feature =
844            std::option::Option::Some(crate::model::nvidia_attestation::CcFeature::Mpt(v.into()));
845        self
846    }
847}
848
849impl wkt::message::Message for NvidiaAttestation {
850    fn typename() -> &'static str {
851        "type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation"
852    }
853}
854
855/// Defines additional types related to [NvidiaAttestation].
856pub mod nvidia_attestation {
857    #[allow(unused_imports)]
858    use super::*;
859
860    /// GpuInfo contains the attestation evidence for a GPU device.
861    #[derive(Clone, Default, PartialEq)]
862    #[non_exhaustive]
863    pub struct GpuInfo {
864        /// Optional. The UUID of the GPU device.
865        pub uuid: std::string::String,
866
867        /// Optional. The driver version of the GPU.
868        pub driver_version: std::string::String,
869
870        /// Optional. The vBIOS version of the GPU.
871        pub vbios_version: std::string::String,
872
873        /// Optional. The GPU architecture type.
874        pub gpu_architecture_type: crate::model::nvidia_attestation::GpuArchitectureType,
875
876        /// Optional. The raw attestation certificate chain for the GPU device.
877        pub attestation_certificate_chain: ::bytes::Bytes,
878
879        /// Optional. The raw attestation report for the GPU device.
880        /// This field contains SPDM request/response defined in
881        /// <https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.1.0.pdf>
882        pub attestation_report: ::bytes::Bytes,
883
884        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
885    }
886
887    impl GpuInfo {
888        /// Creates a new default instance.
889        pub fn new() -> Self {
890            std::default::Default::default()
891        }
892
893        /// Sets the value of [uuid][crate::model::nvidia_attestation::GpuInfo::uuid].
894        ///
895        /// # Example
896        /// ```ignore,no_run
897        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
898        /// let x = GpuInfo::new().set_uuid("example");
899        /// ```
900        pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
901            self.uuid = v.into();
902            self
903        }
904
905        /// Sets the value of [driver_version][crate::model::nvidia_attestation::GpuInfo::driver_version].
906        ///
907        /// # Example
908        /// ```ignore,no_run
909        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
910        /// let x = GpuInfo::new().set_driver_version("example");
911        /// ```
912        pub fn set_driver_version<T: std::convert::Into<std::string::String>>(
913            mut self,
914            v: T,
915        ) -> Self {
916            self.driver_version = v.into();
917            self
918        }
919
920        /// Sets the value of [vbios_version][crate::model::nvidia_attestation::GpuInfo::vbios_version].
921        ///
922        /// # Example
923        /// ```ignore,no_run
924        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
925        /// let x = GpuInfo::new().set_vbios_version("example");
926        /// ```
927        pub fn set_vbios_version<T: std::convert::Into<std::string::String>>(
928            mut self,
929            v: T,
930        ) -> Self {
931            self.vbios_version = v.into();
932            self
933        }
934
935        /// Sets the value of [gpu_architecture_type][crate::model::nvidia_attestation::GpuInfo::gpu_architecture_type].
936        ///
937        /// # Example
938        /// ```ignore,no_run
939        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
940        /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuArchitectureType;
941        /// let x0 = GpuInfo::new().set_gpu_architecture_type(GpuArchitectureType::Hopper);
942        /// let x1 = GpuInfo::new().set_gpu_architecture_type(GpuArchitectureType::Blackwell);
943        /// ```
944        pub fn set_gpu_architecture_type<
945            T: std::convert::Into<crate::model::nvidia_attestation::GpuArchitectureType>,
946        >(
947            mut self,
948            v: T,
949        ) -> Self {
950            self.gpu_architecture_type = v.into();
951            self
952        }
953
954        /// Sets the value of [attestation_certificate_chain][crate::model::nvidia_attestation::GpuInfo::attestation_certificate_chain].
955        ///
956        /// # Example
957        /// ```ignore,no_run
958        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
959        /// let x = GpuInfo::new().set_attestation_certificate_chain(bytes::Bytes::from_static(b"example"));
960        /// ```
961        pub fn set_attestation_certificate_chain<T: std::convert::Into<::bytes::Bytes>>(
962            mut self,
963            v: T,
964        ) -> Self {
965            self.attestation_certificate_chain = v.into();
966            self
967        }
968
969        /// Sets the value of [attestation_report][crate::model::nvidia_attestation::GpuInfo::attestation_report].
970        ///
971        /// # Example
972        /// ```ignore,no_run
973        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
974        /// let x = GpuInfo::new().set_attestation_report(bytes::Bytes::from_static(b"example"));
975        /// ```
976        pub fn set_attestation_report<T: std::convert::Into<::bytes::Bytes>>(
977            mut self,
978            v: T,
979        ) -> Self {
980            self.attestation_report = v.into();
981            self
982        }
983    }
984
985    impl wkt::message::Message for GpuInfo {
986        fn typename() -> &'static str {
987            "type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.GpuInfo"
988        }
989    }
990
991    /// SwitchInfo contains the attestation evidence for a NVSwitch device.
992    #[derive(Clone, Default, PartialEq)]
993    #[non_exhaustive]
994    pub struct SwitchInfo {
995        /// Optional. The UUID of the NVSwitch device.
996        pub uuid: std::string::String,
997
998        /// Optional. The raw attestation certificate chain for the NVSwitch device.
999        pub attestation_certificate_chain: ::bytes::Bytes,
1000
1001        /// Optional. The raw attestation report for the NvSwitch device.
1002        /// This field contains SPDM request/response defined in
1003        /// <https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.1.0.pdf>
1004        pub attestation_report: ::bytes::Bytes,
1005
1006        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1007    }
1008
1009    impl SwitchInfo {
1010        /// Creates a new default instance.
1011        pub fn new() -> Self {
1012            std::default::Default::default()
1013        }
1014
1015        /// Sets the value of [uuid][crate::model::nvidia_attestation::SwitchInfo::uuid].
1016        ///
1017        /// # Example
1018        /// ```ignore,no_run
1019        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SwitchInfo;
1020        /// let x = SwitchInfo::new().set_uuid("example");
1021        /// ```
1022        pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1023            self.uuid = v.into();
1024            self
1025        }
1026
1027        /// Sets the value of [attestation_certificate_chain][crate::model::nvidia_attestation::SwitchInfo::attestation_certificate_chain].
1028        ///
1029        /// # Example
1030        /// ```ignore,no_run
1031        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SwitchInfo;
1032        /// let x = SwitchInfo::new().set_attestation_certificate_chain(bytes::Bytes::from_static(b"example"));
1033        /// ```
1034        pub fn set_attestation_certificate_chain<T: std::convert::Into<::bytes::Bytes>>(
1035            mut self,
1036            v: T,
1037        ) -> Self {
1038            self.attestation_certificate_chain = v.into();
1039            self
1040        }
1041
1042        /// Sets the value of [attestation_report][crate::model::nvidia_attestation::SwitchInfo::attestation_report].
1043        ///
1044        /// # Example
1045        /// ```ignore,no_run
1046        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SwitchInfo;
1047        /// let x = SwitchInfo::new().set_attestation_report(bytes::Bytes::from_static(b"example"));
1048        /// ```
1049        pub fn set_attestation_report<T: std::convert::Into<::bytes::Bytes>>(
1050            mut self,
1051            v: T,
1052        ) -> Self {
1053            self.attestation_report = v.into();
1054            self
1055        }
1056    }
1057
1058    impl wkt::message::Message for SwitchInfo {
1059        fn typename() -> &'static str {
1060            "type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.SwitchInfo"
1061        }
1062    }
1063
1064    /// Single GPU Passthrough (SPT) attestation.
1065    #[derive(Clone, Default, PartialEq)]
1066    #[non_exhaustive]
1067    pub struct SinglePassthroughAttestation {
1068        /// Optional. Single GPU quote.
1069        pub gpu_quote: std::option::Option<crate::model::nvidia_attestation::GpuInfo>,
1070
1071        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1072    }
1073
1074    impl SinglePassthroughAttestation {
1075        /// Creates a new default instance.
1076        pub fn new() -> Self {
1077            std::default::Default::default()
1078        }
1079
1080        /// Sets the value of [gpu_quote][crate::model::nvidia_attestation::SinglePassthroughAttestation::gpu_quote].
1081        ///
1082        /// # Example
1083        /// ```ignore,no_run
1084        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SinglePassthroughAttestation;
1085        /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
1086        /// let x = SinglePassthroughAttestation::new().set_gpu_quote(GpuInfo::default()/* use setters */);
1087        /// ```
1088        pub fn set_gpu_quote<T>(mut self, v: T) -> Self
1089        where
1090            T: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
1091        {
1092            self.gpu_quote = std::option::Option::Some(v.into());
1093            self
1094        }
1095
1096        /// Sets or clears the value of [gpu_quote][crate::model::nvidia_attestation::SinglePassthroughAttestation::gpu_quote].
1097        ///
1098        /// # Example
1099        /// ```ignore,no_run
1100        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SinglePassthroughAttestation;
1101        /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
1102        /// let x = SinglePassthroughAttestation::new().set_or_clear_gpu_quote(Some(GpuInfo::default()/* use setters */));
1103        /// let x = SinglePassthroughAttestation::new().set_or_clear_gpu_quote(None::<GpuInfo>);
1104        /// ```
1105        pub fn set_or_clear_gpu_quote<T>(mut self, v: std::option::Option<T>) -> Self
1106        where
1107            T: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
1108        {
1109            self.gpu_quote = v.map(|x| x.into());
1110            self
1111        }
1112    }
1113
1114    impl wkt::message::Message for SinglePassthroughAttestation {
1115        fn typename() -> &'static str {
1116            "type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.SinglePassthroughAttestation"
1117        }
1118    }
1119
1120    /// Protected PCIe (PPCIE) attestation.
1121    /// Eight Hopper GPUs with Four NVSwitch Passthrough.
1122    #[derive(Clone, Default, PartialEq)]
1123    #[non_exhaustive]
1124    pub struct ProtectedPcieAttestation {
1125        /// Optional. A list of GPU infos.
1126        pub gpu_quotes: std::vec::Vec<crate::model::nvidia_attestation::GpuInfo>,
1127
1128        /// Optional. A list of SWITCH infos.
1129        pub switch_quotes: std::vec::Vec<crate::model::nvidia_attestation::SwitchInfo>,
1130
1131        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1132    }
1133
1134    impl ProtectedPcieAttestation {
1135        /// Creates a new default instance.
1136        pub fn new() -> Self {
1137            std::default::Default::default()
1138        }
1139
1140        /// Sets the value of [gpu_quotes][crate::model::nvidia_attestation::ProtectedPcieAttestation::gpu_quotes].
1141        ///
1142        /// # Example
1143        /// ```ignore,no_run
1144        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::ProtectedPcieAttestation;
1145        /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
1146        /// let x = ProtectedPcieAttestation::new()
1147        ///     .set_gpu_quotes([
1148        ///         GpuInfo::default()/* use setters */,
1149        ///         GpuInfo::default()/* use (different) setters */,
1150        ///     ]);
1151        /// ```
1152        pub fn set_gpu_quotes<T, V>(mut self, v: T) -> Self
1153        where
1154            T: std::iter::IntoIterator<Item = V>,
1155            V: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
1156        {
1157            use std::iter::Iterator;
1158            self.gpu_quotes = v.into_iter().map(|i| i.into()).collect();
1159            self
1160        }
1161
1162        /// Sets the value of [switch_quotes][crate::model::nvidia_attestation::ProtectedPcieAttestation::switch_quotes].
1163        ///
1164        /// # Example
1165        /// ```ignore,no_run
1166        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::ProtectedPcieAttestation;
1167        /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::SwitchInfo;
1168        /// let x = ProtectedPcieAttestation::new()
1169        ///     .set_switch_quotes([
1170        ///         SwitchInfo::default()/* use setters */,
1171        ///         SwitchInfo::default()/* use (different) setters */,
1172        ///     ]);
1173        /// ```
1174        pub fn set_switch_quotes<T, V>(mut self, v: T) -> Self
1175        where
1176            T: std::iter::IntoIterator<Item = V>,
1177            V: std::convert::Into<crate::model::nvidia_attestation::SwitchInfo>,
1178        {
1179            use std::iter::Iterator;
1180            self.switch_quotes = v.into_iter().map(|i| i.into()).collect();
1181            self
1182        }
1183    }
1184
1185    impl wkt::message::Message for ProtectedPcieAttestation {
1186        fn typename() -> &'static str {
1187            "type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.ProtectedPcieAttestation"
1188        }
1189    }
1190
1191    /// MultiGpuSecurePassthroughAttestation contains the attestation evidence
1192    /// for a Multi-GPU Secure Passthrough (MPT) attestation.
1193    #[derive(Clone, Default, PartialEq)]
1194    #[non_exhaustive]
1195    pub struct MultiGpuSecurePassthroughAttestation {
1196        /// Optional. A list of GPU quotes.
1197        pub gpu_quotes: std::vec::Vec<crate::model::nvidia_attestation::GpuInfo>,
1198
1199        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1200    }
1201
1202    impl MultiGpuSecurePassthroughAttestation {
1203        /// Creates a new default instance.
1204        pub fn new() -> Self {
1205            std::default::Default::default()
1206        }
1207
1208        /// Sets the value of [gpu_quotes][crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation::gpu_quotes].
1209        ///
1210        /// # Example
1211        /// ```ignore,no_run
1212        /// # use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation;
1213        /// use google_cloud_confidentialcomputing_v1::model::nvidia_attestation::GpuInfo;
1214        /// let x = MultiGpuSecurePassthroughAttestation::new()
1215        ///     .set_gpu_quotes([
1216        ///         GpuInfo::default()/* use setters */,
1217        ///         GpuInfo::default()/* use (different) setters */,
1218        ///     ]);
1219        /// ```
1220        pub fn set_gpu_quotes<T, V>(mut self, v: T) -> Self
1221        where
1222            T: std::iter::IntoIterator<Item = V>,
1223            V: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
1224        {
1225            use std::iter::Iterator;
1226            self.gpu_quotes = v.into_iter().map(|i| i.into()).collect();
1227            self
1228        }
1229    }
1230
1231    impl wkt::message::Message for MultiGpuSecurePassthroughAttestation {
1232        fn typename() -> &'static str {
1233            "type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.MultiGpuSecurePassthroughAttestation"
1234        }
1235    }
1236
1237    /// GpuArchitectureType enumerates the supported GPU architecture types.
1238    ///
1239    /// # Working with unknown values
1240    ///
1241    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1242    /// additional enum variants at any time. Adding new variants is not considered
1243    /// a breaking change. Applications should write their code in anticipation of:
1244    ///
1245    /// - New values appearing in future releases of the client library, **and**
1246    /// - New values received dynamically, without application changes.
1247    ///
1248    /// Please consult the [Working with enums] section in the user guide for some
1249    /// guidelines.
1250    ///
1251    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1252    #[derive(Clone, Debug, PartialEq)]
1253    #[non_exhaustive]
1254    pub enum GpuArchitectureType {
1255        /// Unspecified GPU architecture type.
1256        Unspecified,
1257        /// Hopper GPU architecture type.
1258        Hopper,
1259        /// Blackwell GPU architecture type.
1260        Blackwell,
1261        /// If set, the enum was initialized with an unknown value.
1262        ///
1263        /// Applications can examine the value using [GpuArchitectureType::value] or
1264        /// [GpuArchitectureType::name].
1265        UnknownValue(gpu_architecture_type::UnknownValue),
1266    }
1267
1268    #[doc(hidden)]
1269    pub mod gpu_architecture_type {
1270        #[allow(unused_imports)]
1271        use super::*;
1272        #[derive(Clone, Debug, PartialEq)]
1273        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1274    }
1275
1276    impl GpuArchitectureType {
1277        /// Gets the enum value.
1278        ///
1279        /// Returns `None` if the enum contains an unknown value deserialized from
1280        /// the string representation of enums.
1281        pub fn value(&self) -> std::option::Option<i32> {
1282            match self {
1283                Self::Unspecified => std::option::Option::Some(0),
1284                Self::Hopper => std::option::Option::Some(8),
1285                Self::Blackwell => std::option::Option::Some(10),
1286                Self::UnknownValue(u) => u.0.value(),
1287            }
1288        }
1289
1290        /// Gets the enum value as a string.
1291        ///
1292        /// Returns `None` if the enum contains an unknown value deserialized from
1293        /// the integer representation of enums.
1294        pub fn name(&self) -> std::option::Option<&str> {
1295            match self {
1296                Self::Unspecified => std::option::Option::Some("GPU_ARCHITECTURE_TYPE_UNSPECIFIED"),
1297                Self::Hopper => std::option::Option::Some("GPU_ARCHITECTURE_TYPE_HOPPER"),
1298                Self::Blackwell => std::option::Option::Some("GPU_ARCHITECTURE_TYPE_BLACKWELL"),
1299                Self::UnknownValue(u) => u.0.name(),
1300            }
1301        }
1302    }
1303
1304    impl std::default::Default for GpuArchitectureType {
1305        fn default() -> Self {
1306            use std::convert::From;
1307            Self::from(0)
1308        }
1309    }
1310
1311    impl std::fmt::Display for GpuArchitectureType {
1312        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1313            wkt::internal::display_enum(f, self.name(), self.value())
1314        }
1315    }
1316
1317    impl std::convert::From<i32> for GpuArchitectureType {
1318        fn from(value: i32) -> Self {
1319            match value {
1320                0 => Self::Unspecified,
1321                8 => Self::Hopper,
1322                10 => Self::Blackwell,
1323                _ => Self::UnknownValue(gpu_architecture_type::UnknownValue(
1324                    wkt::internal::UnknownEnumValue::Integer(value),
1325                )),
1326            }
1327        }
1328    }
1329
1330    impl std::convert::From<&str> for GpuArchitectureType {
1331        fn from(value: &str) -> Self {
1332            use std::string::ToString;
1333            match value {
1334                "GPU_ARCHITECTURE_TYPE_UNSPECIFIED" => Self::Unspecified,
1335                "GPU_ARCHITECTURE_TYPE_HOPPER" => Self::Hopper,
1336                "GPU_ARCHITECTURE_TYPE_BLACKWELL" => Self::Blackwell,
1337                _ => Self::UnknownValue(gpu_architecture_type::UnknownValue(
1338                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1339                )),
1340            }
1341        }
1342    }
1343
1344    impl serde::ser::Serialize for GpuArchitectureType {
1345        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1346        where
1347            S: serde::Serializer,
1348        {
1349            match self {
1350                Self::Unspecified => serializer.serialize_i32(0),
1351                Self::Hopper => serializer.serialize_i32(8),
1352                Self::Blackwell => serializer.serialize_i32(10),
1353                Self::UnknownValue(u) => u.0.serialize(serializer),
1354            }
1355        }
1356    }
1357
1358    impl<'de> serde::de::Deserialize<'de> for GpuArchitectureType {
1359        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1360        where
1361            D: serde::Deserializer<'de>,
1362        {
1363            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GpuArchitectureType>::new(
1364                ".google.cloud.confidentialcomputing.v1.NvidiaAttestation.GpuArchitectureType",
1365            ))
1366        }
1367    }
1368
1369    /// The Confidential Computing feature that the attestation is for.
1370    #[derive(Clone, Debug, PartialEq)]
1371    #[non_exhaustive]
1372    pub enum CcFeature {
1373        /// Single GPU Passthrough (SPT) attestation.
1374        Spt(std::boxed::Box<crate::model::nvidia_attestation::SinglePassthroughAttestation>),
1375        /// Protected PCIe (PPCIE) attestation.
1376        Ppcie(std::boxed::Box<crate::model::nvidia_attestation::ProtectedPcieAttestation>),
1377        /// Multi-GPU Secure Passthrough (MPT) attestation.
1378        Mpt(
1379            std::boxed::Box<crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation>,
1380        ),
1381    }
1382}
1383
1384/// A TDX Attestation quote.
1385#[derive(Clone, Default, PartialEq)]
1386#[non_exhaustive]
1387pub struct TdxCcelAttestation {
1388    /// Optional. The Confidential Computing Event Log (CCEL) ACPI table. Formatted
1389    /// as described in the ACPI Specification 6.5.
1390    pub ccel_acpi_table: ::bytes::Bytes,
1391
1392    /// Optional. The CCEL event log. Formatted as described in the UEFI 2.10.
1393    pub ccel_data: ::bytes::Bytes,
1394
1395    /// Optional. An Event Log containing additional events measured into the RTMR
1396    /// that are not already present in the CCEL.
1397    pub canonical_event_log: ::bytes::Bytes,
1398
1399    /// Optional. The TDX attestation quote from the guest. It contains the RTMR
1400    /// values.
1401    pub td_quote: ::bytes::Bytes,
1402
1403    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1404}
1405
1406impl TdxCcelAttestation {
1407    /// Creates a new default instance.
1408    pub fn new() -> Self {
1409        std::default::Default::default()
1410    }
1411
1412    /// Sets the value of [ccel_acpi_table][crate::model::TdxCcelAttestation::ccel_acpi_table].
1413    ///
1414    /// # Example
1415    /// ```ignore,no_run
1416    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
1417    /// let x = TdxCcelAttestation::new().set_ccel_acpi_table(bytes::Bytes::from_static(b"example"));
1418    /// ```
1419    pub fn set_ccel_acpi_table<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1420        self.ccel_acpi_table = v.into();
1421        self
1422    }
1423
1424    /// Sets the value of [ccel_data][crate::model::TdxCcelAttestation::ccel_data].
1425    ///
1426    /// # Example
1427    /// ```ignore,no_run
1428    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
1429    /// let x = TdxCcelAttestation::new().set_ccel_data(bytes::Bytes::from_static(b"example"));
1430    /// ```
1431    pub fn set_ccel_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1432        self.ccel_data = v.into();
1433        self
1434    }
1435
1436    /// Sets the value of [canonical_event_log][crate::model::TdxCcelAttestation::canonical_event_log].
1437    ///
1438    /// # Example
1439    /// ```ignore,no_run
1440    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
1441    /// let x = TdxCcelAttestation::new().set_canonical_event_log(bytes::Bytes::from_static(b"example"));
1442    /// ```
1443    pub fn set_canonical_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1444        self.canonical_event_log = v.into();
1445        self
1446    }
1447
1448    /// Sets the value of [td_quote][crate::model::TdxCcelAttestation::td_quote].
1449    ///
1450    /// # Example
1451    /// ```ignore,no_run
1452    /// # use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
1453    /// let x = TdxCcelAttestation::new().set_td_quote(bytes::Bytes::from_static(b"example"));
1454    /// ```
1455    pub fn set_td_quote<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1456        self.td_quote = v.into();
1457        self
1458    }
1459}
1460
1461impl wkt::message::Message for TdxCcelAttestation {
1462    fn typename() -> &'static str {
1463        "type.googleapis.com/google.cloud.confidentialcomputing.v1.TdxCcelAttestation"
1464    }
1465}
1466
1467/// An SEV-SNP Attestation Report.
1468/// Contains the attestation report and the certificate bundle that the client
1469/// collects.
1470#[derive(Clone, Default, PartialEq)]
1471#[non_exhaustive]
1472pub struct SevSnpAttestation {
1473    /// Optional. The SEV-SNP Attestation Report
1474    /// Format is in revision 1.55, §7.3 Attestation, Table 22. ATTESTATION_REPORT
1475    /// Structure in this document:
1476    /// <https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56860.pdf>
1477    pub report: ::bytes::Bytes,
1478
1479    /// Optional. Certificate bundle defined in the GHCB protocol definition
1480    /// Format is documented in GHCB revision 2.03, section 4.1.8.1 struct
1481    /// cert_table in this document:
1482    /// <https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56421.pdf>
1483    pub aux_blob: ::bytes::Bytes,
1484
1485    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1486}
1487
1488impl SevSnpAttestation {
1489    /// Creates a new default instance.
1490    pub fn new() -> Self {
1491        std::default::Default::default()
1492    }
1493
1494    /// Sets the value of [report][crate::model::SevSnpAttestation::report].
1495    ///
1496    /// # Example
1497    /// ```ignore,no_run
1498    /// # use google_cloud_confidentialcomputing_v1::model::SevSnpAttestation;
1499    /// let x = SevSnpAttestation::new().set_report(bytes::Bytes::from_static(b"example"));
1500    /// ```
1501    pub fn set_report<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1502        self.report = v.into();
1503        self
1504    }
1505
1506    /// Sets the value of [aux_blob][crate::model::SevSnpAttestation::aux_blob].
1507    ///
1508    /// # Example
1509    /// ```ignore,no_run
1510    /// # use google_cloud_confidentialcomputing_v1::model::SevSnpAttestation;
1511    /// let x = SevSnpAttestation::new().set_aux_blob(bytes::Bytes::from_static(b"example"));
1512    /// ```
1513    pub fn set_aux_blob<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1514        self.aux_blob = v.into();
1515        self
1516    }
1517}
1518
1519impl wkt::message::Message for SevSnpAttestation {
1520    fn typename() -> &'static str {
1521        "type.googleapis.com/google.cloud.confidentialcomputing.v1.SevSnpAttestation"
1522    }
1523}
1524
1525/// A response once an attestation has been successfully verified, containing a
1526/// signed attestation token.
1527#[derive(Clone, Default, PartialEq)]
1528#[non_exhaustive]
1529pub struct VerifyAttestationResponse {
1530    /// Output only. Same as claims_token, but as a string.
1531    pub oidc_claims_token: std::string::String,
1532
1533    /// Output only. A list of messages that carry the partial error details
1534    /// related to VerifyAttestation.
1535    pub partial_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
1536
1537    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1538}
1539
1540impl VerifyAttestationResponse {
1541    /// Creates a new default instance.
1542    pub fn new() -> Self {
1543        std::default::Default::default()
1544    }
1545
1546    /// Sets the value of [oidc_claims_token][crate::model::VerifyAttestationResponse::oidc_claims_token].
1547    ///
1548    /// # Example
1549    /// ```ignore,no_run
1550    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationResponse;
1551    /// let x = VerifyAttestationResponse::new().set_oidc_claims_token("example");
1552    /// ```
1553    pub fn set_oidc_claims_token<T: std::convert::Into<std::string::String>>(
1554        mut self,
1555        v: T,
1556    ) -> Self {
1557        self.oidc_claims_token = v.into();
1558        self
1559    }
1560
1561    /// Sets the value of [partial_errors][crate::model::VerifyAttestationResponse::partial_errors].
1562    ///
1563    /// # Example
1564    /// ```ignore,no_run
1565    /// # use google_cloud_confidentialcomputing_v1::model::VerifyAttestationResponse;
1566    /// use google_cloud_rpc::model::Status;
1567    /// let x = VerifyAttestationResponse::new()
1568    ///     .set_partial_errors([
1569    ///         Status::default()/* use setters */,
1570    ///         Status::default()/* use (different) setters */,
1571    ///     ]);
1572    /// ```
1573    pub fn set_partial_errors<T, V>(mut self, v: T) -> Self
1574    where
1575        T: std::iter::IntoIterator<Item = V>,
1576        V: std::convert::Into<google_cloud_rpc::model::Status>,
1577    {
1578        use std::iter::Iterator;
1579        self.partial_errors = v.into_iter().map(|i| i.into()).collect();
1580        self
1581    }
1582}
1583
1584impl wkt::message::Message for VerifyAttestationResponse {
1585    fn typename() -> &'static str {
1586        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyAttestationResponse"
1587    }
1588}
1589
1590/// Credentials issued by GCP which are linked to the platform attestation. These
1591/// will be verified server-side as part of attestaion verification.
1592#[derive(Clone, Default, PartialEq)]
1593#[non_exhaustive]
1594pub struct GcpCredentials {
1595    /// Same as id_tokens, but as a string.
1596    pub service_account_id_tokens: std::vec::Vec<std::string::String>,
1597
1598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1599}
1600
1601impl GcpCredentials {
1602    /// Creates a new default instance.
1603    pub fn new() -> Self {
1604        std::default::Default::default()
1605    }
1606
1607    /// Sets the value of [service_account_id_tokens][crate::model::GcpCredentials::service_account_id_tokens].
1608    ///
1609    /// # Example
1610    /// ```ignore,no_run
1611    /// # use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
1612    /// let x = GcpCredentials::new().set_service_account_id_tokens(["a", "b", "c"]);
1613    /// ```
1614    pub fn set_service_account_id_tokens<T, V>(mut self, v: T) -> Self
1615    where
1616        T: std::iter::IntoIterator<Item = V>,
1617        V: std::convert::Into<std::string::String>,
1618    {
1619        use std::iter::Iterator;
1620        self.service_account_id_tokens = v.into_iter().map(|i| i.into()).collect();
1621        self
1622    }
1623}
1624
1625impl wkt::message::Message for GcpCredentials {
1626    fn typename() -> &'static str {
1627        "type.googleapis.com/google.cloud.confidentialcomputing.v1.GcpCredentials"
1628    }
1629}
1630
1631/// Options to modify claims in the token to generate custom-purpose tokens.
1632#[derive(Clone, Default, PartialEq)]
1633#[non_exhaustive]
1634pub struct TokenOptions {
1635    /// Optional. Optional string to issue the token with a custom audience claim.
1636    /// Required if one or more nonces are specified.
1637    pub audience: std::string::String,
1638
1639    /// Optional. Optional parameter to place one or more nonces in the eat_nonce
1640    /// claim in the output token. The minimum size for JSON-encoded EATs is 10
1641    /// bytes and the maximum size is 74 bytes.
1642    pub nonce: std::vec::Vec<std::string::String>,
1643
1644    /// Optional. Optional token type to select what type of token to return.
1645    pub token_type: crate::model::TokenType,
1646
1647    /// An optional additional configuration per token type.
1648    pub token_type_options: std::option::Option<crate::model::token_options::TokenTypeOptions>,
1649
1650    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1651}
1652
1653impl TokenOptions {
1654    /// Creates a new default instance.
1655    pub fn new() -> Self {
1656        std::default::Default::default()
1657    }
1658
1659    /// Sets the value of [audience][crate::model::TokenOptions::audience].
1660    ///
1661    /// # Example
1662    /// ```ignore,no_run
1663    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
1664    /// let x = TokenOptions::new().set_audience("example");
1665    /// ```
1666    pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1667        self.audience = v.into();
1668        self
1669    }
1670
1671    /// Sets the value of [nonce][crate::model::TokenOptions::nonce].
1672    ///
1673    /// # Example
1674    /// ```ignore,no_run
1675    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
1676    /// let x = TokenOptions::new().set_nonce(["a", "b", "c"]);
1677    /// ```
1678    pub fn set_nonce<T, V>(mut self, v: T) -> Self
1679    where
1680        T: std::iter::IntoIterator<Item = V>,
1681        V: std::convert::Into<std::string::String>,
1682    {
1683        use std::iter::Iterator;
1684        self.nonce = v.into_iter().map(|i| i.into()).collect();
1685        self
1686    }
1687
1688    /// Sets the value of [token_type][crate::model::TokenOptions::token_type].
1689    ///
1690    /// # Example
1691    /// ```ignore,no_run
1692    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
1693    /// use google_cloud_confidentialcomputing_v1::model::TokenType;
1694    /// let x0 = TokenOptions::new().set_token_type(TokenType::Oidc);
1695    /// let x1 = TokenOptions::new().set_token_type(TokenType::Pki);
1696    /// let x2 = TokenOptions::new().set_token_type(TokenType::LimitedAws);
1697    /// ```
1698    pub fn set_token_type<T: std::convert::Into<crate::model::TokenType>>(mut self, v: T) -> Self {
1699        self.token_type = v.into();
1700        self
1701    }
1702
1703    /// Sets the value of [token_type_options][crate::model::TokenOptions::token_type_options].
1704    ///
1705    /// Note that all the setters affecting `token_type_options` are mutually
1706    /// exclusive.
1707    ///
1708    /// # Example
1709    /// ```ignore,no_run
1710    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
1711    /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1712    /// let x = TokenOptions::new().set_token_type_options(Some(
1713    ///     google_cloud_confidentialcomputing_v1::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(AwsPrincipalTagsOptions::default().into())));
1714    /// ```
1715    pub fn set_token_type_options<
1716        T: std::convert::Into<std::option::Option<crate::model::token_options::TokenTypeOptions>>,
1717    >(
1718        mut self,
1719        v: T,
1720    ) -> Self {
1721        self.token_type_options = v.into();
1722        self
1723    }
1724
1725    /// The value of [token_type_options][crate::model::TokenOptions::token_type_options]
1726    /// if it holds a `AwsPrincipalTagsOptions`, `None` if the field is not set or
1727    /// holds a different branch.
1728    pub fn aws_principal_tags_options(
1729        &self,
1730    ) -> std::option::Option<&std::boxed::Box<crate::model::AwsPrincipalTagsOptions>> {
1731        #[allow(unreachable_patterns)]
1732        self.token_type_options.as_ref().and_then(|v| match v {
1733            crate::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(v) => {
1734                std::option::Option::Some(v)
1735            }
1736            _ => std::option::Option::None,
1737        })
1738    }
1739
1740    /// Sets the value of [token_type_options][crate::model::TokenOptions::token_type_options]
1741    /// to hold a `AwsPrincipalTagsOptions`.
1742    ///
1743    /// Note that all the setters affecting `token_type_options` are
1744    /// mutually exclusive.
1745    ///
1746    /// # Example
1747    /// ```ignore,no_run
1748    /// # use google_cloud_confidentialcomputing_v1::model::TokenOptions;
1749    /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1750    /// let x = TokenOptions::new().set_aws_principal_tags_options(AwsPrincipalTagsOptions::default()/* use setters */);
1751    /// assert!(x.aws_principal_tags_options().is_some());
1752    /// ```
1753    pub fn set_aws_principal_tags_options<
1754        T: std::convert::Into<std::boxed::Box<crate::model::AwsPrincipalTagsOptions>>,
1755    >(
1756        mut self,
1757        v: T,
1758    ) -> Self {
1759        self.token_type_options = std::option::Option::Some(
1760            crate::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(v.into()),
1761        );
1762        self
1763    }
1764}
1765
1766impl wkt::message::Message for TokenOptions {
1767    fn typename() -> &'static str {
1768        "type.googleapis.com/google.cloud.confidentialcomputing.v1.TokenOptions"
1769    }
1770}
1771
1772/// Defines additional types related to [TokenOptions].
1773pub mod token_options {
1774    #[allow(unused_imports)]
1775    use super::*;
1776
1777    /// An optional additional configuration per token type.
1778    #[derive(Clone, Debug, PartialEq)]
1779    #[non_exhaustive]
1780    pub enum TokenTypeOptions {
1781        /// Optional. Options for AWS token type.
1782        AwsPrincipalTagsOptions(std::boxed::Box<crate::model::AwsPrincipalTagsOptions>),
1783    }
1784}
1785
1786/// Token options that only apply to the AWS Principal Tags token type.
1787#[derive(Clone, Default, PartialEq)]
1788#[non_exhaustive]
1789pub struct AwsPrincipalTagsOptions {
1790    /// Optional. Principal tags to allow in the token.
1791    pub allowed_principal_tags:
1792        std::option::Option<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
1793
1794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1795}
1796
1797impl AwsPrincipalTagsOptions {
1798    /// Creates a new default instance.
1799    pub fn new() -> Self {
1800        std::default::Default::default()
1801    }
1802
1803    /// Sets the value of [allowed_principal_tags][crate::model::AwsPrincipalTagsOptions::allowed_principal_tags].
1804    ///
1805    /// # Example
1806    /// ```ignore,no_run
1807    /// # use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1808    /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1809    /// let x = AwsPrincipalTagsOptions::new().set_allowed_principal_tags(AllowedPrincipalTags::default()/* use setters */);
1810    /// ```
1811    pub fn set_allowed_principal_tags<T>(mut self, v: T) -> Self
1812    where
1813        T: std::convert::Into<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
1814    {
1815        self.allowed_principal_tags = std::option::Option::Some(v.into());
1816        self
1817    }
1818
1819    /// Sets or clears the value of [allowed_principal_tags][crate::model::AwsPrincipalTagsOptions::allowed_principal_tags].
1820    ///
1821    /// # Example
1822    /// ```ignore,no_run
1823    /// # use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
1824    /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1825    /// let x = AwsPrincipalTagsOptions::new().set_or_clear_allowed_principal_tags(Some(AllowedPrincipalTags::default()/* use setters */));
1826    /// let x = AwsPrincipalTagsOptions::new().set_or_clear_allowed_principal_tags(None::<AllowedPrincipalTags>);
1827    /// ```
1828    pub fn set_or_clear_allowed_principal_tags<T>(mut self, v: std::option::Option<T>) -> Self
1829    where
1830        T: std::convert::Into<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
1831    {
1832        self.allowed_principal_tags = v.map(|x| x.into());
1833        self
1834    }
1835}
1836
1837impl wkt::message::Message for AwsPrincipalTagsOptions {
1838    fn typename() -> &'static str {
1839        "type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions"
1840    }
1841}
1842
1843/// Defines additional types related to [AwsPrincipalTagsOptions].
1844pub mod aws_principal_tags_options {
1845    #[allow(unused_imports)]
1846    use super::*;
1847
1848    /// Allowed principal tags is used to define what principal tags will be
1849    /// placed in the token.
1850    #[derive(Clone, Default, PartialEq)]
1851    #[non_exhaustive]
1852    pub struct AllowedPrincipalTags {
1853
1854        /// Optional. Container image signatures allowed in the token.
1855        pub container_image_signatures: std::option::Option<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>,
1856
1857        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1858    }
1859
1860    impl AllowedPrincipalTags {
1861        /// Creates a new default instance.
1862        pub fn new() -> Self {
1863            std::default::Default::default()
1864        }
1865
1866        /// Sets the value of [container_image_signatures][crate::model::aws_principal_tags_options::AllowedPrincipalTags::container_image_signatures].
1867        ///
1868        /// # Example
1869        /// ```ignore,no_run
1870        /// # use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1871        /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures;
1872        /// let x = AllowedPrincipalTags::new().set_container_image_signatures(ContainerImageSignatures::default()/* use setters */);
1873        /// ```
1874        pub fn set_container_image_signatures<T>(mut self, v: T) -> Self
1875        where T: std::convert::Into<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>
1876        {
1877            self.container_image_signatures = std::option::Option::Some(v.into());
1878            self
1879        }
1880
1881        /// Sets or clears the value of [container_image_signatures][crate::model::aws_principal_tags_options::AllowedPrincipalTags::container_image_signatures].
1882        ///
1883        /// # Example
1884        /// ```ignore,no_run
1885        /// # use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::AllowedPrincipalTags;
1886        /// use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures;
1887        /// let x = AllowedPrincipalTags::new().set_or_clear_container_image_signatures(Some(ContainerImageSignatures::default()/* use setters */));
1888        /// let x = AllowedPrincipalTags::new().set_or_clear_container_image_signatures(None::<ContainerImageSignatures>);
1889        /// ```
1890        pub fn set_or_clear_container_image_signatures<T>(mut self, v: std::option::Option<T>) -> Self
1891        where T: std::convert::Into<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>
1892        {
1893            self.container_image_signatures = v.map(|x| x.into());
1894            self
1895        }
1896    }
1897
1898    impl wkt::message::Message for AllowedPrincipalTags {
1899        fn typename() -> &'static str {
1900            "type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions.AllowedPrincipalTags"
1901        }
1902    }
1903
1904    /// Defines additional types related to [AllowedPrincipalTags].
1905    pub mod allowed_principal_tags {
1906        #[allow(unused_imports)]
1907        use super::*;
1908
1909        /// Allowed Container Image Signatures. Key IDs are required to allow
1910        /// this claim to fit within the narrow AWS IAM restrictions.
1911        #[derive(Clone, Default, PartialEq)]
1912        #[non_exhaustive]
1913        pub struct ContainerImageSignatures {
1914            /// Optional. List of key ids to filter into the Principal tags. Only keys
1915            /// that have been validated and added to the token will be filtered into
1916            /// principal tags. Unrecognized key ids will be ignored.
1917            pub key_ids: std::vec::Vec<std::string::String>,
1918
1919            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1920        }
1921
1922        impl ContainerImageSignatures {
1923            /// Creates a new default instance.
1924            pub fn new() -> Self {
1925                std::default::Default::default()
1926            }
1927
1928            /// Sets the value of [key_ids][crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures::key_ids].
1929            ///
1930            /// # Example
1931            /// ```ignore,no_run
1932            /// # use google_cloud_confidentialcomputing_v1::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures;
1933            /// let x = ContainerImageSignatures::new().set_key_ids(["a", "b", "c"]);
1934            /// ```
1935            pub fn set_key_ids<T, V>(mut self, v: T) -> Self
1936            where
1937                T: std::iter::IntoIterator<Item = V>,
1938                V: std::convert::Into<std::string::String>,
1939            {
1940                use std::iter::Iterator;
1941                self.key_ids = v.into_iter().map(|i| i.into()).collect();
1942                self
1943            }
1944        }
1945
1946        impl wkt::message::Message for ContainerImageSignatures {
1947            fn typename() -> &'static str {
1948                "type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions.AllowedPrincipalTags.ContainerImageSignatures"
1949            }
1950        }
1951    }
1952}
1953
1954/// TPM2 data containing everything necessary to validate any platform state
1955/// measured into the TPM.
1956#[derive(Clone, Default, PartialEq)]
1957#[non_exhaustive]
1958pub struct TpmAttestation {
1959    /// TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
1960    pub quotes: std::vec::Vec<crate::model::tpm_attestation::Quote>,
1961
1962    /// The binary TCG Event Log containing events measured into the TPM by the
1963    /// platform firmware and operating system. Formatted as described in the
1964    /// "TCG PC Client Platform Firmware Profile Specification".
1965    pub tcg_event_log: ::bytes::Bytes,
1966
1967    /// An Event Log containing additional events measured into the TPM that are
1968    /// not already present in the tcg_event_log. Formatted as described in the
1969    /// "Canonical Event Log Format" TCG Specification.
1970    pub canonical_event_log: ::bytes::Bytes,
1971
1972    /// DER-encoded X.509 certificate of the Attestation Key (otherwise known as
1973    /// an AK or a TPM restricted signing key) used to generate the quotes.
1974    pub ak_cert: ::bytes::Bytes,
1975
1976    /// List of DER-encoded X.509 certificates which, together with the ak_cert,
1977    /// chain back to a trusted Root Certificate.
1978    pub cert_chain: std::vec::Vec<::bytes::Bytes>,
1979
1980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1981}
1982
1983impl TpmAttestation {
1984    /// Creates a new default instance.
1985    pub fn new() -> Self {
1986        std::default::Default::default()
1987    }
1988
1989    /// Sets the value of [quotes][crate::model::TpmAttestation::quotes].
1990    ///
1991    /// # Example
1992    /// ```ignore,no_run
1993    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
1994    /// use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
1995    /// let x = TpmAttestation::new()
1996    ///     .set_quotes([
1997    ///         Quote::default()/* use setters */,
1998    ///         Quote::default()/* use (different) setters */,
1999    ///     ]);
2000    /// ```
2001    pub fn set_quotes<T, V>(mut self, v: T) -> Self
2002    where
2003        T: std::iter::IntoIterator<Item = V>,
2004        V: std::convert::Into<crate::model::tpm_attestation::Quote>,
2005    {
2006        use std::iter::Iterator;
2007        self.quotes = v.into_iter().map(|i| i.into()).collect();
2008        self
2009    }
2010
2011    /// Sets the value of [tcg_event_log][crate::model::TpmAttestation::tcg_event_log].
2012    ///
2013    /// # Example
2014    /// ```ignore,no_run
2015    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2016    /// let x = TpmAttestation::new().set_tcg_event_log(bytes::Bytes::from_static(b"example"));
2017    /// ```
2018    pub fn set_tcg_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2019        self.tcg_event_log = v.into();
2020        self
2021    }
2022
2023    /// Sets the value of [canonical_event_log][crate::model::TpmAttestation::canonical_event_log].
2024    ///
2025    /// # Example
2026    /// ```ignore,no_run
2027    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2028    /// let x = TpmAttestation::new().set_canonical_event_log(bytes::Bytes::from_static(b"example"));
2029    /// ```
2030    pub fn set_canonical_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2031        self.canonical_event_log = v.into();
2032        self
2033    }
2034
2035    /// Sets the value of [ak_cert][crate::model::TpmAttestation::ak_cert].
2036    ///
2037    /// # Example
2038    /// ```ignore,no_run
2039    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2040    /// let x = TpmAttestation::new().set_ak_cert(bytes::Bytes::from_static(b"example"));
2041    /// ```
2042    pub fn set_ak_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2043        self.ak_cert = v.into();
2044        self
2045    }
2046
2047    /// Sets the value of [cert_chain][crate::model::TpmAttestation::cert_chain].
2048    ///
2049    /// # Example
2050    /// ```ignore,no_run
2051    /// # use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2052    /// let b1 = bytes::Bytes::from_static(b"abc");
2053    /// let b2 = bytes::Bytes::from_static(b"xyz");
2054    /// let x = TpmAttestation::new().set_cert_chain([b1, b2]);
2055    /// ```
2056    pub fn set_cert_chain<T, V>(mut self, v: T) -> Self
2057    where
2058        T: std::iter::IntoIterator<Item = V>,
2059        V: std::convert::Into<::bytes::Bytes>,
2060    {
2061        use std::iter::Iterator;
2062        self.cert_chain = v.into_iter().map(|i| i.into()).collect();
2063        self
2064    }
2065}
2066
2067impl wkt::message::Message for TpmAttestation {
2068    fn typename() -> &'static str {
2069        "type.googleapis.com/google.cloud.confidentialcomputing.v1.TpmAttestation"
2070    }
2071}
2072
2073/// Defines additional types related to [TpmAttestation].
2074pub mod tpm_attestation {
2075    #[allow(unused_imports)]
2076    use super::*;
2077
2078    /// Information about Platform Control Registers (PCRs) including a signature
2079    /// over their values, which can be used for remote validation.
2080    #[derive(Clone, Default, PartialEq)]
2081    #[non_exhaustive]
2082    pub struct Quote {
2083        /// The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
2084        pub hash_algo: i32,
2085
2086        /// Raw binary values of each PCRs being quoted.
2087        pub pcr_values: std::collections::HashMap<i32, ::bytes::Bytes>,
2088
2089        /// TPM2 quote, encoded as a TPMS_ATTEST
2090        pub raw_quote: ::bytes::Bytes,
2091
2092        /// TPM2 signature, encoded as a TPMT_SIGNATURE
2093        pub raw_signature: ::bytes::Bytes,
2094
2095        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2096    }
2097
2098    impl Quote {
2099        /// Creates a new default instance.
2100        pub fn new() -> Self {
2101            std::default::Default::default()
2102        }
2103
2104        /// Sets the value of [hash_algo][crate::model::tpm_attestation::Quote::hash_algo].
2105        ///
2106        /// # Example
2107        /// ```ignore,no_run
2108        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
2109        /// let x = Quote::new().set_hash_algo(42);
2110        /// ```
2111        pub fn set_hash_algo<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2112            self.hash_algo = v.into();
2113            self
2114        }
2115
2116        /// Sets the value of [pcr_values][crate::model::tpm_attestation::Quote::pcr_values].
2117        ///
2118        /// # Example
2119        /// ```ignore,no_run
2120        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
2121        /// let x = Quote::new().set_pcr_values([
2122        ///     (0, bytes::Bytes::from_static(b"abc")),
2123        ///     (1, bytes::Bytes::from_static(b"xyz")),
2124        /// ]);
2125        /// ```
2126        pub fn set_pcr_values<T, K, V>(mut self, v: T) -> Self
2127        where
2128            T: std::iter::IntoIterator<Item = (K, V)>,
2129            K: std::convert::Into<i32>,
2130            V: std::convert::Into<::bytes::Bytes>,
2131        {
2132            use std::iter::Iterator;
2133            self.pcr_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2134            self
2135        }
2136
2137        /// Sets the value of [raw_quote][crate::model::tpm_attestation::Quote::raw_quote].
2138        ///
2139        /// # Example
2140        /// ```ignore,no_run
2141        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
2142        /// let x = Quote::new().set_raw_quote(bytes::Bytes::from_static(b"example"));
2143        /// ```
2144        pub fn set_raw_quote<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2145            self.raw_quote = v.into();
2146            self
2147        }
2148
2149        /// Sets the value of [raw_signature][crate::model::tpm_attestation::Quote::raw_signature].
2150        ///
2151        /// # Example
2152        /// ```ignore,no_run
2153        /// # use google_cloud_confidentialcomputing_v1::model::tpm_attestation::Quote;
2154        /// let x = Quote::new().set_raw_signature(bytes::Bytes::from_static(b"example"));
2155        /// ```
2156        pub fn set_raw_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2157            self.raw_signature = v.into();
2158            self
2159        }
2160    }
2161
2162    impl wkt::message::Message for Quote {
2163        fn typename() -> &'static str {
2164            "type.googleapis.com/google.cloud.confidentialcomputing.v1.TpmAttestation.Quote"
2165        }
2166    }
2167}
2168
2169/// ConfidentialSpaceInfo contains information related to the Confidential Space
2170/// TEE.
2171#[derive(Clone, Default, PartialEq)]
2172#[non_exhaustive]
2173pub struct ConfidentialSpaceInfo {
2174    /// Optional. A list of signed entities containing container image signatures
2175    /// that can be used for server-side signature verification.
2176    pub signed_entities: std::vec::Vec<crate::model::SignedEntity>,
2177
2178    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2179}
2180
2181impl ConfidentialSpaceInfo {
2182    /// Creates a new default instance.
2183    pub fn new() -> Self {
2184        std::default::Default::default()
2185    }
2186
2187    /// Sets the value of [signed_entities][crate::model::ConfidentialSpaceInfo::signed_entities].
2188    ///
2189    /// # Example
2190    /// ```ignore,no_run
2191    /// # use google_cloud_confidentialcomputing_v1::model::ConfidentialSpaceInfo;
2192    /// use google_cloud_confidentialcomputing_v1::model::SignedEntity;
2193    /// let x = ConfidentialSpaceInfo::new()
2194    ///     .set_signed_entities([
2195    ///         SignedEntity::default()/* use setters */,
2196    ///         SignedEntity::default()/* use (different) setters */,
2197    ///     ]);
2198    /// ```
2199    pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
2200    where
2201        T: std::iter::IntoIterator<Item = V>,
2202        V: std::convert::Into<crate::model::SignedEntity>,
2203    {
2204        use std::iter::Iterator;
2205        self.signed_entities = v.into_iter().map(|i| i.into()).collect();
2206        self
2207    }
2208}
2209
2210impl wkt::message::Message for ConfidentialSpaceInfo {
2211    fn typename() -> &'static str {
2212        "type.googleapis.com/google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo"
2213    }
2214}
2215
2216/// SignedEntity represents an OCI image object containing everything necessary
2217/// to verify container image signatures.
2218#[derive(Clone, Default, PartialEq)]
2219#[non_exhaustive]
2220pub struct SignedEntity {
2221    /// Optional. A list of container image signatures attached to an OCI image
2222    /// object.
2223    pub container_image_signatures: std::vec::Vec<crate::model::ContainerImageSignature>,
2224
2225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2226}
2227
2228impl SignedEntity {
2229    /// Creates a new default instance.
2230    pub fn new() -> Self {
2231        std::default::Default::default()
2232    }
2233
2234    /// Sets the value of [container_image_signatures][crate::model::SignedEntity::container_image_signatures].
2235    ///
2236    /// # Example
2237    /// ```ignore,no_run
2238    /// # use google_cloud_confidentialcomputing_v1::model::SignedEntity;
2239    /// use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
2240    /// let x = SignedEntity::new()
2241    ///     .set_container_image_signatures([
2242    ///         ContainerImageSignature::default()/* use setters */,
2243    ///         ContainerImageSignature::default()/* use (different) setters */,
2244    ///     ]);
2245    /// ```
2246    pub fn set_container_image_signatures<T, V>(mut self, v: T) -> Self
2247    where
2248        T: std::iter::IntoIterator<Item = V>,
2249        V: std::convert::Into<crate::model::ContainerImageSignature>,
2250    {
2251        use std::iter::Iterator;
2252        self.container_image_signatures = v.into_iter().map(|i| i.into()).collect();
2253        self
2254    }
2255}
2256
2257impl wkt::message::Message for SignedEntity {
2258    fn typename() -> &'static str {
2259        "type.googleapis.com/google.cloud.confidentialcomputing.v1.SignedEntity"
2260    }
2261}
2262
2263/// ContainerImageSignature holds necessary metadata to verify a container image
2264/// signature.
2265#[derive(Clone, Default, PartialEq)]
2266#[non_exhaustive]
2267pub struct ContainerImageSignature {
2268    /// Optional. The binary signature payload following the SimpleSigning format
2269    /// <https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing>.
2270    /// This payload includes the container image digest.
2271    pub payload: ::bytes::Bytes,
2272
2273    /// Optional. A signature over the payload.
2274    /// The container image digest is incorporated into the signature as follows:
2275    ///
2276    /// 1. Generate a SimpleSigning format payload that includes the container
2277    ///    image digest.
2278    /// 1. Generate a signature over SHA256 digest of the payload.
2279    ///    The signature generation process can be represented as follows:
2280    ///    `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
2281    pub signature: ::bytes::Bytes,
2282
2283    /// Optional. Reserved for future use.
2284    pub public_key: ::bytes::Bytes,
2285
2286    /// Optional. Reserved for future use.
2287    pub sig_alg: crate::model::SigningAlgorithm,
2288
2289    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2290}
2291
2292impl ContainerImageSignature {
2293    /// Creates a new default instance.
2294    pub fn new() -> Self {
2295        std::default::Default::default()
2296    }
2297
2298    /// Sets the value of [payload][crate::model::ContainerImageSignature::payload].
2299    ///
2300    /// # Example
2301    /// ```ignore,no_run
2302    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
2303    /// let x = ContainerImageSignature::new().set_payload(bytes::Bytes::from_static(b"example"));
2304    /// ```
2305    pub fn set_payload<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2306        self.payload = v.into();
2307        self
2308    }
2309
2310    /// Sets the value of [signature][crate::model::ContainerImageSignature::signature].
2311    ///
2312    /// # Example
2313    /// ```ignore,no_run
2314    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
2315    /// let x = ContainerImageSignature::new().set_signature(bytes::Bytes::from_static(b"example"));
2316    /// ```
2317    pub fn set_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2318        self.signature = v.into();
2319        self
2320    }
2321
2322    /// Sets the value of [public_key][crate::model::ContainerImageSignature::public_key].
2323    ///
2324    /// # Example
2325    /// ```ignore,no_run
2326    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
2327    /// let x = ContainerImageSignature::new().set_public_key(bytes::Bytes::from_static(b"example"));
2328    /// ```
2329    pub fn set_public_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2330        self.public_key = v.into();
2331        self
2332    }
2333
2334    /// Sets the value of [sig_alg][crate::model::ContainerImageSignature::sig_alg].
2335    ///
2336    /// # Example
2337    /// ```ignore,no_run
2338    /// # use google_cloud_confidentialcomputing_v1::model::ContainerImageSignature;
2339    /// use google_cloud_confidentialcomputing_v1::model::SigningAlgorithm;
2340    /// let x0 = ContainerImageSignature::new().set_sig_alg(SigningAlgorithm::RsassaPssSha256);
2341    /// let x1 = ContainerImageSignature::new().set_sig_alg(SigningAlgorithm::RsassaPkcs1V15Sha256);
2342    /// let x2 = ContainerImageSignature::new().set_sig_alg(SigningAlgorithm::EcdsaP256Sha256);
2343    /// ```
2344    pub fn set_sig_alg<T: std::convert::Into<crate::model::SigningAlgorithm>>(
2345        mut self,
2346        v: T,
2347    ) -> Self {
2348        self.sig_alg = v.into();
2349        self
2350    }
2351}
2352
2353impl wkt::message::Message for ContainerImageSignature {
2354    fn typename() -> &'static str {
2355        "type.googleapis.com/google.cloud.confidentialcomputing.v1.ContainerImageSignature"
2356    }
2357}
2358
2359/// A request for an attestation token, providing all the necessary information
2360/// needed for this service to verify the platform state of the requestor.
2361#[derive(Clone, Default, PartialEq)]
2362#[non_exhaustive]
2363pub struct VerifyConfidentialSpaceRequest {
2364    /// Required. The name of the Challenge whose nonce was used to generate the
2365    /// attestation, in the format `projects/*/locations/*/challenges/*`. The
2366    /// provided Challenge will be consumed, and cannot be used again.
2367    pub challenge: std::string::String,
2368
2369    /// Optional. Credentials used to populate the "emails" claim in the
2370    /// claims_token. If not present, token will not contain the "emails" claim.
2371    pub gcp_credentials: std::option::Option<crate::model::GcpCredentials>,
2372
2373    /// Optional. A list of signed entities containing container image signatures
2374    /// that can be used for server-side signature verification.
2375    pub signed_entities: std::vec::Vec<crate::model::SignedEntity>,
2376
2377    /// Optional. Information about the associated Compute Engine instance.
2378    /// Required for td_ccel requests only - tpm_attestation requests will provide
2379    /// this information in the attestation.
2380    pub gce_shielded_identity: std::option::Option<crate::model::GceShieldedIdentity>,
2381
2382    /// Optional. A collection of fields that modify the token output.
2383    pub options: std::option::Option<
2384        crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
2385    >,
2386
2387    /// Optional. An optional Nvidia attestation report, used to populate hardware
2388    /// rooted claims for Nvidia devices.
2389    pub nvidia_attestation: std::option::Option<crate::model::NvidiaAttestation>,
2390
2391    /// Required. A tee attestation report, used to populate hardware rooted
2392    /// claims.
2393    pub tee_attestation:
2394        std::option::Option<crate::model::verify_confidential_space_request::TeeAttestation>,
2395
2396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2397}
2398
2399impl VerifyConfidentialSpaceRequest {
2400    /// Creates a new default instance.
2401    pub fn new() -> Self {
2402        std::default::Default::default()
2403    }
2404
2405    /// Sets the value of [challenge][crate::model::VerifyConfidentialSpaceRequest::challenge].
2406    ///
2407    /// # Example
2408    /// ```ignore,no_run
2409    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2410    /// # let project_id = "project_id";
2411    /// # let location_id = "location_id";
2412    /// # let uuid_id = "uuid_id";
2413    /// let x = VerifyConfidentialSpaceRequest::new().set_challenge(format!("projects/{project_id}/locations/{location_id}/challenges/{uuid_id}"));
2414    /// ```
2415    pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2416        self.challenge = v.into();
2417        self
2418    }
2419
2420    /// Sets the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
2421    ///
2422    /// # Example
2423    /// ```ignore,no_run
2424    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2425    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
2426    /// let x = VerifyConfidentialSpaceRequest::new().set_gcp_credentials(GcpCredentials::default()/* use setters */);
2427    /// ```
2428    pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
2429    where
2430        T: std::convert::Into<crate::model::GcpCredentials>,
2431    {
2432        self.gcp_credentials = std::option::Option::Some(v.into());
2433        self
2434    }
2435
2436    /// Sets or clears the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
2437    ///
2438    /// # Example
2439    /// ```ignore,no_run
2440    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2441    /// use google_cloud_confidentialcomputing_v1::model::GcpCredentials;
2442    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gcp_credentials(Some(GcpCredentials::default()/* use setters */));
2443    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gcp_credentials(None::<GcpCredentials>);
2444    /// ```
2445    pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
2446    where
2447        T: std::convert::Into<crate::model::GcpCredentials>,
2448    {
2449        self.gcp_credentials = v.map(|x| x.into());
2450        self
2451    }
2452
2453    /// Sets the value of [signed_entities][crate::model::VerifyConfidentialSpaceRequest::signed_entities].
2454    ///
2455    /// # Example
2456    /// ```ignore,no_run
2457    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2458    /// use google_cloud_confidentialcomputing_v1::model::SignedEntity;
2459    /// let x = VerifyConfidentialSpaceRequest::new()
2460    ///     .set_signed_entities([
2461    ///         SignedEntity::default()/* use setters */,
2462    ///         SignedEntity::default()/* use (different) setters */,
2463    ///     ]);
2464    /// ```
2465    pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
2466    where
2467        T: std::iter::IntoIterator<Item = V>,
2468        V: std::convert::Into<crate::model::SignedEntity>,
2469    {
2470        use std::iter::Iterator;
2471        self.signed_entities = v.into_iter().map(|i| i.into()).collect();
2472        self
2473    }
2474
2475    /// Sets the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
2476    ///
2477    /// # Example
2478    /// ```ignore,no_run
2479    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2480    /// use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
2481    /// let x = VerifyConfidentialSpaceRequest::new().set_gce_shielded_identity(GceShieldedIdentity::default()/* use setters */);
2482    /// ```
2483    pub fn set_gce_shielded_identity<T>(mut self, v: T) -> Self
2484    where
2485        T: std::convert::Into<crate::model::GceShieldedIdentity>,
2486    {
2487        self.gce_shielded_identity = std::option::Option::Some(v.into());
2488        self
2489    }
2490
2491    /// Sets or clears the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
2492    ///
2493    /// # Example
2494    /// ```ignore,no_run
2495    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2496    /// use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
2497    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gce_shielded_identity(Some(GceShieldedIdentity::default()/* use setters */));
2498    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_gce_shielded_identity(None::<GceShieldedIdentity>);
2499    /// ```
2500    pub fn set_or_clear_gce_shielded_identity<T>(mut self, v: std::option::Option<T>) -> Self
2501    where
2502        T: std::convert::Into<crate::model::GceShieldedIdentity>,
2503    {
2504        self.gce_shielded_identity = v.map(|x| x.into());
2505        self
2506    }
2507
2508    /// Sets the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
2509    ///
2510    /// # Example
2511    /// ```ignore,no_run
2512    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2513    /// use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2514    /// let x = VerifyConfidentialSpaceRequest::new().set_options(ConfidentialSpaceOptions::default()/* use setters */);
2515    /// ```
2516    pub fn set_options<T>(mut self, v: T) -> Self
2517    where
2518        T: std::convert::Into<
2519                crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
2520            >,
2521    {
2522        self.options = std::option::Option::Some(v.into());
2523        self
2524    }
2525
2526    /// Sets or clears the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
2527    ///
2528    /// # Example
2529    /// ```ignore,no_run
2530    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2531    /// use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2532    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_options(Some(ConfidentialSpaceOptions::default()/* use setters */));
2533    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_options(None::<ConfidentialSpaceOptions>);
2534    /// ```
2535    pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2536    where
2537        T: std::convert::Into<
2538                crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
2539            >,
2540    {
2541        self.options = v.map(|x| x.into());
2542        self
2543    }
2544
2545    /// Sets the value of [nvidia_attestation][crate::model::VerifyConfidentialSpaceRequest::nvidia_attestation].
2546    ///
2547    /// # Example
2548    /// ```ignore,no_run
2549    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2550    /// use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
2551    /// let x = VerifyConfidentialSpaceRequest::new().set_nvidia_attestation(NvidiaAttestation::default()/* use setters */);
2552    /// ```
2553    pub fn set_nvidia_attestation<T>(mut self, v: T) -> Self
2554    where
2555        T: std::convert::Into<crate::model::NvidiaAttestation>,
2556    {
2557        self.nvidia_attestation = std::option::Option::Some(v.into());
2558        self
2559    }
2560
2561    /// Sets or clears the value of [nvidia_attestation][crate::model::VerifyConfidentialSpaceRequest::nvidia_attestation].
2562    ///
2563    /// # Example
2564    /// ```ignore,no_run
2565    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2566    /// use google_cloud_confidentialcomputing_v1::model::NvidiaAttestation;
2567    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_nvidia_attestation(Some(NvidiaAttestation::default()/* use setters */));
2568    /// let x = VerifyConfidentialSpaceRequest::new().set_or_clear_nvidia_attestation(None::<NvidiaAttestation>);
2569    /// ```
2570    pub fn set_or_clear_nvidia_attestation<T>(mut self, v: std::option::Option<T>) -> Self
2571    where
2572        T: std::convert::Into<crate::model::NvidiaAttestation>,
2573    {
2574        self.nvidia_attestation = v.map(|x| x.into());
2575        self
2576    }
2577
2578    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation].
2579    ///
2580    /// Note that all the setters affecting `tee_attestation` are mutually
2581    /// exclusive.
2582    ///
2583    /// # Example
2584    /// ```ignore,no_run
2585    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2586    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
2587    /// let x = VerifyConfidentialSpaceRequest::new().set_tee_attestation(Some(
2588    ///     google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::TeeAttestation::TdCcel(TdxCcelAttestation::default().into())));
2589    /// ```
2590    pub fn set_tee_attestation<
2591        T: std::convert::Into<
2592                std::option::Option<
2593                    crate::model::verify_confidential_space_request::TeeAttestation,
2594                >,
2595            >,
2596    >(
2597        mut self,
2598        v: T,
2599    ) -> Self {
2600        self.tee_attestation = v.into();
2601        self
2602    }
2603
2604    /// The value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
2605    /// if it holds a `TdCcel`, `None` if the field is not set or
2606    /// holds a different branch.
2607    pub fn td_ccel(
2608        &self,
2609    ) -> std::option::Option<&std::boxed::Box<crate::model::TdxCcelAttestation>> {
2610        #[allow(unreachable_patterns)]
2611        self.tee_attestation.as_ref().and_then(|v| match v {
2612            crate::model::verify_confidential_space_request::TeeAttestation::TdCcel(v) => {
2613                std::option::Option::Some(v)
2614            }
2615            _ => std::option::Option::None,
2616        })
2617    }
2618
2619    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
2620    /// to hold a `TdCcel`.
2621    ///
2622    /// Note that all the setters affecting `tee_attestation` are
2623    /// mutually exclusive.
2624    ///
2625    /// # Example
2626    /// ```ignore,no_run
2627    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2628    /// use google_cloud_confidentialcomputing_v1::model::TdxCcelAttestation;
2629    /// let x = VerifyConfidentialSpaceRequest::new().set_td_ccel(TdxCcelAttestation::default()/* use setters */);
2630    /// assert!(x.td_ccel().is_some());
2631    /// assert!(x.tpm_attestation().is_none());
2632    /// ```
2633    pub fn set_td_ccel<T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>>(
2634        mut self,
2635        v: T,
2636    ) -> Self {
2637        self.tee_attestation = std::option::Option::Some(
2638            crate::model::verify_confidential_space_request::TeeAttestation::TdCcel(v.into()),
2639        );
2640        self
2641    }
2642
2643    /// The value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
2644    /// if it holds a `TpmAttestation`, `None` if the field is not set or
2645    /// holds a different branch.
2646    pub fn tpm_attestation(
2647        &self,
2648    ) -> std::option::Option<&std::boxed::Box<crate::model::TpmAttestation>> {
2649        #[allow(unreachable_patterns)]
2650        self.tee_attestation.as_ref().and_then(|v| match v {
2651            crate::model::verify_confidential_space_request::TeeAttestation::TpmAttestation(v) => {
2652                std::option::Option::Some(v)
2653            }
2654            _ => std::option::Option::None,
2655        })
2656    }
2657
2658    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
2659    /// to hold a `TpmAttestation`.
2660    ///
2661    /// Note that all the setters affecting `tee_attestation` are
2662    /// mutually exclusive.
2663    ///
2664    /// # Example
2665    /// ```ignore,no_run
2666    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceRequest;
2667    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
2668    /// let x = VerifyConfidentialSpaceRequest::new().set_tpm_attestation(TpmAttestation::default()/* use setters */);
2669    /// assert!(x.tpm_attestation().is_some());
2670    /// assert!(x.td_ccel().is_none());
2671    /// ```
2672    pub fn set_tpm_attestation<
2673        T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
2674    >(
2675        mut self,
2676        v: T,
2677    ) -> Self {
2678        self.tee_attestation = std::option::Option::Some(
2679            crate::model::verify_confidential_space_request::TeeAttestation::TpmAttestation(
2680                v.into(),
2681            ),
2682        );
2683        self
2684    }
2685}
2686
2687impl wkt::message::Message for VerifyConfidentialSpaceRequest {
2688    fn typename() -> &'static str {
2689        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest"
2690    }
2691}
2692
2693/// Defines additional types related to [VerifyConfidentialSpaceRequest].
2694pub mod verify_confidential_space_request {
2695    #[allow(unused_imports)]
2696    use super::*;
2697
2698    /// Token options for Confidential Space attestation.
2699    #[derive(Clone, Default, PartialEq)]
2700    #[non_exhaustive]
2701    pub struct ConfidentialSpaceOptions {
2702
2703        /// Optional. Optional string to issue the token with a custom audience
2704        /// claim. Required if custom nonces are specified.
2705        pub audience: std::string::String,
2706
2707        /// Optional. Optional specification for token claims profile.
2708        pub token_profile: crate::model::TokenProfile,
2709
2710        /// Optional. Optional parameter to place one or more nonces in the eat_nonce
2711        /// claim in the output token. The minimum size for JSON-encoded EATs is 10
2712        /// bytes and the maximum size is 74 bytes.
2713        pub nonce: std::vec::Vec<std::string::String>,
2714
2715        /// Optional. Optional specification for how to sign the attestation token.
2716        /// Defaults to SIGNATURE_TYPE_OIDC if unspecified.
2717        pub signature_type: crate::model::SignatureType,
2718
2719        /// An optional additional configuration per token type.
2720        pub token_profile_options: std::option::Option<crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions>,
2721
2722        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2723    }
2724
2725    impl ConfidentialSpaceOptions {
2726        /// Creates a new default instance.
2727        pub fn new() -> Self {
2728            std::default::Default::default()
2729        }
2730
2731        /// Sets the value of [audience][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::audience].
2732        ///
2733        /// # Example
2734        /// ```ignore,no_run
2735        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2736        /// let x = ConfidentialSpaceOptions::new().set_audience("example");
2737        /// ```
2738        pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2739            self.audience = v.into();
2740            self
2741        }
2742
2743        /// Sets the value of [token_profile][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile].
2744        ///
2745        /// # Example
2746        /// ```ignore,no_run
2747        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2748        /// use google_cloud_confidentialcomputing_v1::model::TokenProfile;
2749        /// let x0 = ConfidentialSpaceOptions::new().set_token_profile(TokenProfile::DefaultEat);
2750        /// let x1 = ConfidentialSpaceOptions::new().set_token_profile(TokenProfile::Aws);
2751        /// ```
2752        pub fn set_token_profile<T: std::convert::Into<crate::model::TokenProfile>>(
2753            mut self,
2754            v: T,
2755        ) -> Self {
2756            self.token_profile = v.into();
2757            self
2758        }
2759
2760        /// Sets the value of [nonce][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::nonce].
2761        ///
2762        /// # Example
2763        /// ```ignore,no_run
2764        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2765        /// let x = ConfidentialSpaceOptions::new().set_nonce(["a", "b", "c"]);
2766        /// ```
2767        pub fn set_nonce<T, V>(mut self, v: T) -> Self
2768        where
2769            T: std::iter::IntoIterator<Item = V>,
2770            V: std::convert::Into<std::string::String>,
2771        {
2772            use std::iter::Iterator;
2773            self.nonce = v.into_iter().map(|i| i.into()).collect();
2774            self
2775        }
2776
2777        /// Sets the value of [signature_type][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::signature_type].
2778        ///
2779        /// # Example
2780        /// ```ignore,no_run
2781        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2782        /// use google_cloud_confidentialcomputing_v1::model::SignatureType;
2783        /// let x0 = ConfidentialSpaceOptions::new().set_signature_type(SignatureType::Oidc);
2784        /// let x1 = ConfidentialSpaceOptions::new().set_signature_type(SignatureType::Pki);
2785        /// ```
2786        pub fn set_signature_type<T: std::convert::Into<crate::model::SignatureType>>(
2787            mut self,
2788            v: T,
2789        ) -> Self {
2790            self.signature_type = v.into();
2791            self
2792        }
2793
2794        /// Sets the value of [token_profile_options][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile_options].
2795        ///
2796        /// Note that all the setters affecting `token_profile_options` are mutually
2797        /// exclusive.
2798        ///
2799        /// # Example
2800        /// ```ignore,no_run
2801        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2802        /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
2803        /// let x = ConfidentialSpaceOptions::new().set_token_profile_options(Some(
2804        ///     google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(AwsPrincipalTagsOptions::default().into())));
2805        /// ```
2806        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
2807        {
2808            self.token_profile_options = v.into();
2809            self
2810        }
2811
2812        /// The value of [token_profile_options][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile_options]
2813        /// if it holds a `AwsPrincipalTagsOptions`, `None` if the field is not set or
2814        /// holds a different branch.
2815        pub fn aws_principal_tags_options(
2816            &self,
2817        ) -> std::option::Option<&std::boxed::Box<crate::model::AwsPrincipalTagsOptions>> {
2818            #[allow(unreachable_patterns)]
2819            self.token_profile_options.as_ref().and_then(|v| match v {
2820                crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(v) => std::option::Option::Some(v),
2821                _ => std::option::Option::None,
2822            })
2823        }
2824
2825        /// Sets the value of [token_profile_options][crate::model::verify_confidential_space_request::ConfidentialSpaceOptions::token_profile_options]
2826        /// to hold a `AwsPrincipalTagsOptions`.
2827        ///
2828        /// Note that all the setters affecting `token_profile_options` are
2829        /// mutually exclusive.
2830        ///
2831        /// # Example
2832        /// ```ignore,no_run
2833        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_space_request::ConfidentialSpaceOptions;
2834        /// use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
2835        /// let x = ConfidentialSpaceOptions::new().set_aws_principal_tags_options(AwsPrincipalTagsOptions::default()/* use setters */);
2836        /// assert!(x.aws_principal_tags_options().is_some());
2837        /// ```
2838        pub fn set_aws_principal_tags_options<
2839            T: std::convert::Into<std::boxed::Box<crate::model::AwsPrincipalTagsOptions>>,
2840        >(
2841            mut self,
2842            v: T,
2843        ) -> Self {
2844            self.token_profile_options = std::option::Option::Some(
2845                crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(
2846                    v.into()
2847                )
2848            );
2849            self
2850        }
2851    }
2852
2853    impl wkt::message::Message for ConfidentialSpaceOptions {
2854        fn typename() -> &'static str {
2855            "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest.ConfidentialSpaceOptions"
2856        }
2857    }
2858
2859    /// Defines additional types related to [ConfidentialSpaceOptions].
2860    pub mod confidential_space_options {
2861        #[allow(unused_imports)]
2862        use super::*;
2863
2864        /// An optional additional configuration per token type.
2865        #[derive(Clone, Debug, PartialEq)]
2866        #[non_exhaustive]
2867        pub enum TokenProfileOptions {
2868            /// Optional. Options for the AWS token type.
2869            AwsPrincipalTagsOptions(std::boxed::Box<crate::model::AwsPrincipalTagsOptions>),
2870        }
2871    }
2872
2873    /// Required. A tee attestation report, used to populate hardware rooted
2874    /// claims.
2875    #[derive(Clone, Debug, PartialEq)]
2876    #[non_exhaustive]
2877    pub enum TeeAttestation {
2878        /// Input only. A TDX with CCEL and RTMR Attestation Quote.
2879        TdCcel(std::boxed::Box<crate::model::TdxCcelAttestation>),
2880        /// Input only. The TPM-specific data provided by the attesting platform,
2881        /// used to populate any of the claims regarding platform state.
2882        TpmAttestation(std::boxed::Box<crate::model::TpmAttestation>),
2883    }
2884}
2885
2886/// GceShieldedIdentity contains information about a Compute Engine instance.
2887#[derive(Clone, Default, PartialEq)]
2888#[non_exhaustive]
2889pub struct GceShieldedIdentity {
2890    /// Optional. DER-encoded X.509 certificate of the Attestation Key (otherwise
2891    /// known as an AK or a TPM restricted signing key) used to generate the
2892    /// quotes.
2893    pub ak_cert: ::bytes::Bytes,
2894
2895    /// Optional. List of DER-encoded X.509 certificates which, together with the
2896    /// ak_cert, chain back to a trusted Root Certificate.
2897    pub ak_cert_chain: std::vec::Vec<::bytes::Bytes>,
2898
2899    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2900}
2901
2902impl GceShieldedIdentity {
2903    /// Creates a new default instance.
2904    pub fn new() -> Self {
2905        std::default::Default::default()
2906    }
2907
2908    /// Sets the value of [ak_cert][crate::model::GceShieldedIdentity::ak_cert].
2909    ///
2910    /// # Example
2911    /// ```ignore,no_run
2912    /// # use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
2913    /// let x = GceShieldedIdentity::new().set_ak_cert(bytes::Bytes::from_static(b"example"));
2914    /// ```
2915    pub fn set_ak_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2916        self.ak_cert = v.into();
2917        self
2918    }
2919
2920    /// Sets the value of [ak_cert_chain][crate::model::GceShieldedIdentity::ak_cert_chain].
2921    ///
2922    /// # Example
2923    /// ```ignore,no_run
2924    /// # use google_cloud_confidentialcomputing_v1::model::GceShieldedIdentity;
2925    /// let b1 = bytes::Bytes::from_static(b"abc");
2926    /// let b2 = bytes::Bytes::from_static(b"xyz");
2927    /// let x = GceShieldedIdentity::new().set_ak_cert_chain([b1, b2]);
2928    /// ```
2929    pub fn set_ak_cert_chain<T, V>(mut self, v: T) -> Self
2930    where
2931        T: std::iter::IntoIterator<Item = V>,
2932        V: std::convert::Into<::bytes::Bytes>,
2933    {
2934        use std::iter::Iterator;
2935        self.ak_cert_chain = v.into_iter().map(|i| i.into()).collect();
2936        self
2937    }
2938}
2939
2940impl wkt::message::Message for GceShieldedIdentity {
2941    fn typename() -> &'static str {
2942        "type.googleapis.com/google.cloud.confidentialcomputing.v1.GceShieldedIdentity"
2943    }
2944}
2945
2946/// VerifyConfidentialSpaceResponse is returned once a Confidential Space
2947/// attestation has been successfully verified, containing a signed token.
2948#[derive(Clone, Default, PartialEq)]
2949#[non_exhaustive]
2950pub struct VerifyConfidentialSpaceResponse {
2951    /// Output only. The attestation token issued by this service. It contains
2952    /// specific platform claims based on the contents of the provided attestation.
2953    pub attestation_token: std::string::String,
2954
2955    /// Output only. A list of messages that carry the partial error details
2956    /// related to VerifyConfidentialSpace. This field is populated by errors
2957    /// during container image signature verification, which may reflect problems
2958    /// in the provided image signatures. This does not block the issuing of an
2959    /// attestation token, but the token will not contain claims for the failed
2960    /// image signatures.
2961    pub partial_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
2962
2963    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2964}
2965
2966impl VerifyConfidentialSpaceResponse {
2967    /// Creates a new default instance.
2968    pub fn new() -> Self {
2969        std::default::Default::default()
2970    }
2971
2972    /// Sets the value of [attestation_token][crate::model::VerifyConfidentialSpaceResponse::attestation_token].
2973    ///
2974    /// # Example
2975    /// ```ignore,no_run
2976    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceResponse;
2977    /// let x = VerifyConfidentialSpaceResponse::new().set_attestation_token("example");
2978    /// ```
2979    pub fn set_attestation_token<T: std::convert::Into<std::string::String>>(
2980        mut self,
2981        v: T,
2982    ) -> Self {
2983        self.attestation_token = v.into();
2984        self
2985    }
2986
2987    /// Sets the value of [partial_errors][crate::model::VerifyConfidentialSpaceResponse::partial_errors].
2988    ///
2989    /// # Example
2990    /// ```ignore,no_run
2991    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialSpaceResponse;
2992    /// use google_cloud_rpc::model::Status;
2993    /// let x = VerifyConfidentialSpaceResponse::new()
2994    ///     .set_partial_errors([
2995    ///         Status::default()/* use setters */,
2996    ///         Status::default()/* use (different) setters */,
2997    ///     ]);
2998    /// ```
2999    pub fn set_partial_errors<T, V>(mut self, v: T) -> Self
3000    where
3001        T: std::iter::IntoIterator<Item = V>,
3002        V: std::convert::Into<google_cloud_rpc::model::Status>,
3003    {
3004        use std::iter::Iterator;
3005        self.partial_errors = v.into_iter().map(|i| i.into()).collect();
3006        self
3007    }
3008}
3009
3010impl wkt::message::Message for VerifyConfidentialSpaceResponse {
3011    fn typename() -> &'static str {
3012        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceResponse"
3013    }
3014}
3015
3016/// A request for an attestation token, providing all the necessary information
3017/// needed for this service to verify Confidential GKE platform state of the
3018/// requestor.
3019#[derive(Clone, Default, PartialEq)]
3020#[non_exhaustive]
3021pub struct VerifyConfidentialGkeRequest {
3022    /// Required. The name of the Challenge whose nonce was used to generate the
3023    /// attestation, in the format projects/*/locations/*/challenges/*. The
3024    /// provided Challenge will be consumed, and cannot be used again.
3025    pub challenge: std::string::String,
3026
3027    /// Optional. A collection of fields that modify the token output.
3028    pub options:
3029        std::option::Option<crate::model::verify_confidential_gke_request::ConfidentialGkeOptions>,
3030
3031    /// Required. A tee attestation report, used to populate hardware rooted
3032    /// claims.
3033    pub tee_attestation:
3034        std::option::Option<crate::model::verify_confidential_gke_request::TeeAttestation>,
3035
3036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3037}
3038
3039impl VerifyConfidentialGkeRequest {
3040    /// Creates a new default instance.
3041    pub fn new() -> Self {
3042        std::default::Default::default()
3043    }
3044
3045    /// Sets the value of [challenge][crate::model::VerifyConfidentialGkeRequest::challenge].
3046    ///
3047    /// # Example
3048    /// ```ignore,no_run
3049    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
3050    /// # let project_id = "project_id";
3051    /// # let location_id = "location_id";
3052    /// # let uuid_id = "uuid_id";
3053    /// let x = VerifyConfidentialGkeRequest::new().set_challenge(format!("projects/{project_id}/locations/{location_id}/challenges/{uuid_id}"));
3054    /// ```
3055    pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3056        self.challenge = v.into();
3057        self
3058    }
3059
3060    /// Sets the value of [options][crate::model::VerifyConfidentialGkeRequest::options].
3061    ///
3062    /// # Example
3063    /// ```ignore,no_run
3064    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
3065    /// use google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::ConfidentialGkeOptions;
3066    /// let x = VerifyConfidentialGkeRequest::new().set_options(ConfidentialGkeOptions::default()/* use setters */);
3067    /// ```
3068    pub fn set_options<T>(mut self, v: T) -> Self
3069    where
3070        T: std::convert::Into<
3071                crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
3072            >,
3073    {
3074        self.options = std::option::Option::Some(v.into());
3075        self
3076    }
3077
3078    /// Sets or clears the value of [options][crate::model::VerifyConfidentialGkeRequest::options].
3079    ///
3080    /// # Example
3081    /// ```ignore,no_run
3082    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
3083    /// use google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::ConfidentialGkeOptions;
3084    /// let x = VerifyConfidentialGkeRequest::new().set_or_clear_options(Some(ConfidentialGkeOptions::default()/* use setters */));
3085    /// let x = VerifyConfidentialGkeRequest::new().set_or_clear_options(None::<ConfidentialGkeOptions>);
3086    /// ```
3087    pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3088    where
3089        T: std::convert::Into<
3090                crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
3091            >,
3092    {
3093        self.options = v.map(|x| x.into());
3094        self
3095    }
3096
3097    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation].
3098    ///
3099    /// Note that all the setters affecting `tee_attestation` are mutually
3100    /// exclusive.
3101    ///
3102    /// # Example
3103    /// ```ignore,no_run
3104    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
3105    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
3106    /// let x = VerifyConfidentialGkeRequest::new().set_tee_attestation(Some(
3107    ///     google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(TpmAttestation::default().into())));
3108    /// ```
3109    pub fn set_tee_attestation<
3110        T: std::convert::Into<
3111                std::option::Option<crate::model::verify_confidential_gke_request::TeeAttestation>,
3112            >,
3113    >(
3114        mut self,
3115        v: T,
3116    ) -> Self {
3117        self.tee_attestation = v.into();
3118        self
3119    }
3120
3121    /// The value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
3122    /// if it holds a `TpmAttestation`, `None` if the field is not set or
3123    /// holds a different branch.
3124    pub fn tpm_attestation(
3125        &self,
3126    ) -> std::option::Option<&std::boxed::Box<crate::model::TpmAttestation>> {
3127        #[allow(unreachable_patterns)]
3128        self.tee_attestation.as_ref().and_then(|v| match v {
3129            crate::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(v) => {
3130                std::option::Option::Some(v)
3131            }
3132            _ => std::option::Option::None,
3133        })
3134    }
3135
3136    /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
3137    /// to hold a `TpmAttestation`.
3138    ///
3139    /// Note that all the setters affecting `tee_attestation` are
3140    /// mutually exclusive.
3141    ///
3142    /// # Example
3143    /// ```ignore,no_run
3144    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeRequest;
3145    /// use google_cloud_confidentialcomputing_v1::model::TpmAttestation;
3146    /// let x = VerifyConfidentialGkeRequest::new().set_tpm_attestation(TpmAttestation::default()/* use setters */);
3147    /// assert!(x.tpm_attestation().is_some());
3148    /// ```
3149    pub fn set_tpm_attestation<
3150        T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
3151    >(
3152        mut self,
3153        v: T,
3154    ) -> Self {
3155        self.tee_attestation = std::option::Option::Some(
3156            crate::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(v.into()),
3157        );
3158        self
3159    }
3160}
3161
3162impl wkt::message::Message for VerifyConfidentialGkeRequest {
3163    fn typename() -> &'static str {
3164        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest"
3165    }
3166}
3167
3168/// Defines additional types related to [VerifyConfidentialGkeRequest].
3169pub mod verify_confidential_gke_request {
3170    #[allow(unused_imports)]
3171    use super::*;
3172
3173    /// Token options for Confidential GKE attestation.
3174    #[derive(Clone, Default, PartialEq)]
3175    #[non_exhaustive]
3176    pub struct ConfidentialGkeOptions {
3177        /// Optional. Optional string to issue the token with a custom audience
3178        /// claim. Required if custom nonces are specified.
3179        pub audience: std::string::String,
3180
3181        /// Optional. Optional parameter to place one or more nonces in the eat_nonce
3182        /// claim in the output token. The minimum size for JSON-encoded EATs is 10
3183        /// bytes and the maximum size is 74 bytes.
3184        pub nonce: std::vec::Vec<std::string::String>,
3185
3186        /// Optional. Optional specification for how to sign the attestation token.
3187        /// Defaults to SIGNATURE_TYPE_OIDC if unspecified.
3188        pub signature_type: crate::model::SignatureType,
3189
3190        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3191    }
3192
3193    impl ConfidentialGkeOptions {
3194        /// Creates a new default instance.
3195        pub fn new() -> Self {
3196            std::default::Default::default()
3197        }
3198
3199        /// Sets the value of [audience][crate::model::verify_confidential_gke_request::ConfidentialGkeOptions::audience].
3200        ///
3201        /// # Example
3202        /// ```ignore,no_run
3203        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::ConfidentialGkeOptions;
3204        /// let x = ConfidentialGkeOptions::new().set_audience("example");
3205        /// ```
3206        pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3207            self.audience = v.into();
3208            self
3209        }
3210
3211        /// Sets the value of [nonce][crate::model::verify_confidential_gke_request::ConfidentialGkeOptions::nonce].
3212        ///
3213        /// # Example
3214        /// ```ignore,no_run
3215        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::ConfidentialGkeOptions;
3216        /// let x = ConfidentialGkeOptions::new().set_nonce(["a", "b", "c"]);
3217        /// ```
3218        pub fn set_nonce<T, V>(mut self, v: T) -> Self
3219        where
3220            T: std::iter::IntoIterator<Item = V>,
3221            V: std::convert::Into<std::string::String>,
3222        {
3223            use std::iter::Iterator;
3224            self.nonce = v.into_iter().map(|i| i.into()).collect();
3225            self
3226        }
3227
3228        /// Sets the value of [signature_type][crate::model::verify_confidential_gke_request::ConfidentialGkeOptions::signature_type].
3229        ///
3230        /// # Example
3231        /// ```ignore,no_run
3232        /// # use google_cloud_confidentialcomputing_v1::model::verify_confidential_gke_request::ConfidentialGkeOptions;
3233        /// use google_cloud_confidentialcomputing_v1::model::SignatureType;
3234        /// let x0 = ConfidentialGkeOptions::new().set_signature_type(SignatureType::Oidc);
3235        /// let x1 = ConfidentialGkeOptions::new().set_signature_type(SignatureType::Pki);
3236        /// ```
3237        pub fn set_signature_type<T: std::convert::Into<crate::model::SignatureType>>(
3238            mut self,
3239            v: T,
3240        ) -> Self {
3241            self.signature_type = v.into();
3242            self
3243        }
3244    }
3245
3246    impl wkt::message::Message for ConfidentialGkeOptions {
3247        fn typename() -> &'static str {
3248            "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest.ConfidentialGkeOptions"
3249        }
3250    }
3251
3252    /// Required. A tee attestation report, used to populate hardware rooted
3253    /// claims.
3254    #[derive(Clone, Debug, PartialEq)]
3255    #[non_exhaustive]
3256    pub enum TeeAttestation {
3257        /// The TPM-specific data provided by the attesting platform, used to
3258        /// populate any of the claims regarding platform state.
3259        TpmAttestation(std::boxed::Box<crate::model::TpmAttestation>),
3260    }
3261}
3262
3263/// VerifyConfidentialGkeResponse response is returened once a Confidential GKE
3264/// attestation has been successfully verified, containing a signed OIDC token.
3265#[derive(Clone, Default, PartialEq)]
3266#[non_exhaustive]
3267pub struct VerifyConfidentialGkeResponse {
3268    /// Output only. The attestation token issued by this service for Confidential
3269    /// GKE. It contains specific platform claims based on the contents of the
3270    /// provided attestation.
3271    pub attestation_token: std::string::String,
3272
3273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3274}
3275
3276impl VerifyConfidentialGkeResponse {
3277    /// Creates a new default instance.
3278    pub fn new() -> Self {
3279        std::default::Default::default()
3280    }
3281
3282    /// Sets the value of [attestation_token][crate::model::VerifyConfidentialGkeResponse::attestation_token].
3283    ///
3284    /// # Example
3285    /// ```ignore,no_run
3286    /// # use google_cloud_confidentialcomputing_v1::model::VerifyConfidentialGkeResponse;
3287    /// let x = VerifyConfidentialGkeResponse::new().set_attestation_token("example");
3288    /// ```
3289    pub fn set_attestation_token<T: std::convert::Into<std::string::String>>(
3290        mut self,
3291        v: T,
3292    ) -> Self {
3293        self.attestation_token = v.into();
3294        self
3295    }
3296}
3297
3298impl wkt::message::Message for VerifyConfidentialGkeResponse {
3299    fn typename() -> &'static str {
3300        "type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeResponse"
3301    }
3302}
3303
3304/// SigningAlgorithm enumerates all the supported signing algorithms.
3305///
3306/// # Working with unknown values
3307///
3308/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3309/// additional enum variants at any time. Adding new variants is not considered
3310/// a breaking change. Applications should write their code in anticipation of:
3311///
3312/// - New values appearing in future releases of the client library, **and**
3313/// - New values received dynamically, without application changes.
3314///
3315/// Please consult the [Working with enums] section in the user guide for some
3316/// guidelines.
3317///
3318/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3319#[derive(Clone, Debug, PartialEq)]
3320#[non_exhaustive]
3321pub enum SigningAlgorithm {
3322    /// Unspecified signing algorithm.
3323    Unspecified,
3324    /// RSASSA-PSS with a SHA256 digest.
3325    RsassaPssSha256,
3326    /// RSASSA-PKCS1 v1.5 with a SHA256 digest.
3327    RsassaPkcs1V15Sha256,
3328    /// ECDSA on the P-256 Curve with a SHA256 digest.
3329    EcdsaP256Sha256,
3330    /// If set, the enum was initialized with an unknown value.
3331    ///
3332    /// Applications can examine the value using [SigningAlgorithm::value] or
3333    /// [SigningAlgorithm::name].
3334    UnknownValue(signing_algorithm::UnknownValue),
3335}
3336
3337#[doc(hidden)]
3338pub mod signing_algorithm {
3339    #[allow(unused_imports)]
3340    use super::*;
3341    #[derive(Clone, Debug, PartialEq)]
3342    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3343}
3344
3345impl SigningAlgorithm {
3346    /// Gets the enum value.
3347    ///
3348    /// Returns `None` if the enum contains an unknown value deserialized from
3349    /// the string representation of enums.
3350    pub fn value(&self) -> std::option::Option<i32> {
3351        match self {
3352            Self::Unspecified => std::option::Option::Some(0),
3353            Self::RsassaPssSha256 => std::option::Option::Some(1),
3354            Self::RsassaPkcs1V15Sha256 => std::option::Option::Some(2),
3355            Self::EcdsaP256Sha256 => std::option::Option::Some(3),
3356            Self::UnknownValue(u) => u.0.value(),
3357        }
3358    }
3359
3360    /// Gets the enum value as a string.
3361    ///
3362    /// Returns `None` if the enum contains an unknown value deserialized from
3363    /// the integer representation of enums.
3364    pub fn name(&self) -> std::option::Option<&str> {
3365        match self {
3366            Self::Unspecified => std::option::Option::Some("SIGNING_ALGORITHM_UNSPECIFIED"),
3367            Self::RsassaPssSha256 => std::option::Option::Some("RSASSA_PSS_SHA256"),
3368            Self::RsassaPkcs1V15Sha256 => std::option::Option::Some("RSASSA_PKCS1V15_SHA256"),
3369            Self::EcdsaP256Sha256 => std::option::Option::Some("ECDSA_P256_SHA256"),
3370            Self::UnknownValue(u) => u.0.name(),
3371        }
3372    }
3373}
3374
3375impl std::default::Default for SigningAlgorithm {
3376    fn default() -> Self {
3377        use std::convert::From;
3378        Self::from(0)
3379    }
3380}
3381
3382impl std::fmt::Display for SigningAlgorithm {
3383    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3384        wkt::internal::display_enum(f, self.name(), self.value())
3385    }
3386}
3387
3388impl std::convert::From<i32> for SigningAlgorithm {
3389    fn from(value: i32) -> Self {
3390        match value {
3391            0 => Self::Unspecified,
3392            1 => Self::RsassaPssSha256,
3393            2 => Self::RsassaPkcs1V15Sha256,
3394            3 => Self::EcdsaP256Sha256,
3395            _ => Self::UnknownValue(signing_algorithm::UnknownValue(
3396                wkt::internal::UnknownEnumValue::Integer(value),
3397            )),
3398        }
3399    }
3400}
3401
3402impl std::convert::From<&str> for SigningAlgorithm {
3403    fn from(value: &str) -> Self {
3404        use std::string::ToString;
3405        match value {
3406            "SIGNING_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
3407            "RSASSA_PSS_SHA256" => Self::RsassaPssSha256,
3408            "RSASSA_PKCS1V15_SHA256" => Self::RsassaPkcs1V15Sha256,
3409            "ECDSA_P256_SHA256" => Self::EcdsaP256Sha256,
3410            _ => Self::UnknownValue(signing_algorithm::UnknownValue(
3411                wkt::internal::UnknownEnumValue::String(value.to_string()),
3412            )),
3413        }
3414    }
3415}
3416
3417impl serde::ser::Serialize for SigningAlgorithm {
3418    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3419    where
3420        S: serde::Serializer,
3421    {
3422        match self {
3423            Self::Unspecified => serializer.serialize_i32(0),
3424            Self::RsassaPssSha256 => serializer.serialize_i32(1),
3425            Self::RsassaPkcs1V15Sha256 => serializer.serialize_i32(2),
3426            Self::EcdsaP256Sha256 => serializer.serialize_i32(3),
3427            Self::UnknownValue(u) => u.0.serialize(serializer),
3428        }
3429    }
3430}
3431
3432impl<'de> serde::de::Deserialize<'de> for SigningAlgorithm {
3433    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3434    where
3435        D: serde::Deserializer<'de>,
3436    {
3437        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SigningAlgorithm>::new(
3438            ".google.cloud.confidentialcomputing.v1.SigningAlgorithm",
3439        ))
3440    }
3441}
3442
3443/// Token type enum contains the different types of token responses Confidential
3444/// Space supports
3445///
3446/// # Working with unknown values
3447///
3448/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3449/// additional enum variants at any time. Adding new variants is not considered
3450/// a breaking change. Applications should write their code in anticipation of:
3451///
3452/// - New values appearing in future releases of the client library, **and**
3453/// - New values received dynamically, without application changes.
3454///
3455/// Please consult the [Working with enums] section in the user guide for some
3456/// guidelines.
3457///
3458/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3459#[derive(Clone, Debug, PartialEq)]
3460#[non_exhaustive]
3461pub enum TokenType {
3462    /// Unspecified token type
3463    Unspecified,
3464    /// OpenID Connect (OIDC) token type
3465    Oidc,
3466    /// Public Key Infrastructure (PKI) token type
3467    Pki,
3468    /// Limited claim token type for AWS integration
3469    LimitedAws,
3470    /// Principal-tag-based token for AWS integration
3471    AwsPrincipaltags,
3472    /// If set, the enum was initialized with an unknown value.
3473    ///
3474    /// Applications can examine the value using [TokenType::value] or
3475    /// [TokenType::name].
3476    UnknownValue(token_type::UnknownValue),
3477}
3478
3479#[doc(hidden)]
3480pub mod token_type {
3481    #[allow(unused_imports)]
3482    use super::*;
3483    #[derive(Clone, Debug, PartialEq)]
3484    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3485}
3486
3487impl TokenType {
3488    /// Gets the enum value.
3489    ///
3490    /// Returns `None` if the enum contains an unknown value deserialized from
3491    /// the string representation of enums.
3492    pub fn value(&self) -> std::option::Option<i32> {
3493        match self {
3494            Self::Unspecified => std::option::Option::Some(0),
3495            Self::Oidc => std::option::Option::Some(1),
3496            Self::Pki => std::option::Option::Some(2),
3497            Self::LimitedAws => std::option::Option::Some(3),
3498            Self::AwsPrincipaltags => std::option::Option::Some(4),
3499            Self::UnknownValue(u) => u.0.value(),
3500        }
3501    }
3502
3503    /// Gets the enum value as a string.
3504    ///
3505    /// Returns `None` if the enum contains an unknown value deserialized from
3506    /// the integer representation of enums.
3507    pub fn name(&self) -> std::option::Option<&str> {
3508        match self {
3509            Self::Unspecified => std::option::Option::Some("TOKEN_TYPE_UNSPECIFIED"),
3510            Self::Oidc => std::option::Option::Some("TOKEN_TYPE_OIDC"),
3511            Self::Pki => std::option::Option::Some("TOKEN_TYPE_PKI"),
3512            Self::LimitedAws => std::option::Option::Some("TOKEN_TYPE_LIMITED_AWS"),
3513            Self::AwsPrincipaltags => std::option::Option::Some("TOKEN_TYPE_AWS_PRINCIPALTAGS"),
3514            Self::UnknownValue(u) => u.0.name(),
3515        }
3516    }
3517}
3518
3519impl std::default::Default for TokenType {
3520    fn default() -> Self {
3521        use std::convert::From;
3522        Self::from(0)
3523    }
3524}
3525
3526impl std::fmt::Display for TokenType {
3527    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3528        wkt::internal::display_enum(f, self.name(), self.value())
3529    }
3530}
3531
3532impl std::convert::From<i32> for TokenType {
3533    fn from(value: i32) -> Self {
3534        match value {
3535            0 => Self::Unspecified,
3536            1 => Self::Oidc,
3537            2 => Self::Pki,
3538            3 => Self::LimitedAws,
3539            4 => Self::AwsPrincipaltags,
3540            _ => Self::UnknownValue(token_type::UnknownValue(
3541                wkt::internal::UnknownEnumValue::Integer(value),
3542            )),
3543        }
3544    }
3545}
3546
3547impl std::convert::From<&str> for TokenType {
3548    fn from(value: &str) -> Self {
3549        use std::string::ToString;
3550        match value {
3551            "TOKEN_TYPE_UNSPECIFIED" => Self::Unspecified,
3552            "TOKEN_TYPE_OIDC" => Self::Oidc,
3553            "TOKEN_TYPE_PKI" => Self::Pki,
3554            "TOKEN_TYPE_LIMITED_AWS" => Self::LimitedAws,
3555            "TOKEN_TYPE_AWS_PRINCIPALTAGS" => Self::AwsPrincipaltags,
3556            _ => Self::UnknownValue(token_type::UnknownValue(
3557                wkt::internal::UnknownEnumValue::String(value.to_string()),
3558            )),
3559        }
3560    }
3561}
3562
3563impl serde::ser::Serialize for TokenType {
3564    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3565    where
3566        S: serde::Serializer,
3567    {
3568        match self {
3569            Self::Unspecified => serializer.serialize_i32(0),
3570            Self::Oidc => serializer.serialize_i32(1),
3571            Self::Pki => serializer.serialize_i32(2),
3572            Self::LimitedAws => serializer.serialize_i32(3),
3573            Self::AwsPrincipaltags => serializer.serialize_i32(4),
3574            Self::UnknownValue(u) => u.0.serialize(serializer),
3575        }
3576    }
3577}
3578
3579impl<'de> serde::de::Deserialize<'de> for TokenType {
3580    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3581    where
3582        D: serde::Deserializer<'de>,
3583    {
3584        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenType>::new(
3585            ".google.cloud.confidentialcomputing.v1.TokenType",
3586        ))
3587    }
3588}
3589
3590/// SignatureType enumerates supported signature types for attestation tokens.
3591///
3592/// # Working with unknown values
3593///
3594/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3595/// additional enum variants at any time. Adding new variants is not considered
3596/// a breaking change. Applications should write their code in anticipation of:
3597///
3598/// - New values appearing in future releases of the client library, **and**
3599/// - New values received dynamically, without application changes.
3600///
3601/// Please consult the [Working with enums] section in the user guide for some
3602/// guidelines.
3603///
3604/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3605#[derive(Clone, Debug, PartialEq)]
3606#[non_exhaustive]
3607pub enum SignatureType {
3608    /// Unspecified signature type.
3609    Unspecified,
3610    /// Google OIDC signature.
3611    Oidc,
3612    /// Public Key Infrastructure (PKI) signature.
3613    Pki,
3614    /// If set, the enum was initialized with an unknown value.
3615    ///
3616    /// Applications can examine the value using [SignatureType::value] or
3617    /// [SignatureType::name].
3618    UnknownValue(signature_type::UnknownValue),
3619}
3620
3621#[doc(hidden)]
3622pub mod signature_type {
3623    #[allow(unused_imports)]
3624    use super::*;
3625    #[derive(Clone, Debug, PartialEq)]
3626    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3627}
3628
3629impl SignatureType {
3630    /// Gets the enum value.
3631    ///
3632    /// Returns `None` if the enum contains an unknown value deserialized from
3633    /// the string representation of enums.
3634    pub fn value(&self) -> std::option::Option<i32> {
3635        match self {
3636            Self::Unspecified => std::option::Option::Some(0),
3637            Self::Oidc => std::option::Option::Some(1),
3638            Self::Pki => std::option::Option::Some(2),
3639            Self::UnknownValue(u) => u.0.value(),
3640        }
3641    }
3642
3643    /// Gets the enum value as a string.
3644    ///
3645    /// Returns `None` if the enum contains an unknown value deserialized from
3646    /// the integer representation of enums.
3647    pub fn name(&self) -> std::option::Option<&str> {
3648        match self {
3649            Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
3650            Self::Oidc => std::option::Option::Some("SIGNATURE_TYPE_OIDC"),
3651            Self::Pki => std::option::Option::Some("SIGNATURE_TYPE_PKI"),
3652            Self::UnknownValue(u) => u.0.name(),
3653        }
3654    }
3655}
3656
3657impl std::default::Default for SignatureType {
3658    fn default() -> Self {
3659        use std::convert::From;
3660        Self::from(0)
3661    }
3662}
3663
3664impl std::fmt::Display for SignatureType {
3665    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3666        wkt::internal::display_enum(f, self.name(), self.value())
3667    }
3668}
3669
3670impl std::convert::From<i32> for SignatureType {
3671    fn from(value: i32) -> Self {
3672        match value {
3673            0 => Self::Unspecified,
3674            1 => Self::Oidc,
3675            2 => Self::Pki,
3676            _ => Self::UnknownValue(signature_type::UnknownValue(
3677                wkt::internal::UnknownEnumValue::Integer(value),
3678            )),
3679        }
3680    }
3681}
3682
3683impl std::convert::From<&str> for SignatureType {
3684    fn from(value: &str) -> Self {
3685        use std::string::ToString;
3686        match value {
3687            "SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
3688            "SIGNATURE_TYPE_OIDC" => Self::Oidc,
3689            "SIGNATURE_TYPE_PKI" => Self::Pki,
3690            _ => Self::UnknownValue(signature_type::UnknownValue(
3691                wkt::internal::UnknownEnumValue::String(value.to_string()),
3692            )),
3693        }
3694    }
3695}
3696
3697impl serde::ser::Serialize for SignatureType {
3698    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3699    where
3700        S: serde::Serializer,
3701    {
3702        match self {
3703            Self::Unspecified => serializer.serialize_i32(0),
3704            Self::Oidc => serializer.serialize_i32(1),
3705            Self::Pki => serializer.serialize_i32(2),
3706            Self::UnknownValue(u) => u.0.serialize(serializer),
3707        }
3708    }
3709}
3710
3711impl<'de> serde::de::Deserialize<'de> for SignatureType {
3712    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3713    where
3714        D: serde::Deserializer<'de>,
3715    {
3716        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
3717            ".google.cloud.confidentialcomputing.v1.SignatureType",
3718        ))
3719    }
3720}
3721
3722/// TokenProfile enumerates the supported token claims profiles.
3723///
3724/// # Working with unknown values
3725///
3726/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3727/// additional enum variants at any time. Adding new variants is not considered
3728/// a breaking change. Applications should write their code in anticipation of:
3729///
3730/// - New values appearing in future releases of the client library, **and**
3731/// - New values received dynamically, without application changes.
3732///
3733/// Please consult the [Working with enums] section in the user guide for some
3734/// guidelines.
3735///
3736/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3737#[derive(Clone, Debug, PartialEq)]
3738#[non_exhaustive]
3739pub enum TokenProfile {
3740    /// Unspecified token profile.
3741    Unspecified,
3742    /// EAT claims.
3743    DefaultEat,
3744    /// AWS Principal Tags claims.
3745    Aws,
3746    /// If set, the enum was initialized with an unknown value.
3747    ///
3748    /// Applications can examine the value using [TokenProfile::value] or
3749    /// [TokenProfile::name].
3750    UnknownValue(token_profile::UnknownValue),
3751}
3752
3753#[doc(hidden)]
3754pub mod token_profile {
3755    #[allow(unused_imports)]
3756    use super::*;
3757    #[derive(Clone, Debug, PartialEq)]
3758    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3759}
3760
3761impl TokenProfile {
3762    /// Gets the enum value.
3763    ///
3764    /// Returns `None` if the enum contains an unknown value deserialized from
3765    /// the string representation of enums.
3766    pub fn value(&self) -> std::option::Option<i32> {
3767        match self {
3768            Self::Unspecified => std::option::Option::Some(0),
3769            Self::DefaultEat => std::option::Option::Some(1),
3770            Self::Aws => std::option::Option::Some(2),
3771            Self::UnknownValue(u) => u.0.value(),
3772        }
3773    }
3774
3775    /// Gets the enum value as a string.
3776    ///
3777    /// Returns `None` if the enum contains an unknown value deserialized from
3778    /// the integer representation of enums.
3779    pub fn name(&self) -> std::option::Option<&str> {
3780        match self {
3781            Self::Unspecified => std::option::Option::Some("TOKEN_PROFILE_UNSPECIFIED"),
3782            Self::DefaultEat => std::option::Option::Some("TOKEN_PROFILE_DEFAULT_EAT"),
3783            Self::Aws => std::option::Option::Some("TOKEN_PROFILE_AWS"),
3784            Self::UnknownValue(u) => u.0.name(),
3785        }
3786    }
3787}
3788
3789impl std::default::Default for TokenProfile {
3790    fn default() -> Self {
3791        use std::convert::From;
3792        Self::from(0)
3793    }
3794}
3795
3796impl std::fmt::Display for TokenProfile {
3797    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3798        wkt::internal::display_enum(f, self.name(), self.value())
3799    }
3800}
3801
3802impl std::convert::From<i32> for TokenProfile {
3803    fn from(value: i32) -> Self {
3804        match value {
3805            0 => Self::Unspecified,
3806            1 => Self::DefaultEat,
3807            2 => Self::Aws,
3808            _ => Self::UnknownValue(token_profile::UnknownValue(
3809                wkt::internal::UnknownEnumValue::Integer(value),
3810            )),
3811        }
3812    }
3813}
3814
3815impl std::convert::From<&str> for TokenProfile {
3816    fn from(value: &str) -> Self {
3817        use std::string::ToString;
3818        match value {
3819            "TOKEN_PROFILE_UNSPECIFIED" => Self::Unspecified,
3820            "TOKEN_PROFILE_DEFAULT_EAT" => Self::DefaultEat,
3821            "TOKEN_PROFILE_AWS" => Self::Aws,
3822            _ => Self::UnknownValue(token_profile::UnknownValue(
3823                wkt::internal::UnknownEnumValue::String(value.to_string()),
3824            )),
3825        }
3826    }
3827}
3828
3829impl serde::ser::Serialize for TokenProfile {
3830    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3831    where
3832        S: serde::Serializer,
3833    {
3834        match self {
3835            Self::Unspecified => serializer.serialize_i32(0),
3836            Self::DefaultEat => serializer.serialize_i32(1),
3837            Self::Aws => serializer.serialize_i32(2),
3838            Self::UnknownValue(u) => u.0.serialize(serializer),
3839        }
3840    }
3841}
3842
3843impl<'de> serde::de::Deserialize<'de> for TokenProfile {
3844    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3845    where
3846        D: serde::Deserializer<'de>,
3847    {
3848        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenProfile>::new(
3849            ".google.cloud.confidentialcomputing.v1.TokenProfile",
3850        ))
3851    }
3852}