#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_location;
extern crate google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Challenge {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub used: bool,
pub tpm_nonce: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Challenge {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
pub fn set_used<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.used = v.into();
self
}
pub fn set_tpm_nonce<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tpm_nonce = v.into();
self
}
}
impl wkt::message::Message for Challenge {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.Challenge"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateChallengeRequest {
pub parent: std::string::String,
pub challenge: std::option::Option<crate::model::Challenge>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateChallengeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_challenge<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Challenge>,
{
self.challenge = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_challenge<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Challenge>,
{
self.challenge = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateChallengeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.CreateChallengeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyAttestationRequest {
pub challenge: std::string::String,
pub gcp_credentials: std::option::Option<crate::model::GcpCredentials>,
pub tpm_attestation: std::option::Option<crate::model::TpmAttestation>,
pub confidential_space_info: std::option::Option<crate::model::ConfidentialSpaceInfo>,
pub token_options: std::option::Option<crate::model::TokenOptions>,
pub attester: std::string::String,
pub tee_attestation:
std::option::Option<crate::model::verify_attestation_request::TeeAttestation>,
pub device_attestation:
std::option::Option<crate::model::verify_attestation_request::DeviceAttestation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyAttestationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.challenge = v.into();
self
}
pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GcpCredentials>,
{
self.gcp_credentials = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GcpCredentials>,
{
self.gcp_credentials = v.map(|x| x.into());
self
}
pub fn set_tpm_attestation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TpmAttestation>,
{
self.tpm_attestation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tpm_attestation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TpmAttestation>,
{
self.tpm_attestation = v.map(|x| x.into());
self
}
pub fn set_confidential_space_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
{
self.confidential_space_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_confidential_space_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
{
self.confidential_space_info = v.map(|x| x.into());
self
}
pub fn set_token_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TokenOptions>,
{
self.token_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_token_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TokenOptions>,
{
self.token_options = v.map(|x| x.into());
self
}
pub fn set_attester<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.attester = v.into();
self
}
pub fn set_tee_attestation<
T: std::convert::Into<
std::option::Option<crate::model::verify_attestation_request::TeeAttestation>,
>,
>(
mut self,
v: T,
) -> Self {
self.tee_attestation = v.into();
self
}
pub fn td_ccel(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TdxCcelAttestation>> {
#[allow(unreachable_patterns)]
self.tee_attestation.as_ref().and_then(|v| match v {
crate::model::verify_attestation_request::TeeAttestation::TdCcel(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_td_ccel<T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>>(
mut self,
v: T,
) -> Self {
self.tee_attestation = std::option::Option::Some(
crate::model::verify_attestation_request::TeeAttestation::TdCcel(v.into()),
);
self
}
pub fn sev_snp_attestation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SevSnpAttestation>> {
#[allow(unreachable_patterns)]
self.tee_attestation.as_ref().and_then(|v| match v {
crate::model::verify_attestation_request::TeeAttestation::SevSnpAttestation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_sev_snp_attestation<
T: std::convert::Into<std::boxed::Box<crate::model::SevSnpAttestation>>,
>(
mut self,
v: T,
) -> Self {
self.tee_attestation = std::option::Option::Some(
crate::model::verify_attestation_request::TeeAttestation::SevSnpAttestation(v.into()),
);
self
}
pub fn set_device_attestation<
T: std::convert::Into<
std::option::Option<crate::model::verify_attestation_request::DeviceAttestation>,
>,
>(
mut self,
v: T,
) -> Self {
self.device_attestation = v.into();
self
}
pub fn nvidia_attestation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NvidiaAttestation>> {
#[allow(unreachable_patterns)]
self.device_attestation.as_ref().and_then(|v| match v {
crate::model::verify_attestation_request::DeviceAttestation::NvidiaAttestation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_nvidia_attestation<
T: std::convert::Into<std::boxed::Box<crate::model::NvidiaAttestation>>,
>(
mut self,
v: T,
) -> Self {
self.device_attestation = std::option::Option::Some(
crate::model::verify_attestation_request::DeviceAttestation::NvidiaAttestation(
v.into(),
),
);
self
}
}
impl wkt::message::Message for VerifyAttestationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyAttestationRequest"
}
}
pub mod verify_attestation_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TeeAttestation {
TdCcel(std::boxed::Box<crate::model::TdxCcelAttestation>),
SevSnpAttestation(std::boxed::Box<crate::model::SevSnpAttestation>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeviceAttestation {
NvidiaAttestation(std::boxed::Box<crate::model::NvidiaAttestation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NvidiaAttestation {
pub cc_feature: std::option::Option<crate::model::nvidia_attestation::CcFeature>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NvidiaAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cc_feature<
T: std::convert::Into<std::option::Option<crate::model::nvidia_attestation::CcFeature>>,
>(
mut self,
v: T,
) -> Self {
self.cc_feature = v.into();
self
}
pub fn spt(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::nvidia_attestation::SinglePassthroughAttestation>,
> {
#[allow(unreachable_patterns)]
self.cc_feature.as_ref().and_then(|v| match v {
crate::model::nvidia_attestation::CcFeature::Spt(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spt<
T: std::convert::Into<
std::boxed::Box<crate::model::nvidia_attestation::SinglePassthroughAttestation>,
>,
>(
mut self,
v: T,
) -> Self {
self.cc_feature =
std::option::Option::Some(crate::model::nvidia_attestation::CcFeature::Spt(v.into()));
self
}
pub fn ppcie(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::nvidia_attestation::ProtectedPcieAttestation>,
> {
#[allow(unreachable_patterns)]
self.cc_feature.as_ref().and_then(|v| match v {
crate::model::nvidia_attestation::CcFeature::Ppcie(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_ppcie<
T: std::convert::Into<
std::boxed::Box<crate::model::nvidia_attestation::ProtectedPcieAttestation>,
>,
>(
mut self,
v: T,
) -> Self {
self.cc_feature =
std::option::Option::Some(crate::model::nvidia_attestation::CcFeature::Ppcie(v.into()));
self
}
pub fn mpt(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation>,
> {
#[allow(unreachable_patterns)]
self.cc_feature.as_ref().and_then(|v| match v {
crate::model::nvidia_attestation::CcFeature::Mpt(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_mpt<
T: std::convert::Into<
std::boxed::Box<
crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.cc_feature =
std::option::Option::Some(crate::model::nvidia_attestation::CcFeature::Mpt(v.into()));
self
}
}
impl wkt::message::Message for NvidiaAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation"
}
}
pub mod nvidia_attestation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GpuInfo {
pub uuid: std::string::String,
pub driver_version: std::string::String,
pub vbios_version: std::string::String,
pub gpu_architecture_type: crate::model::nvidia_attestation::GpuArchitectureType,
pub attestation_certificate_chain: ::bytes::Bytes,
pub attestation_report: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GpuInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_driver_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver_version = v.into();
self
}
pub fn set_vbios_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.vbios_version = v.into();
self
}
pub fn set_gpu_architecture_type<
T: std::convert::Into<crate::model::nvidia_attestation::GpuArchitectureType>,
>(
mut self,
v: T,
) -> Self {
self.gpu_architecture_type = v.into();
self
}
pub fn set_attestation_certificate_chain<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.attestation_certificate_chain = v.into();
self
}
pub fn set_attestation_report<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.attestation_report = v.into();
self
}
}
impl wkt::message::Message for GpuInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.GpuInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SwitchInfo {
pub uuid: std::string::String,
pub attestation_certificate_chain: ::bytes::Bytes,
pub attestation_report: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SwitchInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_attestation_certificate_chain<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.attestation_certificate_chain = v.into();
self
}
pub fn set_attestation_report<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.attestation_report = v.into();
self
}
}
impl wkt::message::Message for SwitchInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.SwitchInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SinglePassthroughAttestation {
pub gpu_quote: std::option::Option<crate::model::nvidia_attestation::GpuInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SinglePassthroughAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gpu_quote<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
{
self.gpu_quote = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_quote<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
{
self.gpu_quote = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SinglePassthroughAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.SinglePassthroughAttestation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProtectedPcieAttestation {
pub gpu_quotes: std::vec::Vec<crate::model::nvidia_attestation::GpuInfo>,
pub switch_quotes: std::vec::Vec<crate::model::nvidia_attestation::SwitchInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProtectedPcieAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gpu_quotes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
{
use std::iter::Iterator;
self.gpu_quotes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_switch_quotes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::nvidia_attestation::SwitchInfo>,
{
use std::iter::Iterator;
self.switch_quotes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ProtectedPcieAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.ProtectedPcieAttestation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiGpuSecurePassthroughAttestation {
pub gpu_quotes: std::vec::Vec<crate::model::nvidia_attestation::GpuInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiGpuSecurePassthroughAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gpu_quotes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::nvidia_attestation::GpuInfo>,
{
use std::iter::Iterator;
self.gpu_quotes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MultiGpuSecurePassthroughAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.NvidiaAttestation.MultiGpuSecurePassthroughAttestation"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum GpuArchitectureType {
Unspecified,
Hopper,
Blackwell,
UnknownValue(gpu_architecture_type::UnknownValue),
}
#[doc(hidden)]
pub mod gpu_architecture_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl GpuArchitectureType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Hopper => std::option::Option::Some(8),
Self::Blackwell => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("GPU_ARCHITECTURE_TYPE_UNSPECIFIED"),
Self::Hopper => std::option::Option::Some("GPU_ARCHITECTURE_TYPE_HOPPER"),
Self::Blackwell => std::option::Option::Some("GPU_ARCHITECTURE_TYPE_BLACKWELL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for GpuArchitectureType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for GpuArchitectureType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for GpuArchitectureType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
8 => Self::Hopper,
10 => Self::Blackwell,
_ => Self::UnknownValue(gpu_architecture_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for GpuArchitectureType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"GPU_ARCHITECTURE_TYPE_UNSPECIFIED" => Self::Unspecified,
"GPU_ARCHITECTURE_TYPE_HOPPER" => Self::Hopper,
"GPU_ARCHITECTURE_TYPE_BLACKWELL" => Self::Blackwell,
_ => Self::UnknownValue(gpu_architecture_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for GpuArchitectureType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Hopper => serializer.serialize_i32(8),
Self::Blackwell => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for GpuArchitectureType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<GpuArchitectureType>::new(
".google.cloud.confidentialcomputing.v1.NvidiaAttestation.GpuArchitectureType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CcFeature {
Spt(std::boxed::Box<crate::model::nvidia_attestation::SinglePassthroughAttestation>),
Ppcie(std::boxed::Box<crate::model::nvidia_attestation::ProtectedPcieAttestation>),
Mpt(
std::boxed::Box<crate::model::nvidia_attestation::MultiGpuSecurePassthroughAttestation>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TdxCcelAttestation {
pub ccel_acpi_table: ::bytes::Bytes,
pub ccel_data: ::bytes::Bytes,
pub canonical_event_log: ::bytes::Bytes,
pub td_quote: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TdxCcelAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ccel_acpi_table<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ccel_acpi_table = v.into();
self
}
pub fn set_ccel_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ccel_data = v.into();
self
}
pub fn set_canonical_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.canonical_event_log = v.into();
self
}
pub fn set_td_quote<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.td_quote = v.into();
self
}
}
impl wkt::message::Message for TdxCcelAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.TdxCcelAttestation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SevSnpAttestation {
pub report: ::bytes::Bytes,
pub aux_blob: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SevSnpAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_report<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.report = v.into();
self
}
pub fn set_aux_blob<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.aux_blob = v.into();
self
}
}
impl wkt::message::Message for SevSnpAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.SevSnpAttestation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyAttestationResponse {
pub oidc_claims_token: std::string::String,
pub partial_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyAttestationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_oidc_claims_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.oidc_claims_token = v.into();
self
}
pub fn set_partial_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::Status>,
{
use std::iter::Iterator;
self.partial_errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VerifyAttestationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyAttestationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GcpCredentials {
pub service_account_id_tokens: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GcpCredentials {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_account_id_tokens<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.service_account_id_tokens = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GcpCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.GcpCredentials"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TokenOptions {
pub audience: std::string::String,
pub nonce: std::vec::Vec<std::string::String>,
pub token_type: crate::model::TokenType,
pub token_type_options: std::option::Option<crate::model::token_options::TokenTypeOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TokenOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.audience = v.into();
self
}
pub fn set_nonce<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.nonce = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_token_type<T: std::convert::Into<crate::model::TokenType>>(mut self, v: T) -> Self {
self.token_type = v.into();
self
}
pub fn set_token_type_options<
T: std::convert::Into<std::option::Option<crate::model::token_options::TokenTypeOptions>>,
>(
mut self,
v: T,
) -> Self {
self.token_type_options = v.into();
self
}
pub fn aws_principal_tags_options(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsPrincipalTagsOptions>> {
#[allow(unreachable_patterns)]
self.token_type_options.as_ref().and_then(|v| match v {
crate::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_principal_tags_options<
T: std::convert::Into<std::boxed::Box<crate::model::AwsPrincipalTagsOptions>>,
>(
mut self,
v: T,
) -> Self {
self.token_type_options = std::option::Option::Some(
crate::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(v.into()),
);
self
}
}
impl wkt::message::Message for TokenOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.TokenOptions"
}
}
pub mod token_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TokenTypeOptions {
AwsPrincipalTagsOptions(std::boxed::Box<crate::model::AwsPrincipalTagsOptions>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsPrincipalTagsOptions {
pub allowed_principal_tags:
std::option::Option<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsPrincipalTagsOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_principal_tags<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
{
self.allowed_principal_tags = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allowed_principal_tags<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aws_principal_tags_options::AllowedPrincipalTags>,
{
self.allowed_principal_tags = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AwsPrincipalTagsOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions"
}
}
pub mod aws_principal_tags_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AllowedPrincipalTags {
pub container_image_signatures: std::option::Option<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AllowedPrincipalTags {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_container_image_signatures<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>
{
self.container_image_signatures = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_container_image_signatures<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::aws_principal_tags_options::allowed_principal_tags::ContainerImageSignatures>
{
self.container_image_signatures = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AllowedPrincipalTags {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions.AllowedPrincipalTags"
}
}
pub mod allowed_principal_tags {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContainerImageSignatures {
pub key_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContainerImageSignatures {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.key_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ContainerImageSignatures {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions.AllowedPrincipalTags.ContainerImageSignatures"
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TpmAttestation {
pub quotes: std::vec::Vec<crate::model::tpm_attestation::Quote>,
pub tcg_event_log: ::bytes::Bytes,
pub canonical_event_log: ::bytes::Bytes,
pub ak_cert: ::bytes::Bytes,
pub cert_chain: std::vec::Vec<::bytes::Bytes>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TpmAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_quotes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::tpm_attestation::Quote>,
{
use std::iter::Iterator;
self.quotes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_tcg_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.tcg_event_log = v.into();
self
}
pub fn set_canonical_event_log<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.canonical_event_log = v.into();
self
}
pub fn set_ak_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ak_cert = v.into();
self
}
pub fn set_cert_chain<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<::bytes::Bytes>,
{
use std::iter::Iterator;
self.cert_chain = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TpmAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.TpmAttestation"
}
}
pub mod tpm_attestation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Quote {
pub hash_algo: i32,
pub pcr_values: std::collections::HashMap<i32, ::bytes::Bytes>,
pub raw_quote: ::bytes::Bytes,
pub raw_signature: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Quote {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hash_algo<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.hash_algo = v.into();
self
}
pub fn set_pcr_values<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<i32>,
V: std::convert::Into<::bytes::Bytes>,
{
use std::iter::Iterator;
self.pcr_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_raw_quote<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.raw_quote = v.into();
self
}
pub fn set_raw_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.raw_signature = v.into();
self
}
}
impl wkt::message::Message for Quote {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.TpmAttestation.Quote"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfidentialSpaceInfo {
pub signed_entities: std::vec::Vec<crate::model::SignedEntity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfidentialSpaceInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SignedEntity>,
{
use std::iter::Iterator;
self.signed_entities = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ConfidentialSpaceInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SignedEntity {
pub container_image_signatures: std::vec::Vec<crate::model::ContainerImageSignature>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SignedEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_container_image_signatures<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ContainerImageSignature>,
{
use std::iter::Iterator;
self.container_image_signatures = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SignedEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.SignedEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContainerImageSignature {
pub payload: ::bytes::Bytes,
pub signature: ::bytes::Bytes,
pub public_key: ::bytes::Bytes,
pub sig_alg: crate::model::SigningAlgorithm,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContainerImageSignature {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_payload<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.payload = v.into();
self
}
pub fn set_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.signature = v.into();
self
}
pub fn set_public_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.public_key = v.into();
self
}
pub fn set_sig_alg<T: std::convert::Into<crate::model::SigningAlgorithm>>(
mut self,
v: T,
) -> Self {
self.sig_alg = v.into();
self
}
}
impl wkt::message::Message for ContainerImageSignature {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.ContainerImageSignature"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyConfidentialSpaceRequest {
pub challenge: std::string::String,
pub gcp_credentials: std::option::Option<crate::model::GcpCredentials>,
pub signed_entities: std::vec::Vec<crate::model::SignedEntity>,
pub gce_shielded_identity: std::option::Option<crate::model::GceShieldedIdentity>,
pub options: std::option::Option<
crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
>,
pub nvidia_attestation: std::option::Option<crate::model::NvidiaAttestation>,
pub tee_attestation:
std::option::Option<crate::model::verify_confidential_space_request::TeeAttestation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyConfidentialSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.challenge = v.into();
self
}
pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GcpCredentials>,
{
self.gcp_credentials = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GcpCredentials>,
{
self.gcp_credentials = v.map(|x| x.into());
self
}
pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SignedEntity>,
{
use std::iter::Iterator;
self.signed_entities = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_gce_shielded_identity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GceShieldedIdentity>,
{
self.gce_shielded_identity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gce_shielded_identity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GceShieldedIdentity>,
{
self.gce_shielded_identity = v.map(|x| x.into());
self
}
pub fn set_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
>,
{
self.options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
>,
{
self.options = v.map(|x| x.into());
self
}
pub fn set_nvidia_attestation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NvidiaAttestation>,
{
self.nvidia_attestation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_nvidia_attestation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NvidiaAttestation>,
{
self.nvidia_attestation = v.map(|x| x.into());
self
}
pub fn set_tee_attestation<
T: std::convert::Into<
std::option::Option<
crate::model::verify_confidential_space_request::TeeAttestation,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.tee_attestation = v.into();
self
}
pub fn td_ccel(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TdxCcelAttestation>> {
#[allow(unreachable_patterns)]
self.tee_attestation.as_ref().and_then(|v| match v {
crate::model::verify_confidential_space_request::TeeAttestation::TdCcel(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_td_ccel<T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>>(
mut self,
v: T,
) -> Self {
self.tee_attestation = std::option::Option::Some(
crate::model::verify_confidential_space_request::TeeAttestation::TdCcel(v.into()),
);
self
}
pub fn tpm_attestation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TpmAttestation>> {
#[allow(unreachable_patterns)]
self.tee_attestation.as_ref().and_then(|v| match v {
crate::model::verify_confidential_space_request::TeeAttestation::TpmAttestation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tpm_attestation<
T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
>(
mut self,
v: T,
) -> Self {
self.tee_attestation = std::option::Option::Some(
crate::model::verify_confidential_space_request::TeeAttestation::TpmAttestation(
v.into(),
),
);
self
}
}
impl wkt::message::Message for VerifyConfidentialSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest"
}
}
pub mod verify_confidential_space_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfidentialSpaceOptions {
pub audience: std::string::String,
pub token_profile: crate::model::TokenProfile,
pub nonce: std::vec::Vec<std::string::String>,
pub signature_type: crate::model::SignatureType,
pub token_profile_options: std::option::Option<crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfidentialSpaceOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.audience = v.into();
self
}
pub fn set_token_profile<T: std::convert::Into<crate::model::TokenProfile>>(
mut self,
v: T,
) -> Self {
self.token_profile = v.into();
self
}
pub fn set_nonce<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.nonce = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_signature_type<T: std::convert::Into<crate::model::SignatureType>>(
mut self,
v: T,
) -> Self {
self.signature_type = v.into();
self
}
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
{
self.token_profile_options = v.into();
self
}
pub fn aws_principal_tags_options(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsPrincipalTagsOptions>> {
#[allow(unreachable_patterns)]
self.token_profile_options.as_ref().and_then(|v| match v {
crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_aws_principal_tags_options<
T: std::convert::Into<std::boxed::Box<crate::model::AwsPrincipalTagsOptions>>,
>(
mut self,
v: T,
) -> Self {
self.token_profile_options = std::option::Option::Some(
crate::model::verify_confidential_space_request::confidential_space_options::TokenProfileOptions::AwsPrincipalTagsOptions(
v.into()
)
);
self
}
}
impl wkt::message::Message for ConfidentialSpaceOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest.ConfidentialSpaceOptions"
}
}
pub mod confidential_space_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TokenProfileOptions {
AwsPrincipalTagsOptions(std::boxed::Box<crate::model::AwsPrincipalTagsOptions>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TeeAttestation {
TdCcel(std::boxed::Box<crate::model::TdxCcelAttestation>),
TpmAttestation(std::boxed::Box<crate::model::TpmAttestation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GceShieldedIdentity {
pub ak_cert: ::bytes::Bytes,
pub ak_cert_chain: std::vec::Vec<::bytes::Bytes>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GceShieldedIdentity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ak_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ak_cert = v.into();
self
}
pub fn set_ak_cert_chain<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<::bytes::Bytes>,
{
use std::iter::Iterator;
self.ak_cert_chain = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GceShieldedIdentity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.GceShieldedIdentity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyConfidentialSpaceResponse {
pub attestation_token: std::string::String,
pub partial_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyConfidentialSpaceResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attestation_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.attestation_token = v.into();
self
}
pub fn set_partial_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::Status>,
{
use std::iter::Iterator;
self.partial_errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VerifyConfidentialSpaceResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyConfidentialGkeRequest {
pub challenge: std::string::String,
pub options:
std::option::Option<crate::model::verify_confidential_gke_request::ConfidentialGkeOptions>,
pub tee_attestation:
std::option::Option<crate::model::verify_confidential_gke_request::TeeAttestation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyConfidentialGkeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.challenge = v.into();
self
}
pub fn set_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
>,
{
self.options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::verify_confidential_gke_request::ConfidentialGkeOptions,
>,
{
self.options = v.map(|x| x.into());
self
}
pub fn set_tee_attestation<
T: std::convert::Into<
std::option::Option<crate::model::verify_confidential_gke_request::TeeAttestation>,
>,
>(
mut self,
v: T,
) -> Self {
self.tee_attestation = v.into();
self
}
pub fn tpm_attestation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TpmAttestation>> {
#[allow(unreachable_patterns)]
self.tee_attestation.as_ref().and_then(|v| match v {
crate::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tpm_attestation<
T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
>(
mut self,
v: T,
) -> Self {
self.tee_attestation = std::option::Option::Some(
crate::model::verify_confidential_gke_request::TeeAttestation::TpmAttestation(v.into()),
);
self
}
}
impl wkt::message::Message for VerifyConfidentialGkeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest"
}
}
pub mod verify_confidential_gke_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfidentialGkeOptions {
pub audience: std::string::String,
pub nonce: std::vec::Vec<std::string::String>,
pub signature_type: crate::model::SignatureType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfidentialGkeOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.audience = v.into();
self
}
pub fn set_nonce<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.nonce = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_signature_type<T: std::convert::Into<crate::model::SignatureType>>(
mut self,
v: T,
) -> Self {
self.signature_type = v.into();
self
}
}
impl wkt::message::Message for ConfidentialGkeOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest.ConfidentialGkeOptions"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TeeAttestation {
TpmAttestation(std::boxed::Box<crate::model::TpmAttestation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyConfidentialGkeResponse {
pub attestation_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyConfidentialGkeResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attestation_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.attestation_token = v.into();
self
}
}
impl wkt::message::Message for VerifyConfidentialGkeResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeResponse"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SigningAlgorithm {
Unspecified,
RsassaPssSha256,
RsassaPkcs1V15Sha256,
EcdsaP256Sha256,
UnknownValue(signing_algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod signing_algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SigningAlgorithm {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RsassaPssSha256 => std::option::Option::Some(1),
Self::RsassaPkcs1V15Sha256 => std::option::Option::Some(2),
Self::EcdsaP256Sha256 => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SIGNING_ALGORITHM_UNSPECIFIED"),
Self::RsassaPssSha256 => std::option::Option::Some("RSASSA_PSS_SHA256"),
Self::RsassaPkcs1V15Sha256 => std::option::Option::Some("RSASSA_PKCS1V15_SHA256"),
Self::EcdsaP256Sha256 => std::option::Option::Some("ECDSA_P256_SHA256"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SigningAlgorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SigningAlgorithm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SigningAlgorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RsassaPssSha256,
2 => Self::RsassaPkcs1V15Sha256,
3 => Self::EcdsaP256Sha256,
_ => Self::UnknownValue(signing_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SigningAlgorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SIGNING_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
"RSASSA_PSS_SHA256" => Self::RsassaPssSha256,
"RSASSA_PKCS1V15_SHA256" => Self::RsassaPkcs1V15Sha256,
"ECDSA_P256_SHA256" => Self::EcdsaP256Sha256,
_ => Self::UnknownValue(signing_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SigningAlgorithm {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RsassaPssSha256 => serializer.serialize_i32(1),
Self::RsassaPkcs1V15Sha256 => serializer.serialize_i32(2),
Self::EcdsaP256Sha256 => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SigningAlgorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SigningAlgorithm>::new(
".google.cloud.confidentialcomputing.v1.SigningAlgorithm",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TokenType {
Unspecified,
Oidc,
Pki,
LimitedAws,
AwsPrincipaltags,
UnknownValue(token_type::UnknownValue),
}
#[doc(hidden)]
pub mod token_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TokenType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Oidc => std::option::Option::Some(1),
Self::Pki => std::option::Option::Some(2),
Self::LimitedAws => std::option::Option::Some(3),
Self::AwsPrincipaltags => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TOKEN_TYPE_UNSPECIFIED"),
Self::Oidc => std::option::Option::Some("TOKEN_TYPE_OIDC"),
Self::Pki => std::option::Option::Some("TOKEN_TYPE_PKI"),
Self::LimitedAws => std::option::Option::Some("TOKEN_TYPE_LIMITED_AWS"),
Self::AwsPrincipaltags => std::option::Option::Some("TOKEN_TYPE_AWS_PRINCIPALTAGS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TokenType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TokenType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TokenType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Oidc,
2 => Self::Pki,
3 => Self::LimitedAws,
4 => Self::AwsPrincipaltags,
_ => Self::UnknownValue(token_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TokenType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TOKEN_TYPE_UNSPECIFIED" => Self::Unspecified,
"TOKEN_TYPE_OIDC" => Self::Oidc,
"TOKEN_TYPE_PKI" => Self::Pki,
"TOKEN_TYPE_LIMITED_AWS" => Self::LimitedAws,
"TOKEN_TYPE_AWS_PRINCIPALTAGS" => Self::AwsPrincipaltags,
_ => Self::UnknownValue(token_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TokenType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Oidc => serializer.serialize_i32(1),
Self::Pki => serializer.serialize_i32(2),
Self::LimitedAws => serializer.serialize_i32(3),
Self::AwsPrincipaltags => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TokenType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenType>::new(
".google.cloud.confidentialcomputing.v1.TokenType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SignatureType {
Unspecified,
Oidc,
Pki,
UnknownValue(signature_type::UnknownValue),
}
#[doc(hidden)]
pub mod signature_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SignatureType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Oidc => std::option::Option::Some(1),
Self::Pki => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
Self::Oidc => std::option::Option::Some("SIGNATURE_TYPE_OIDC"),
Self::Pki => std::option::Option::Some("SIGNATURE_TYPE_PKI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SignatureType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SignatureType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SignatureType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Oidc,
2 => Self::Pki,
_ => Self::UnknownValue(signature_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SignatureType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SIGNATURE_TYPE_OIDC" => Self::Oidc,
"SIGNATURE_TYPE_PKI" => Self::Pki,
_ => Self::UnknownValue(signature_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SignatureType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Oidc => serializer.serialize_i32(1),
Self::Pki => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SignatureType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
".google.cloud.confidentialcomputing.v1.SignatureType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TokenProfile {
Unspecified,
DefaultEat,
Aws,
UnknownValue(token_profile::UnknownValue),
}
#[doc(hidden)]
pub mod token_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TokenProfile {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DefaultEat => std::option::Option::Some(1),
Self::Aws => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TOKEN_PROFILE_UNSPECIFIED"),
Self::DefaultEat => std::option::Option::Some("TOKEN_PROFILE_DEFAULT_EAT"),
Self::Aws => std::option::Option::Some("TOKEN_PROFILE_AWS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TokenProfile {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TokenProfile {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TokenProfile {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DefaultEat,
2 => Self::Aws,
_ => Self::UnknownValue(token_profile::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TokenProfile {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TOKEN_PROFILE_UNSPECIFIED" => Self::Unspecified,
"TOKEN_PROFILE_DEFAULT_EAT" => Self::DefaultEat,
"TOKEN_PROFILE_AWS" => Self::Aws,
_ => Self::UnknownValue(token_profile::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TokenProfile {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DefaultEat => serializer.serialize_i32(1),
Self::Aws => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TokenProfile {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenProfile>::new(
".google.cloud.confidentialcomputing.v1.TokenProfile",
))
}
}