#![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_iam_v1;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_type;
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 CertificateAuthority {
pub name: std::string::String,
pub r#type: crate::model::certificate_authority::Type,
pub config: std::option::Option<crate::model::CertificateConfig>,
pub lifetime: std::option::Option<wkt::Duration>,
pub key_spec: std::option::Option<crate::model::certificate_authority::KeyVersionSpec>,
pub subordinate_config: std::option::Option<crate::model::SubordinateConfig>,
pub tier: crate::model::ca_pool::Tier,
pub state: crate::model::certificate_authority::State,
pub pem_ca_certificates: std::vec::Vec<std::string::String>,
pub ca_certificate_descriptions: std::vec::Vec<crate::model::CertificateDescription>,
pub gcs_bucket: std::string::String,
pub access_urls: std::option::Option<crate::model::certificate_authority::AccessUrls>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub user_defined_access_urls:
std::option::Option<crate::model::certificate_authority::UserDefinedAccessUrls>,
pub satisfies_pzs: bool,
pub satisfies_pzi: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateAuthority {
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_type<T: std::convert::Into<crate::model::certificate_authority::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateConfig>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_lifetime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lifetime = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lifetime = v.map(|x| x.into());
self
}
pub fn set_key_spec<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_authority::KeyVersionSpec>,
{
self.key_spec = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_key_spec<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_authority::KeyVersionSpec>,
{
self.key_spec = v.map(|x| x.into());
self
}
pub fn set_subordinate_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SubordinateConfig>,
{
self.subordinate_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subordinate_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SubordinateConfig>,
{
self.subordinate_config = v.map(|x| x.into());
self
}
pub fn set_tier<T: std::convert::Into<crate::model::ca_pool::Tier>>(mut self, v: T) -> Self {
self.tier = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::certificate_authority::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_pem_ca_certificates<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.pem_ca_certificates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_ca_certificate_descriptions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CertificateDescription>,
{
use std::iter::Iterator;
self.ca_certificate_descriptions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.gcs_bucket = v.into();
self
}
pub fn set_access_urls<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_authority::AccessUrls>,
{
self.access_urls = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_access_urls<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_authority::AccessUrls>,
{
self.access_urls = v.map(|x| x.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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_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_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_user_defined_access_urls<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_authority::UserDefinedAccessUrls>,
{
self.user_defined_access_urls = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_user_defined_access_urls<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_authority::UserDefinedAccessUrls>,
{
self.user_defined_access_urls = v.map(|x| x.into());
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzi = v.into();
self
}
}
impl wkt::message::Message for CertificateAuthority {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority"
}
}
pub mod certificate_authority {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessUrls {
pub ca_certificate_access_url: std::string::String,
pub crl_access_urls: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessUrls {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_certificate_access_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.ca_certificate_access_url = v.into();
self
}
pub fn set_crl_access_urls<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.crl_access_urls = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AccessUrls {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyVersionSpec {
pub key_version:
std::option::Option<crate::model::certificate_authority::key_version_spec::KeyVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyVersionSpec {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_version<
T: std::convert::Into<
std::option::Option<
crate::model::certificate_authority::key_version_spec::KeyVersion,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.key_version = v.into();
self
}
pub fn cloud_kms_key_version(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.key_version.as_ref().and_then(|v| match v {
crate::model::certificate_authority::key_version_spec::KeyVersion::CloudKmsKeyVersion(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cloud_kms_key_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.key_version = std::option::Option::Some(
crate::model::certificate_authority::key_version_spec::KeyVersion::CloudKmsKeyVersion(
v.into()
)
);
self
}
pub fn algorithm(
&self,
) -> std::option::Option<&crate::model::certificate_authority::SignHashAlgorithm> {
#[allow(unreachable_patterns)]
self.key_version.as_ref().and_then(|v| match v {
crate::model::certificate_authority::key_version_spec::KeyVersion::Algorithm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_algorithm<
T: std::convert::Into<crate::model::certificate_authority::SignHashAlgorithm>,
>(
mut self,
v: T,
) -> Self {
self.key_version = std::option::Option::Some(
crate::model::certificate_authority::key_version_spec::KeyVersion::Algorithm(
v.into(),
),
);
self
}
}
impl wkt::message::Message for KeyVersionSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec"
}
}
pub mod key_version_spec {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyVersion {
CloudKmsKeyVersion(std::string::String),
Algorithm(crate::model::certificate_authority::SignHashAlgorithm),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserDefinedAccessUrls {
pub aia_issuing_certificate_urls: std::vec::Vec<std::string::String>,
pub crl_access_urls: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserDefinedAccessUrls {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_aia_issuing_certificate_urls<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.aia_issuing_certificate_urls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_crl_access_urls<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.crl_access_urls = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UserDefinedAccessUrls {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
SelfSigned,
Subordinate,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SelfSigned => std::option::Option::Some(1),
Self::Subordinate => 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("TYPE_UNSPECIFIED"),
Self::SelfSigned => std::option::Option::Some("SELF_SIGNED"),
Self::Subordinate => std::option::Option::Some("SUBORDINATE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
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 Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SelfSigned,
2 => Self::Subordinate,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"SELF_SIGNED" => Self::SelfSigned,
"SUBORDINATE" => Self::Subordinate,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
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::SelfSigned => serializer.serialize_i32(1),
Self::Subordinate => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.security.privateca.v1.CertificateAuthority.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Enabled,
Disabled,
Staged,
AwaitingUserActivation,
Deleted,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::Staged => std::option::Option::Some(3),
Self::AwaitingUserActivation => std::option::Option::Some(4),
Self::Deleted => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Staged => std::option::Option::Some("STAGED"),
Self::AwaitingUserActivation => {
std::option::Option::Some("AWAITING_USER_ACTIVATION")
}
Self::Deleted => std::option::Option::Some("DELETED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
3 => Self::Staged,
4 => Self::AwaitingUserActivation,
5 => Self::Deleted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"STAGED" => Self::Staged,
"AWAITING_USER_ACTIVATION" => Self::AwaitingUserActivation,
"DELETED" => Self::Deleted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::Staged => serializer.serialize_i32(3),
Self::AwaitingUserActivation => serializer.serialize_i32(4),
Self::Deleted => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.security.privateca.v1.CertificateAuthority.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SignHashAlgorithm {
Unspecified,
RsaPss2048Sha256,
RsaPss3072Sha256,
RsaPss4096Sha256,
RsaPkcs12048Sha256,
RsaPkcs13072Sha256,
RsaPkcs14096Sha256,
EcP256Sha256,
EcP384Sha384,
UnknownValue(sign_hash_algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod sign_hash_algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SignHashAlgorithm {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RsaPss2048Sha256 => std::option::Option::Some(1),
Self::RsaPss3072Sha256 => std::option::Option::Some(2),
Self::RsaPss4096Sha256 => std::option::Option::Some(3),
Self::RsaPkcs12048Sha256 => std::option::Option::Some(6),
Self::RsaPkcs13072Sha256 => std::option::Option::Some(7),
Self::RsaPkcs14096Sha256 => std::option::Option::Some(8),
Self::EcP256Sha256 => std::option::Option::Some(4),
Self::EcP384Sha384 => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SIGN_HASH_ALGORITHM_UNSPECIFIED"),
Self::RsaPss2048Sha256 => std::option::Option::Some("RSA_PSS_2048_SHA256"),
Self::RsaPss3072Sha256 => std::option::Option::Some("RSA_PSS_3072_SHA256"),
Self::RsaPss4096Sha256 => std::option::Option::Some("RSA_PSS_4096_SHA256"),
Self::RsaPkcs12048Sha256 => std::option::Option::Some("RSA_PKCS1_2048_SHA256"),
Self::RsaPkcs13072Sha256 => std::option::Option::Some("RSA_PKCS1_3072_SHA256"),
Self::RsaPkcs14096Sha256 => std::option::Option::Some("RSA_PKCS1_4096_SHA256"),
Self::EcP256Sha256 => std::option::Option::Some("EC_P256_SHA256"),
Self::EcP384Sha384 => std::option::Option::Some("EC_P384_SHA384"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SignHashAlgorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SignHashAlgorithm {
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 SignHashAlgorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RsaPss2048Sha256,
2 => Self::RsaPss3072Sha256,
3 => Self::RsaPss4096Sha256,
4 => Self::EcP256Sha256,
5 => Self::EcP384Sha384,
6 => Self::RsaPkcs12048Sha256,
7 => Self::RsaPkcs13072Sha256,
8 => Self::RsaPkcs14096Sha256,
_ => Self::UnknownValue(sign_hash_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SignHashAlgorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SIGN_HASH_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
"RSA_PSS_2048_SHA256" => Self::RsaPss2048Sha256,
"RSA_PSS_3072_SHA256" => Self::RsaPss3072Sha256,
"RSA_PSS_4096_SHA256" => Self::RsaPss4096Sha256,
"RSA_PKCS1_2048_SHA256" => Self::RsaPkcs12048Sha256,
"RSA_PKCS1_3072_SHA256" => Self::RsaPkcs13072Sha256,
"RSA_PKCS1_4096_SHA256" => Self::RsaPkcs14096Sha256,
"EC_P256_SHA256" => Self::EcP256Sha256,
"EC_P384_SHA384" => Self::EcP384Sha384,
_ => Self::UnknownValue(sign_hash_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SignHashAlgorithm {
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::RsaPss2048Sha256 => serializer.serialize_i32(1),
Self::RsaPss3072Sha256 => serializer.serialize_i32(2),
Self::RsaPss4096Sha256 => serializer.serialize_i32(3),
Self::RsaPkcs12048Sha256 => serializer.serialize_i32(6),
Self::RsaPkcs13072Sha256 => serializer.serialize_i32(7),
Self::RsaPkcs14096Sha256 => serializer.serialize_i32(8),
Self::EcP256Sha256 => serializer.serialize_i32(4),
Self::EcP384Sha384 => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SignHashAlgorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignHashAlgorithm>::new(
".google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CaPool {
pub name: std::string::String,
pub tier: crate::model::ca_pool::Tier,
pub issuance_policy: std::option::Option<crate::model::ca_pool::IssuancePolicy>,
pub publishing_options: std::option::Option<crate::model::ca_pool::PublishingOptions>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CaPool {
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_tier<T: std::convert::Into<crate::model::ca_pool::Tier>>(mut self, v: T) -> Self {
self.tier = v.into();
self
}
pub fn set_issuance_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ca_pool::IssuancePolicy>,
{
self.issuance_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_issuance_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ca_pool::IssuancePolicy>,
{
self.issuance_policy = v.map(|x| x.into());
self
}
pub fn set_publishing_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ca_pool::PublishingOptions>,
{
self.publishing_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_publishing_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ca_pool::PublishingOptions>,
{
self.publishing_options = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CaPool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool"
}
}
pub mod ca_pool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PublishingOptions {
pub publish_ca_cert: bool,
pub publish_crl: bool,
pub encoding_format: crate::model::ca_pool::publishing_options::EncodingFormat,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PublishingOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_publish_ca_cert<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.publish_ca_cert = v.into();
self
}
pub fn set_publish_crl<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.publish_crl = v.into();
self
}
pub fn set_encoding_format<
T: std::convert::Into<crate::model::ca_pool::publishing_options::EncodingFormat>,
>(
mut self,
v: T,
) -> Self {
self.encoding_format = v.into();
self
}
}
impl wkt::message::Message for PublishingOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool.PublishingOptions"
}
}
pub mod publishing_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncodingFormat {
Unspecified,
Pem,
Der,
UnknownValue(encoding_format::UnknownValue),
}
#[doc(hidden)]
pub mod encoding_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EncodingFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pem => std::option::Option::Some(1),
Self::Der => 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("ENCODING_FORMAT_UNSPECIFIED"),
Self::Pem => std::option::Option::Some("PEM"),
Self::Der => std::option::Option::Some("DER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EncodingFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EncodingFormat {
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 EncodingFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pem,
2 => Self::Der,
_ => Self::UnknownValue(encoding_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EncodingFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENCODING_FORMAT_UNSPECIFIED" => Self::Unspecified,
"PEM" => Self::Pem,
"DER" => Self::Der,
_ => Self::UnknownValue(encoding_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EncodingFormat {
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::Pem => serializer.serialize_i32(1),
Self::Der => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EncodingFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncodingFormat>::new(
".google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IssuancePolicy {
pub allowed_key_types:
std::vec::Vec<crate::model::ca_pool::issuance_policy::AllowedKeyType>,
pub backdate_duration: std::option::Option<wkt::Duration>,
pub maximum_lifetime: std::option::Option<wkt::Duration>,
pub allowed_issuance_modes:
std::option::Option<crate::model::ca_pool::issuance_policy::IssuanceModes>,
pub baseline_values: std::option::Option<crate::model::X509Parameters>,
pub identity_constraints: std::option::Option<crate::model::CertificateIdentityConstraints>,
pub passthrough_extensions:
std::option::Option<crate::model::CertificateExtensionConstraints>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IssuancePolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_key_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ca_pool::issuance_policy::AllowedKeyType>,
{
use std::iter::Iterator;
self.allowed_key_types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_backdate_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.backdate_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backdate_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.backdate_duration = v.map(|x| x.into());
self
}
pub fn set_maximum_lifetime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.maximum_lifetime = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_maximum_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.maximum_lifetime = v.map(|x| x.into());
self
}
pub fn set_allowed_issuance_modes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ca_pool::issuance_policy::IssuanceModes>,
{
self.allowed_issuance_modes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allowed_issuance_modes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ca_pool::issuance_policy::IssuanceModes>,
{
self.allowed_issuance_modes = v.map(|x| x.into());
self
}
pub fn set_baseline_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.baseline_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_baseline_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.baseline_values = v.map(|x| x.into());
self
}
pub fn set_identity_constraints<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
{
self.identity_constraints = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_identity_constraints<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
{
self.identity_constraints = v.map(|x| x.into());
self
}
pub fn set_passthrough_extensions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
{
self.passthrough_extensions = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_passthrough_extensions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
{
self.passthrough_extensions = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IssuancePolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy"
}
}
pub mod issuance_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AllowedKeyType {
pub key_type: std::option::Option<
crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AllowedKeyType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_type<
T: std::convert::Into<
std::option::Option<
crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.key_type = v.into();
self
}
pub fn rsa(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType,
>,
> {
#[allow(unreachable_patterns)]
self.key_type.as_ref().and_then(|v| match v {
crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::Rsa(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_rsa<
T: std::convert::Into<
std::boxed::Box<
crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.key_type = std::option::Option::Some(
crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::Rsa(
v.into(),
),
);
self
}
pub fn elliptic_curve(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType,
>,
> {
#[allow(unreachable_patterns)]
self.key_type.as_ref().and_then(|v| match v {
crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::EllipticCurve(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_elliptic_curve<
T: std::convert::Into<
std::boxed::Box<
crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.key_type = std::option::Option::Some(
crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::EllipticCurve(
v.into()
)
);
self
}
}
impl wkt::message::Message for AllowedKeyType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType"
}
}
pub mod allowed_key_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RsaKeyType {
pub min_modulus_size: i64,
pub max_modulus_size: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RsaKeyType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_modulus_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.min_modulus_size = v.into();
self
}
pub fn set_max_modulus_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max_modulus_size = v.into();
self
}
}
impl wkt::message::Message for RsaKeyType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EcKeyType {
pub signature_algorithm: crate::model::ca_pool::issuance_policy::allowed_key_type::ec_key_type::EcSignatureAlgorithm,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EcKeyType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_signature_algorithm<T: std::convert::Into<crate::model::ca_pool::issuance_policy::allowed_key_type::ec_key_type::EcSignatureAlgorithm>>(mut self, v: T) -> Self{
self.signature_algorithm = v.into();
self
}
}
impl wkt::message::Message for EcKeyType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType"
}
}
pub mod ec_key_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EcSignatureAlgorithm {
Unspecified,
EcdsaP256,
EcdsaP384,
Eddsa25519,
UnknownValue(ec_signature_algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod ec_signature_algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EcSignatureAlgorithm {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::EcdsaP256 => std::option::Option::Some(1),
Self::EcdsaP384 => std::option::Option::Some(2),
Self::Eddsa25519 => 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("EC_SIGNATURE_ALGORITHM_UNSPECIFIED")
}
Self::EcdsaP256 => std::option::Option::Some("ECDSA_P256"),
Self::EcdsaP384 => std::option::Option::Some("ECDSA_P384"),
Self::Eddsa25519 => std::option::Option::Some("EDDSA_25519"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EcSignatureAlgorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EcSignatureAlgorithm {
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 EcSignatureAlgorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EcdsaP256,
2 => Self::EcdsaP384,
3 => Self::Eddsa25519,
_ => Self::UnknownValue(ec_signature_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EcSignatureAlgorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EC_SIGNATURE_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
"ECDSA_P256" => Self::EcdsaP256,
"ECDSA_P384" => Self::EcdsaP384,
"EDDSA_25519" => Self::Eddsa25519,
_ => Self::UnknownValue(ec_signature_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EcSignatureAlgorithm {
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::EcdsaP256 => serializer.serialize_i32(1),
Self::EcdsaP384 => serializer.serialize_i32(2),
Self::Eddsa25519 => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EcSignatureAlgorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EcSignatureAlgorithm>::new(
".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm"))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyType {
Rsa(
std::boxed::Box<
crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType,
>,
),
EllipticCurve(
std::boxed::Box<
crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType,
>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IssuanceModes {
pub allow_csr_based_issuance: bool,
pub allow_config_based_issuance: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IssuanceModes {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allow_csr_based_issuance<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.allow_csr_based_issuance = v.into();
self
}
pub fn set_allow_config_based_issuance<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.allow_config_based_issuance = v.into();
self
}
}
impl wkt::message::Message for IssuanceModes {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Tier {
Unspecified,
Enterprise,
Devops,
UnknownValue(tier::UnknownValue),
}
#[doc(hidden)]
pub mod tier {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Tier {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enterprise => std::option::Option::Some(1),
Self::Devops => 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("TIER_UNSPECIFIED"),
Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
Self::Devops => std::option::Option::Some("DEVOPS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Tier {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Tier {
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 Tier {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enterprise,
2 => Self::Devops,
_ => Self::UnknownValue(tier::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Tier {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TIER_UNSPECIFIED" => Self::Unspecified,
"ENTERPRISE" => Self::Enterprise,
"DEVOPS" => Self::Devops,
_ => Self::UnknownValue(tier::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Tier {
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::Enterprise => serializer.serialize_i32(1),
Self::Devops => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Tier {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
".google.cloud.security.privateca.v1.CaPool.Tier",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateRevocationList {
pub name: std::string::String,
pub sequence_number: i64,
pub revoked_certificates:
std::vec::Vec<crate::model::certificate_revocation_list::RevokedCertificate>,
pub pem_crl: std::string::String,
pub access_url: std::string::String,
pub state: crate::model::certificate_revocation_list::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub revision_id: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateRevocationList {
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_sequence_number<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.sequence_number = v.into();
self
}
pub fn set_revoked_certificates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::certificate_revocation_list::RevokedCertificate>,
{
use std::iter::Iterator;
self.revoked_certificates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_pem_crl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pem_crl = v.into();
self
}
pub fn set_access_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.access_url = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::certificate_revocation_list::State>>(
mut self,
v: T,
) -> Self {
self.state = 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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision_id = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CertificateRevocationList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateRevocationList"
}
}
pub mod certificate_revocation_list {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevokedCertificate {
pub certificate: std::string::String,
pub hex_serial_number: std::string::String,
pub revocation_reason: crate::model::RevocationReason,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevokedCertificate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.certificate = v.into();
self
}
pub fn set_hex_serial_number<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.hex_serial_number = v.into();
self
}
pub fn set_revocation_reason<T: std::convert::Into<crate::model::RevocationReason>>(
mut self,
v: T,
) -> Self {
self.revocation_reason = v.into();
self
}
}
impl wkt::message::Message for RevokedCertificate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Superseded,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Superseded => 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("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Superseded => std::option::Option::Some("SUPERSEDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Superseded,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"SUPERSEDED" => Self::Superseded,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Active => serializer.serialize_i32(1),
Self::Superseded => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.security.privateca.v1.CertificateRevocationList.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Certificate {
pub name: std::string::String,
pub issuer_certificate_authority: std::string::String,
pub lifetime: std::option::Option<wkt::Duration>,
pub certificate_template: std::string::String,
pub subject_mode: crate::model::SubjectRequestMode,
pub revocation_details: std::option::Option<crate::model::certificate::RevocationDetails>,
pub pem_certificate: std::string::String,
pub certificate_description: std::option::Option<crate::model::CertificateDescription>,
pub pem_certificate_chain: std::vec::Vec<std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub certificate_config: std::option::Option<crate::model::certificate::CertificateConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Certificate {
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_issuer_certificate_authority<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.issuer_certificate_authority = v.into();
self
}
pub fn set_lifetime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lifetime = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lifetime = v.map(|x| x.into());
self
}
pub fn set_certificate_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.certificate_template = v.into();
self
}
pub fn set_subject_mode<T: std::convert::Into<crate::model::SubjectRequestMode>>(
mut self,
v: T,
) -> Self {
self.subject_mode = v.into();
self
}
pub fn set_revocation_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate::RevocationDetails>,
{
self.revocation_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revocation_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate::RevocationDetails>,
{
self.revocation_details = v.map(|x| x.into());
self
}
pub fn set_pem_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pem_certificate = v.into();
self
}
pub fn set_certificate_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateDescription>,
{
self.certificate_description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateDescription>,
{
self.certificate_description = v.map(|x| x.into());
self
}
pub fn set_pem_certificate_chain<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.pem_certificate_chain = v.into_iter().map(|i| i.into()).collect();
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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_certificate_config<
T: std::convert::Into<std::option::Option<crate::model::certificate::CertificateConfig>>,
>(
mut self,
v: T,
) -> Self {
self.certificate_config = v.into();
self
}
pub fn pem_csr(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.certificate_config.as_ref().and_then(|v| match v {
crate::model::certificate::CertificateConfig::PemCsr(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_pem_csr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.certificate_config = std::option::Option::Some(
crate::model::certificate::CertificateConfig::PemCsr(v.into()),
);
self
}
pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::CertificateConfig>> {
#[allow(unreachable_patterns)]
self.certificate_config.as_ref().and_then(|v| match v {
crate::model::certificate::CertificateConfig::Config(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::CertificateConfig>>>(
mut self,
v: T,
) -> Self {
self.certificate_config = std::option::Option::Some(
crate::model::certificate::CertificateConfig::Config(v.into()),
);
self
}
}
impl wkt::message::Message for Certificate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.Certificate"
}
}
pub mod certificate {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevocationDetails {
pub revocation_state: crate::model::RevocationReason,
pub revocation_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevocationDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_revocation_state<T: std::convert::Into<crate::model::RevocationReason>>(
mut self,
v: T,
) -> Self {
self.revocation_state = v.into();
self
}
pub fn set_revocation_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revocation_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revocation_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revocation_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RevocationDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.Certificate.RevocationDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CertificateConfig {
PemCsr(std::string::String),
Config(std::boxed::Box<crate::model::CertificateConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateTemplate {
pub name: std::string::String,
pub maximum_lifetime: std::option::Option<wkt::Duration>,
pub predefined_values: std::option::Option<crate::model::X509Parameters>,
pub identity_constraints: std::option::Option<crate::model::CertificateIdentityConstraints>,
pub passthrough_extensions: std::option::Option<crate::model::CertificateExtensionConstraints>,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateTemplate {
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_maximum_lifetime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.maximum_lifetime = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_maximum_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.maximum_lifetime = v.map(|x| x.into());
self
}
pub fn set_predefined_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.predefined_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_predefined_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.predefined_values = v.map(|x| x.into());
self
}
pub fn set_identity_constraints<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
{
self.identity_constraints = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_identity_constraints<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
{
self.identity_constraints = v.map(|x| x.into());
self
}
pub fn set_passthrough_extensions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
{
self.passthrough_extensions = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_passthrough_extensions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
{
self.passthrough_extensions = v.map(|x| x.into());
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = 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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CertificateTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateTemplate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct X509Parameters {
pub key_usage: std::option::Option<crate::model::KeyUsage>,
pub ca_options: std::option::Option<crate::model::x_509_parameters::CaOptions>,
pub policy_ids: std::vec::Vec<crate::model::ObjectId>,
pub aia_ocsp_servers: std::vec::Vec<std::string::String>,
pub name_constraints: std::option::Option<crate::model::x_509_parameters::NameConstraints>,
pub additional_extensions: std::vec::Vec<crate::model::X509Extension>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl X509Parameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_usage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KeyUsage>,
{
self.key_usage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_key_usage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KeyUsage>,
{
self.key_usage = v.map(|x| x.into());
self
}
pub fn set_ca_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::x_509_parameters::CaOptions>,
{
self.ca_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ca_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::x_509_parameters::CaOptions>,
{
self.ca_options = v.map(|x| x.into());
self
}
pub fn set_policy_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ObjectId>,
{
use std::iter::Iterator;
self.policy_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_aia_ocsp_servers<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.aia_ocsp_servers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_name_constraints<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::x_509_parameters::NameConstraints>,
{
self.name_constraints = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_name_constraints<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::x_509_parameters::NameConstraints>,
{
self.name_constraints = v.map(|x| x.into());
self
}
pub fn set_additional_extensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::X509Extension>,
{
use std::iter::Iterator;
self.additional_extensions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for X509Parameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.X509Parameters"
}
}
pub mod x_509_parameters {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CaOptions {
pub is_ca: std::option::Option<bool>,
pub max_issuer_path_length: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CaOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_is_ca<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.is_ca = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_is_ca<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.is_ca = v.map(|x| x.into());
self
}
pub fn set_max_issuer_path_length<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_issuer_path_length = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_issuer_path_length<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_issuer_path_length = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CaOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.X509Parameters.CaOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NameConstraints {
pub critical: bool,
pub permitted_dns_names: std::vec::Vec<std::string::String>,
pub excluded_dns_names: std::vec::Vec<std::string::String>,
pub permitted_ip_ranges: std::vec::Vec<std::string::String>,
pub excluded_ip_ranges: std::vec::Vec<std::string::String>,
pub permitted_email_addresses: std::vec::Vec<std::string::String>,
pub excluded_email_addresses: std::vec::Vec<std::string::String>,
pub permitted_uris: std::vec::Vec<std::string::String>,
pub excluded_uris: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NameConstraints {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_critical<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.critical = v.into();
self
}
pub fn set_permitted_dns_names<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.permitted_dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_excluded_dns_names<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.excluded_dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_permitted_ip_ranges<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.permitted_ip_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_excluded_ip_ranges<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.excluded_ip_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_permitted_email_addresses<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.permitted_email_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_excluded_email_addresses<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.excluded_email_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_permitted_uris<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.permitted_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_excluded_uris<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.excluded_uris = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NameConstraints {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.X509Parameters.NameConstraints"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubordinateConfig {
pub subordinate_config:
std::option::Option<crate::model::subordinate_config::SubordinateConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubordinateConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subordinate_config<
T: std::convert::Into<
std::option::Option<crate::model::subordinate_config::SubordinateConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.subordinate_config = v.into();
self
}
pub fn certificate_authority(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.subordinate_config.as_ref().and_then(|v| match v {
crate::model::subordinate_config::SubordinateConfig::CertificateAuthority(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_certificate_authority<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.subordinate_config = std::option::Option::Some(
crate::model::subordinate_config::SubordinateConfig::CertificateAuthority(v.into()),
);
self
}
pub fn pem_issuer_chain(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::subordinate_config::SubordinateConfigChain>,
> {
#[allow(unreachable_patterns)]
self.subordinate_config.as_ref().and_then(|v| match v {
crate::model::subordinate_config::SubordinateConfig::PemIssuerChain(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_pem_issuer_chain<
T: std::convert::Into<
std::boxed::Box<crate::model::subordinate_config::SubordinateConfigChain>,
>,
>(
mut self,
v: T,
) -> Self {
self.subordinate_config = std::option::Option::Some(
crate::model::subordinate_config::SubordinateConfig::PemIssuerChain(v.into()),
);
self
}
}
impl wkt::message::Message for SubordinateConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.SubordinateConfig"
}
}
pub mod subordinate_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubordinateConfigChain {
pub pem_certificates: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubordinateConfigChain {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pem_certificates<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.pem_certificates = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SubordinateConfigChain {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SubordinateConfig {
CertificateAuthority(std::string::String),
PemIssuerChain(std::boxed::Box<crate::model::subordinate_config::SubordinateConfigChain>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PublicKey {
pub key: ::bytes::Bytes,
pub format: crate::model::public_key::KeyFormat,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PublicKey {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_format<T: std::convert::Into<crate::model::public_key::KeyFormat>>(
mut self,
v: T,
) -> Self {
self.format = v.into();
self
}
}
impl wkt::message::Message for PublicKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.PublicKey"
}
}
pub mod public_key {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyFormat {
Unspecified,
Pem,
UnknownValue(key_format::UnknownValue),
}
#[doc(hidden)]
pub mod key_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KeyFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pem => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("KEY_FORMAT_UNSPECIFIED"),
Self::Pem => std::option::Option::Some("PEM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KeyFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KeyFormat {
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 KeyFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pem,
_ => Self::UnknownValue(key_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KeyFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KEY_FORMAT_UNSPECIFIED" => Self::Unspecified,
"PEM" => Self::Pem,
_ => Self::UnknownValue(key_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KeyFormat {
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::Pem => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KeyFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<KeyFormat>::new(
".google.cloud.security.privateca.v1.PublicKey.KeyFormat",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateConfig {
pub subject_config: std::option::Option<crate::model::certificate_config::SubjectConfig>,
pub x509_config: std::option::Option<crate::model::X509Parameters>,
pub public_key: std::option::Option<crate::model::PublicKey>,
pub subject_key_id: std::option::Option<crate::model::certificate_config::KeyId>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subject_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_config::SubjectConfig>,
{
self.subject_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_config::SubjectConfig>,
{
self.subject_config = v.map(|x| x.into());
self
}
pub fn set_x509_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.x509_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_x509_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.x509_config = v.map(|x| x.into());
self
}
pub fn set_public_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PublicKey>,
{
self.public_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_public_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PublicKey>,
{
self.public_key = v.map(|x| x.into());
self
}
pub fn set_subject_key_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_config::KeyId>,
{
self.subject_key_id = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject_key_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_config::KeyId>,
{
self.subject_key_id = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CertificateConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateConfig"
}
}
pub mod certificate_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubjectConfig {
pub subject: std::option::Option<crate::model::Subject>,
pub subject_alt_name: std::option::Option<crate::model::SubjectAltNames>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubjectConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subject<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Subject>,
{
self.subject = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Subject>,
{
self.subject = v.map(|x| x.into());
self
}
pub fn set_subject_alt_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SubjectAltNames>,
{
self.subject_alt_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject_alt_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SubjectAltNames>,
{
self.subject_alt_name = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SubjectConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyId {
pub key_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyId {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_id = v.into();
self
}
}
impl wkt::message::Message for KeyId {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateConfig.KeyId"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateDescription {
pub subject_description:
std::option::Option<crate::model::certificate_description::SubjectDescription>,
pub x509_description: std::option::Option<crate::model::X509Parameters>,
pub public_key: std::option::Option<crate::model::PublicKey>,
pub subject_key_id: std::option::Option<crate::model::certificate_description::KeyId>,
pub authority_key_id: std::option::Option<crate::model::certificate_description::KeyId>,
pub crl_distribution_points: std::vec::Vec<std::string::String>,
pub aia_issuing_certificate_urls: std::vec::Vec<std::string::String>,
pub cert_fingerprint:
std::option::Option<crate::model::certificate_description::CertificateFingerprint>,
pub tbs_certificate_digest: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateDescription {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subject_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_description::SubjectDescription>,
{
self.subject_description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_description::SubjectDescription>,
{
self.subject_description = v.map(|x| x.into());
self
}
pub fn set_x509_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.x509_description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_x509_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::X509Parameters>,
{
self.x509_description = v.map(|x| x.into());
self
}
pub fn set_public_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PublicKey>,
{
self.public_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_public_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PublicKey>,
{
self.public_key = v.map(|x| x.into());
self
}
pub fn set_subject_key_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_description::KeyId>,
{
self.subject_key_id = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject_key_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_description::KeyId>,
{
self.subject_key_id = v.map(|x| x.into());
self
}
pub fn set_authority_key_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_description::KeyId>,
{
self.authority_key_id = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_authority_key_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_description::KeyId>,
{
self.authority_key_id = v.map(|x| x.into());
self
}
pub fn set_crl_distribution_points<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.crl_distribution_points = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_aia_issuing_certificate_urls<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.aia_issuing_certificate_urls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cert_fingerprint<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::certificate_description::CertificateFingerprint>,
{
self.cert_fingerprint = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cert_fingerprint<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::certificate_description::CertificateFingerprint>,
{
self.cert_fingerprint = v.map(|x| x.into());
self
}
pub fn set_tbs_certificate_digest<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.tbs_certificate_digest = v.into();
self
}
}
impl wkt::message::Message for CertificateDescription {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription"
}
}
pub mod certificate_description {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubjectDescription {
pub subject: std::option::Option<crate::model::Subject>,
pub subject_alt_name: std::option::Option<crate::model::SubjectAltNames>,
pub hex_serial_number: std::string::String,
pub lifetime: std::option::Option<wkt::Duration>,
pub not_before_time: std::option::Option<wkt::Timestamp>,
pub not_after_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubjectDescription {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subject<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Subject>,
{
self.subject = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Subject>,
{
self.subject = v.map(|x| x.into());
self
}
pub fn set_subject_alt_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SubjectAltNames>,
{
self.subject_alt_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subject_alt_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SubjectAltNames>,
{
self.subject_alt_name = v.map(|x| x.into());
self
}
pub fn set_hex_serial_number<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.hex_serial_number = v.into();
self
}
pub fn set_lifetime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lifetime = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lifetime = v.map(|x| x.into());
self
}
pub fn set_not_before_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.not_before_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_not_before_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.not_before_time = v.map(|x| x.into());
self
}
pub fn set_not_after_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.not_after_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_not_after_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.not_after_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SubjectDescription {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyId {
pub key_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyId {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_id = v.into();
self
}
}
impl wkt::message::Message for KeyId {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription.KeyId"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateFingerprint {
pub sha256_hash: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateFingerprint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sha256_hash<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sha256_hash = v.into();
self
}
}
impl wkt::message::Message for CertificateFingerprint {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectId {
pub object_id_path: std::vec::Vec<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ObjectId {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_object_id_path<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i32>,
{
use std::iter::Iterator;
self.object_id_path = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ObjectId {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ObjectId"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct X509Extension {
pub object_id: std::option::Option<crate::model::ObjectId>,
pub critical: bool,
pub value: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl X509Extension {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_object_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ObjectId>,
{
self.object_id = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_object_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ObjectId>,
{
self.object_id = v.map(|x| x.into());
self
}
pub fn set_critical<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.critical = v.into();
self
}
pub fn set_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for X509Extension {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.X509Extension"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyUsage {
pub base_key_usage: std::option::Option<crate::model::key_usage::KeyUsageOptions>,
pub extended_key_usage: std::option::Option<crate::model::key_usage::ExtendedKeyUsageOptions>,
pub unknown_extended_key_usages: std::vec::Vec<crate::model::ObjectId>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyUsage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_base_key_usage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::key_usage::KeyUsageOptions>,
{
self.base_key_usage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_base_key_usage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::key_usage::KeyUsageOptions>,
{
self.base_key_usage = v.map(|x| x.into());
self
}
pub fn set_extended_key_usage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::key_usage::ExtendedKeyUsageOptions>,
{
self.extended_key_usage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_extended_key_usage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::key_usage::ExtendedKeyUsageOptions>,
{
self.extended_key_usage = v.map(|x| x.into());
self
}
pub fn set_unknown_extended_key_usages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ObjectId>,
{
use std::iter::Iterator;
self.unknown_extended_key_usages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for KeyUsage {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.KeyUsage"
}
}
pub mod key_usage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyUsageOptions {
pub digital_signature: bool,
pub content_commitment: bool,
pub key_encipherment: bool,
pub data_encipherment: bool,
pub key_agreement: bool,
pub cert_sign: bool,
pub crl_sign: bool,
pub encipher_only: bool,
pub decipher_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyUsageOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_digital_signature<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.digital_signature = v.into();
self
}
pub fn set_content_commitment<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.content_commitment = v.into();
self
}
pub fn set_key_encipherment<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.key_encipherment = v.into();
self
}
pub fn set_data_encipherment<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.data_encipherment = v.into();
self
}
pub fn set_key_agreement<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.key_agreement = v.into();
self
}
pub fn set_cert_sign<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.cert_sign = v.into();
self
}
pub fn set_crl_sign<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.crl_sign = v.into();
self
}
pub fn set_encipher_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.encipher_only = v.into();
self
}
pub fn set_decipher_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.decipher_only = v.into();
self
}
}
impl wkt::message::Message for KeyUsageOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExtendedKeyUsageOptions {
pub server_auth: bool,
pub client_auth: bool,
pub code_signing: bool,
pub email_protection: bool,
pub time_stamping: bool,
pub ocsp_signing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExtendedKeyUsageOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_server_auth<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.server_auth = v.into();
self
}
pub fn set_client_auth<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.client_auth = v.into();
self
}
pub fn set_code_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.code_signing = v.into();
self
}
pub fn set_email_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.email_protection = v.into();
self
}
pub fn set_time_stamping<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.time_stamping = v.into();
self
}
pub fn set_ocsp_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ocsp_signing = v.into();
self
}
}
impl wkt::message::Message for ExtendedKeyUsageOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttributeTypeAndValue {
pub value: std::string::String,
pub attribute_type: std::option::Option<crate::model::attribute_type_and_value::AttributeType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttributeTypeAndValue {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
pub fn set_attribute_type<
T: std::convert::Into<
std::option::Option<crate::model::attribute_type_and_value::AttributeType>,
>,
>(
mut self,
v: T,
) -> Self {
self.attribute_type = v.into();
self
}
pub fn r#type(&self) -> std::option::Option<&crate::model::AttributeType> {
#[allow(unreachable_patterns)]
self.attribute_type.as_ref().and_then(|v| match v {
crate::model::attribute_type_and_value::AttributeType::Type(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_type<T: std::convert::Into<crate::model::AttributeType>>(mut self, v: T) -> Self {
self.attribute_type = std::option::Option::Some(
crate::model::attribute_type_and_value::AttributeType::Type(v.into()),
);
self
}
pub fn object_id(&self) -> std::option::Option<&std::boxed::Box<crate::model::ObjectId>> {
#[allow(unreachable_patterns)]
self.attribute_type.as_ref().and_then(|v| match v {
crate::model::attribute_type_and_value::AttributeType::ObjectId(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_object_id<T: std::convert::Into<std::boxed::Box<crate::model::ObjectId>>>(
mut self,
v: T,
) -> Self {
self.attribute_type = std::option::Option::Some(
crate::model::attribute_type_and_value::AttributeType::ObjectId(v.into()),
);
self
}
}
impl wkt::message::Message for AttributeTypeAndValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.AttributeTypeAndValue"
}
}
pub mod attribute_type_and_value {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AttributeType {
Type(crate::model::AttributeType),
ObjectId(std::boxed::Box<crate::model::ObjectId>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RelativeDistinguishedName {
pub attributes: std::vec::Vec<crate::model::AttributeTypeAndValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RelativeDistinguishedName {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attributes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AttributeTypeAndValue>,
{
use std::iter::Iterator;
self.attributes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RelativeDistinguishedName {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.RelativeDistinguishedName"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Subject {
pub common_name: std::string::String,
pub country_code: std::string::String,
pub organization: std::string::String,
pub organizational_unit: std::string::String,
pub locality: std::string::String,
pub province: std::string::String,
pub street_address: std::string::String,
pub postal_code: std::string::String,
pub rdn_sequence: std::vec::Vec<crate::model::RelativeDistinguishedName>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Subject {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.common_name = v.into();
self
}
pub fn set_country_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.country_code = v.into();
self
}
pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.organization = v.into();
self
}
pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.organizational_unit = v.into();
self
}
pub fn set_locality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.locality = v.into();
self
}
pub fn set_province<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.province = v.into();
self
}
pub fn set_street_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.street_address = v.into();
self
}
pub fn set_postal_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.postal_code = v.into();
self
}
pub fn set_rdn_sequence<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RelativeDistinguishedName>,
{
use std::iter::Iterator;
self.rdn_sequence = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Subject {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.Subject"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubjectAltNames {
pub dns_names: std::vec::Vec<std::string::String>,
pub uris: std::vec::Vec<std::string::String>,
pub email_addresses: std::vec::Vec<std::string::String>,
pub ip_addresses: std::vec::Vec<std::string::String>,
pub custom_sans: std::vec::Vec<crate::model::X509Extension>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubjectAltNames {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dns_names<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.dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_uris<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.uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_email_addresses<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.email_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_ip_addresses<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.ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_custom_sans<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::X509Extension>,
{
use std::iter::Iterator;
self.custom_sans = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SubjectAltNames {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.SubjectAltNames"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateIdentityConstraints {
pub cel_expression: std::option::Option<google_cloud_type::model::Expr>,
pub allow_subject_passthrough: std::option::Option<bool>,
pub allow_subject_alt_names_passthrough: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateIdentityConstraints {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cel_expression<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.cel_expression = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cel_expression<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.cel_expression = v.map(|x| x.into());
self
}
pub fn set_allow_subject_passthrough<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.allow_subject_passthrough = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allow_subject_passthrough<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.allow_subject_passthrough = v.map(|x| x.into());
self
}
pub fn set_allow_subject_alt_names_passthrough<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.allow_subject_alt_names_passthrough = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allow_subject_alt_names_passthrough<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.allow_subject_alt_names_passthrough = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CertificateIdentityConstraints {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateIdentityConstraints"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateExtensionConstraints {
pub known_extensions:
std::vec::Vec<crate::model::certificate_extension_constraints::KnownCertificateExtension>,
pub additional_extensions: std::vec::Vec<crate::model::ObjectId>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateExtensionConstraints {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_known_extensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<
crate::model::certificate_extension_constraints::KnownCertificateExtension,
>,
{
use std::iter::Iterator;
self.known_extensions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_additional_extensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ObjectId>,
{
use std::iter::Iterator;
self.additional_extensions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CertificateExtensionConstraints {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CertificateExtensionConstraints"
}
}
pub mod certificate_extension_constraints {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KnownCertificateExtension {
Unspecified,
BaseKeyUsage,
ExtendedKeyUsage,
CaOptions,
PolicyIds,
AiaOcspServers,
NameConstraints,
UnknownValue(known_certificate_extension::UnknownValue),
}
#[doc(hidden)]
pub mod known_certificate_extension {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KnownCertificateExtension {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::BaseKeyUsage => std::option::Option::Some(1),
Self::ExtendedKeyUsage => std::option::Option::Some(2),
Self::CaOptions => std::option::Option::Some(3),
Self::PolicyIds => std::option::Option::Some(4),
Self::AiaOcspServers => std::option::Option::Some(5),
Self::NameConstraints => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED")
}
Self::BaseKeyUsage => std::option::Option::Some("BASE_KEY_USAGE"),
Self::ExtendedKeyUsage => std::option::Option::Some("EXTENDED_KEY_USAGE"),
Self::CaOptions => std::option::Option::Some("CA_OPTIONS"),
Self::PolicyIds => std::option::Option::Some("POLICY_IDS"),
Self::AiaOcspServers => std::option::Option::Some("AIA_OCSP_SERVERS"),
Self::NameConstraints => std::option::Option::Some("NAME_CONSTRAINTS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KnownCertificateExtension {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KnownCertificateExtension {
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 KnownCertificateExtension {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::BaseKeyUsage,
2 => Self::ExtendedKeyUsage,
3 => Self::CaOptions,
4 => Self::PolicyIds,
5 => Self::AiaOcspServers,
6 => Self::NameConstraints,
_ => Self::UnknownValue(known_certificate_extension::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KnownCertificateExtension {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED" => Self::Unspecified,
"BASE_KEY_USAGE" => Self::BaseKeyUsage,
"EXTENDED_KEY_USAGE" => Self::ExtendedKeyUsage,
"CA_OPTIONS" => Self::CaOptions,
"POLICY_IDS" => Self::PolicyIds,
"AIA_OCSP_SERVERS" => Self::AiaOcspServers,
"NAME_CONSTRAINTS" => Self::NameConstraints,
_ => Self::UnknownValue(known_certificate_extension::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KnownCertificateExtension {
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::BaseKeyUsage => serializer.serialize_i32(1),
Self::ExtendedKeyUsage => serializer.serialize_i32(2),
Self::CaOptions => serializer.serialize_i32(3),
Self::PolicyIds => serializer.serialize_i32(4),
Self::AiaOcspServers => serializer.serialize_i32(5),
Self::NameConstraints => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KnownCertificateExtension {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<KnownCertificateExtension>::new(
".google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCertificateRequest {
pub parent: std::string::String,
pub certificate_id: std::string::String,
pub certificate: std::option::Option<crate::model::Certificate>,
pub request_id: std::string::String,
pub validate_only: bool,
pub issuing_certificate_authority_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCertificateRequest {
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_certificate_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.certificate_id = v.into();
self
}
pub fn set_certificate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Certificate>,
{
self.certificate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Certificate>,
{
self.certificate = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_issuing_certificate_authority_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.issuing_certificate_authority_id = v.into();
self
}
}
impl wkt::message::Message for CreateCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CreateCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCertificateRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCertificateRequest {
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
}
}
impl wkt::message::Message for GetCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificatesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificatesRequest {
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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListCertificatesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificatesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificatesResponse {
pub certificates: std::vec::Vec<crate::model::Certificate>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificatesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Certificate>,
{
use std::iter::Iterator;
self.certificates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListCertificatesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificatesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCertificatesResponse {
type PageItem = crate::model::Certificate;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.certificates
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevokeCertificateRequest {
pub name: std::string::String,
pub reason: crate::model::RevocationReason,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevokeCertificateRequest {
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_reason<T: std::convert::Into<crate::model::RevocationReason>>(
mut self,
v: T,
) -> Self {
self.reason = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for RevokeCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.RevokeCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCertificateRequest {
pub certificate: std::option::Option<crate::model::Certificate>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Certificate>,
{
self.certificate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Certificate>,
{
self.certificate = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActivateCertificateAuthorityRequest {
pub name: std::string::String,
pub pem_ca_certificate: std::string::String,
pub subordinate_config: std::option::Option<crate::model::SubordinateConfig>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ActivateCertificateAuthorityRequest {
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_pem_ca_certificate<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.pem_ca_certificate = v.into();
self
}
pub fn set_subordinate_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SubordinateConfig>,
{
self.subordinate_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subordinate_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SubordinateConfig>,
{
self.subordinate_config = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for ActivateCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCertificateAuthorityRequest {
pub parent: std::string::String,
pub certificate_authority_id: std::string::String,
pub certificate_authority: std::option::Option<crate::model::CertificateAuthority>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCertificateAuthorityRequest {
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_certificate_authority_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.certificate_authority_id = v.into();
self
}
pub fn set_certificate_authority<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateAuthority>,
{
self.certificate_authority = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate_authority<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateAuthority>,
{
self.certificate_authority = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableCertificateAuthorityRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub ignore_dependent_resources: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisableCertificateAuthorityRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_ignore_dependent_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_dependent_resources = v.into();
self
}
}
impl wkt::message::Message for DisableCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnableCertificateAuthorityRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnableCertificateAuthorityRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for EnableCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchCertificateAuthorityCsrRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchCertificateAuthorityCsrRequest {
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
}
}
impl wkt::message::Message for FetchCertificateAuthorityCsrRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchCertificateAuthorityCsrResponse {
pub pem_csr: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchCertificateAuthorityCsrResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pem_csr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pem_csr = v.into();
self
}
}
impl wkt::message::Message for FetchCertificateAuthorityCsrResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCertificateAuthorityRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCertificateAuthorityRequest {
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
}
}
impl wkt::message::Message for GetCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificateAuthoritiesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificateAuthoritiesRequest {
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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListCertificateAuthoritiesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificateAuthoritiesResponse {
pub certificate_authorities: std::vec::Vec<crate::model::CertificateAuthority>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificateAuthoritiesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_authorities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CertificateAuthority>,
{
use std::iter::Iterator;
self.certificate_authorities = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListCertificateAuthoritiesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListCertificateAuthoritiesResponse
{
type PageItem = crate::model::CertificateAuthority;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.certificate_authorities
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteCertificateAuthorityRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteCertificateAuthorityRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UndeleteCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCertificateAuthorityRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub ignore_active_certificates: bool,
pub skip_grace_period: bool,
pub ignore_dependent_resources: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCertificateAuthorityRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_ignore_active_certificates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_active_certificates = v.into();
self
}
pub fn set_skip_grace_period<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_grace_period = v.into();
self
}
pub fn set_ignore_dependent_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_dependent_resources = v.into();
self
}
}
impl wkt::message::Message for DeleteCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCertificateAuthorityRequest {
pub certificate_authority: std::option::Option<crate::model::CertificateAuthority>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCertificateAuthorityRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_authority<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateAuthority>,
{
self.certificate_authority = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate_authority<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateAuthority>,
{
self.certificate_authority = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateCertificateAuthorityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCaPoolRequest {
pub parent: std::string::String,
pub ca_pool_id: std::string::String,
pub ca_pool: std::option::Option<crate::model::CaPool>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCaPoolRequest {
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_ca_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ca_pool_id = v.into();
self
}
pub fn set_ca_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CaPool>,
{
self.ca_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CaPool>,
{
self.ca_pool = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateCaPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CreateCaPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCaPoolRequest {
pub ca_pool: std::option::Option<crate::model::CaPool>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCaPoolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CaPool>,
{
self.ca_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CaPool>,
{
self.ca_pool = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateCaPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.UpdateCaPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCaPoolRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub ignore_dependent_resources: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCaPoolRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_ignore_dependent_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_dependent_resources = v.into();
self
}
}
impl wkt::message::Message for DeleteCaPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.DeleteCaPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchCaCertsRequest {
pub ca_pool: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchCaCertsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ca_pool = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for FetchCaCertsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.FetchCaCertsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchCaCertsResponse {
pub ca_certs: std::vec::Vec<crate::model::fetch_ca_certs_response::CertChain>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchCaCertsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::fetch_ca_certs_response::CertChain>,
{
use std::iter::Iterator;
self.ca_certs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FetchCaCertsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.FetchCaCertsResponse"
}
}
pub mod fetch_ca_certs_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertChain {
pub certificates: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertChain {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificates<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.certificates = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CertChain {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCaPoolRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCaPoolRequest {
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
}
}
impl wkt::message::Message for GetCaPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.GetCaPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCaPoolsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCaPoolsRequest {
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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListCaPoolsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCaPoolsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCaPoolsResponse {
pub ca_pools: std::vec::Vec<crate::model::CaPool>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCaPoolsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_pools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CaPool>,
{
use std::iter::Iterator;
self.ca_pools = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListCaPoolsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCaPoolsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCaPoolsResponse {
type PageItem = crate::model::CaPool;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.ca_pools
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCertificateRevocationListRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCertificateRevocationListRequest {
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
}
}
impl wkt::message::Message for GetCertificateRevocationListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateRevocationListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificateRevocationListsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificateRevocationListsRequest {
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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListCertificateRevocationListsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificateRevocationListsResponse {
pub certificate_revocation_lists: std::vec::Vec<crate::model::CertificateRevocationList>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificateRevocationListsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_revocation_lists<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CertificateRevocationList>,
{
use std::iter::Iterator;
self.certificate_revocation_lists = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListCertificateRevocationListsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListCertificateRevocationListsResponse
{
type PageItem = crate::model::CertificateRevocationList;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.certificate_revocation_lists
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCertificateRevocationListRequest {
pub certificate_revocation_list: std::option::Option<crate::model::CertificateRevocationList>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCertificateRevocationListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_revocation_list<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateRevocationList>,
{
self.certificate_revocation_list = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate_revocation_list<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateRevocationList>,
{
self.certificate_revocation_list = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateCertificateRevocationListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCertificateTemplateRequest {
pub parent: std::string::String,
pub certificate_template_id: std::string::String,
pub certificate_template: std::option::Option<crate::model::CertificateTemplate>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCertificateTemplateRequest {
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_certificate_template_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.certificate_template_id = v.into();
self
}
pub fn set_certificate_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateTemplate>,
{
self.certificate_template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateTemplate>,
{
self.certificate_template = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateCertificateTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.CreateCertificateTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCertificateTemplateRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCertificateTemplateRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteCertificateTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCertificateTemplateRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCertificateTemplateRequest {
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
}
}
impl wkt::message::Message for GetCertificateTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificateTemplatesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificateTemplatesRequest {
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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListCertificateTemplatesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateTemplatesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCertificateTemplatesResponse {
pub certificate_templates: std::vec::Vec<crate::model::CertificateTemplate>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCertificateTemplatesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_templates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CertificateTemplate>,
{
use std::iter::Iterator;
self.certificate_templates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListCertificateTemplatesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateTemplatesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCertificateTemplatesResponse {
type PageItem = crate::model::CertificateTemplate;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.certificate_templates
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCertificateTemplateRequest {
pub certificate_template: std::option::Option<crate::model::CertificateTemplate>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCertificateTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CertificateTemplate>,
{
self.certificate_template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_certificate_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CertificateTemplate>,
{
self.certificate_template = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateCertificateTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.security.privateca.v1.OperationMetadata"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AttributeType {
Unspecified,
CommonName,
CountryCode,
Organization,
OrganizationalUnit,
Locality,
Province,
StreetAddress,
PostalCode,
UnknownValue(attribute_type::UnknownValue),
}
#[doc(hidden)]
pub mod attribute_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AttributeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CommonName => std::option::Option::Some(1),
Self::CountryCode => std::option::Option::Some(2),
Self::Organization => std::option::Option::Some(3),
Self::OrganizationalUnit => std::option::Option::Some(4),
Self::Locality => std::option::Option::Some(5),
Self::Province => std::option::Option::Some(6),
Self::StreetAddress => std::option::Option::Some(7),
Self::PostalCode => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ATTRIBUTE_TYPE_UNSPECIFIED"),
Self::CommonName => std::option::Option::Some("COMMON_NAME"),
Self::CountryCode => std::option::Option::Some("COUNTRY_CODE"),
Self::Organization => std::option::Option::Some("ORGANIZATION"),
Self::OrganizationalUnit => std::option::Option::Some("ORGANIZATIONAL_UNIT"),
Self::Locality => std::option::Option::Some("LOCALITY"),
Self::Province => std::option::Option::Some("PROVINCE"),
Self::StreetAddress => std::option::Option::Some("STREET_ADDRESS"),
Self::PostalCode => std::option::Option::Some("POSTAL_CODE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AttributeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AttributeType {
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 AttributeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CommonName,
2 => Self::CountryCode,
3 => Self::Organization,
4 => Self::OrganizationalUnit,
5 => Self::Locality,
6 => Self::Province,
7 => Self::StreetAddress,
8 => Self::PostalCode,
_ => Self::UnknownValue(attribute_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AttributeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ATTRIBUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
"COMMON_NAME" => Self::CommonName,
"COUNTRY_CODE" => Self::CountryCode,
"ORGANIZATION" => Self::Organization,
"ORGANIZATIONAL_UNIT" => Self::OrganizationalUnit,
"LOCALITY" => Self::Locality,
"PROVINCE" => Self::Province,
"STREET_ADDRESS" => Self::StreetAddress,
"POSTAL_CODE" => Self::PostalCode,
_ => Self::UnknownValue(attribute_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AttributeType {
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::CommonName => serializer.serialize_i32(1),
Self::CountryCode => serializer.serialize_i32(2),
Self::Organization => serializer.serialize_i32(3),
Self::OrganizationalUnit => serializer.serialize_i32(4),
Self::Locality => serializer.serialize_i32(5),
Self::Province => serializer.serialize_i32(6),
Self::StreetAddress => serializer.serialize_i32(7),
Self::PostalCode => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AttributeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttributeType>::new(
".google.cloud.security.privateca.v1.AttributeType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RevocationReason {
Unspecified,
KeyCompromise,
CertificateAuthorityCompromise,
AffiliationChanged,
Superseded,
CessationOfOperation,
CertificateHold,
PrivilegeWithdrawn,
AttributeAuthorityCompromise,
UnknownValue(revocation_reason::UnknownValue),
}
#[doc(hidden)]
pub mod revocation_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RevocationReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::KeyCompromise => std::option::Option::Some(1),
Self::CertificateAuthorityCompromise => std::option::Option::Some(2),
Self::AffiliationChanged => std::option::Option::Some(3),
Self::Superseded => std::option::Option::Some(4),
Self::CessationOfOperation => std::option::Option::Some(5),
Self::CertificateHold => std::option::Option::Some(6),
Self::PrivilegeWithdrawn => std::option::Option::Some(7),
Self::AttributeAuthorityCompromise => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("REVOCATION_REASON_UNSPECIFIED"),
Self::KeyCompromise => std::option::Option::Some("KEY_COMPROMISE"),
Self::CertificateAuthorityCompromise => {
std::option::Option::Some("CERTIFICATE_AUTHORITY_COMPROMISE")
}
Self::AffiliationChanged => std::option::Option::Some("AFFILIATION_CHANGED"),
Self::Superseded => std::option::Option::Some("SUPERSEDED"),
Self::CessationOfOperation => std::option::Option::Some("CESSATION_OF_OPERATION"),
Self::CertificateHold => std::option::Option::Some("CERTIFICATE_HOLD"),
Self::PrivilegeWithdrawn => std::option::Option::Some("PRIVILEGE_WITHDRAWN"),
Self::AttributeAuthorityCompromise => {
std::option::Option::Some("ATTRIBUTE_AUTHORITY_COMPROMISE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RevocationReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RevocationReason {
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 RevocationReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::KeyCompromise,
2 => Self::CertificateAuthorityCompromise,
3 => Self::AffiliationChanged,
4 => Self::Superseded,
5 => Self::CessationOfOperation,
6 => Self::CertificateHold,
7 => Self::PrivilegeWithdrawn,
8 => Self::AttributeAuthorityCompromise,
_ => Self::UnknownValue(revocation_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RevocationReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REVOCATION_REASON_UNSPECIFIED" => Self::Unspecified,
"KEY_COMPROMISE" => Self::KeyCompromise,
"CERTIFICATE_AUTHORITY_COMPROMISE" => Self::CertificateAuthorityCompromise,
"AFFILIATION_CHANGED" => Self::AffiliationChanged,
"SUPERSEDED" => Self::Superseded,
"CESSATION_OF_OPERATION" => Self::CessationOfOperation,
"CERTIFICATE_HOLD" => Self::CertificateHold,
"PRIVILEGE_WITHDRAWN" => Self::PrivilegeWithdrawn,
"ATTRIBUTE_AUTHORITY_COMPROMISE" => Self::AttributeAuthorityCompromise,
_ => Self::UnknownValue(revocation_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RevocationReason {
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::KeyCompromise => serializer.serialize_i32(1),
Self::CertificateAuthorityCompromise => serializer.serialize_i32(2),
Self::AffiliationChanged => serializer.serialize_i32(3),
Self::Superseded => serializer.serialize_i32(4),
Self::CessationOfOperation => serializer.serialize_i32(5),
Self::CertificateHold => serializer.serialize_i32(6),
Self::PrivilegeWithdrawn => serializer.serialize_i32(7),
Self::AttributeAuthorityCompromise => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RevocationReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RevocationReason>::new(
".google.cloud.security.privateca.v1.RevocationReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SubjectRequestMode {
Unspecified,
Default,
RdnSequence,
ReflectedSpiffe,
UnknownValue(subject_request_mode::UnknownValue),
}
#[doc(hidden)]
pub mod subject_request_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SubjectRequestMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::RdnSequence => std::option::Option::Some(3),
Self::ReflectedSpiffe => 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("SUBJECT_REQUEST_MODE_UNSPECIFIED"),
Self::Default => std::option::Option::Some("DEFAULT"),
Self::RdnSequence => std::option::Option::Some("RDN_SEQUENCE"),
Self::ReflectedSpiffe => std::option::Option::Some("REFLECTED_SPIFFE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SubjectRequestMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SubjectRequestMode {
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 SubjectRequestMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::ReflectedSpiffe,
3 => Self::RdnSequence,
_ => Self::UnknownValue(subject_request_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SubjectRequestMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SUBJECT_REQUEST_MODE_UNSPECIFIED" => Self::Unspecified,
"DEFAULT" => Self::Default,
"RDN_SEQUENCE" => Self::RdnSequence,
"REFLECTED_SPIFFE" => Self::ReflectedSpiffe,
_ => Self::UnknownValue(subject_request_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SubjectRequestMode {
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::Default => serializer.serialize_i32(1),
Self::RdnSequence => serializer.serialize_i32(3),
Self::ReflectedSpiffe => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SubjectRequestMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SubjectRequestMode>::new(
".google.cloud.security.privateca.v1.SubjectRequestMode",
))
}
}