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