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