#![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 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 CreateKeyHandleRequest {
pub parent: std::string::String,
pub key_handle_id: std::string::String,
pub key_handle: std::option::Option<crate::model::KeyHandle>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateKeyHandleRequest {
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_key_handle_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_handle_id = v.into();
self
}
pub fn set_key_handle<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KeyHandle>,
{
self.key_handle = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_key_handle<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KeyHandle>,
{
self.key_handle = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateKeyHandleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateKeyHandleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetKeyHandleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetKeyHandleRequest {
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 GetKeyHandleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetKeyHandleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyHandle {
pub name: std::string::String,
pub kms_key: std::string::String,
pub resource_type_selector: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyHandle {
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_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
pub fn set_resource_type_selector<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_type_selector = v.into();
self
}
}
impl wkt::message::Message for KeyHandle {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.KeyHandle"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateKeyHandleMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateKeyHandleMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateKeyHandleMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateKeyHandleMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListKeyHandlesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListKeyHandlesRequest {
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
}
}
impl wkt::message::Message for ListKeyHandlesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListKeyHandlesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListKeyHandlesResponse {
pub key_handles: std::vec::Vec<crate::model::KeyHandle>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListKeyHandlesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_handles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::KeyHandle>,
{
use std::iter::Iterator;
self.key_handles = 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
}
}
impl wkt::message::Message for ListKeyHandlesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListKeyHandlesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListKeyHandlesResponse {
type PageItem = crate::model::KeyHandle;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.key_handles
}
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 UpdateAutokeyConfigRequest {
pub autokey_config: std::option::Option<crate::model::AutokeyConfig>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAutokeyConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_autokey_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutokeyConfig>,
{
self.autokey_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_autokey_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutokeyConfig>,
{
self.autokey_config = 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
}
}
impl wkt::message::Message for UpdateAutokeyConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.UpdateAutokeyConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAutokeyConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAutokeyConfigRequest {
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 GetAutokeyConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetAutokeyConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutokeyConfig {
pub name: std::string::String,
pub key_project: std::string::String,
pub state: crate::model::autokey_config::State,
pub etag: std::string::String,
pub key_project_resolution_mode: crate::model::autokey_config::KeyProjectResolutionMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutokeyConfig {
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_key_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_project = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::autokey_config::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_key_project_resolution_mode<
T: std::convert::Into<crate::model::autokey_config::KeyProjectResolutionMode>,
>(
mut self,
v: T,
) -> Self {
self.key_project_resolution_mode = v.into();
self
}
}
impl wkt::message::Message for AutokeyConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.AutokeyConfig"
}
}
pub mod autokey_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
KeyProjectDeleted,
Uninitialized,
KeyProjectPermissionDenied,
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::KeyProjectDeleted => std::option::Option::Some(2),
Self::Uninitialized => std::option::Option::Some(3),
Self::KeyProjectPermissionDenied => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::KeyProjectDeleted => std::option::Option::Some("KEY_PROJECT_DELETED"),
Self::Uninitialized => std::option::Option::Some("UNINITIALIZED"),
Self::KeyProjectPermissionDenied => {
std::option::Option::Some("KEY_PROJECT_PERMISSION_DENIED")
}
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::KeyProjectDeleted,
3 => Self::Uninitialized,
4 => Self::KeyProjectPermissionDenied,
_ => 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,
"KEY_PROJECT_DELETED" => Self::KeyProjectDeleted,
"UNINITIALIZED" => Self::Uninitialized,
"KEY_PROJECT_PERMISSION_DENIED" => Self::KeyProjectPermissionDenied,
_ => 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::KeyProjectDeleted => serializer.serialize_i32(2),
Self::Uninitialized => serializer.serialize_i32(3),
Self::KeyProjectPermissionDenied => serializer.serialize_i32(4),
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.kms.v1.AutokeyConfig.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyProjectResolutionMode {
Unspecified,
DedicatedKeyProject,
ResourceProject,
Disabled,
UnknownValue(key_project_resolution_mode::UnknownValue),
}
#[doc(hidden)]
pub mod key_project_resolution_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KeyProjectResolutionMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DedicatedKeyProject => std::option::Option::Some(1),
Self::ResourceProject => std::option::Option::Some(2),
Self::Disabled => 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("KEY_PROJECT_RESOLUTION_MODE_UNSPECIFIED")
}
Self::DedicatedKeyProject => std::option::Option::Some("DEDICATED_KEY_PROJECT"),
Self::ResourceProject => std::option::Option::Some("RESOURCE_PROJECT"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KeyProjectResolutionMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KeyProjectResolutionMode {
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 KeyProjectResolutionMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DedicatedKeyProject,
2 => Self::ResourceProject,
3 => Self::Disabled,
_ => Self::UnknownValue(key_project_resolution_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KeyProjectResolutionMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KEY_PROJECT_RESOLUTION_MODE_UNSPECIFIED" => Self::Unspecified,
"DEDICATED_KEY_PROJECT" => Self::DedicatedKeyProject,
"RESOURCE_PROJECT" => Self::ResourceProject,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(key_project_resolution_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KeyProjectResolutionMode {
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::DedicatedKeyProject => serializer.serialize_i32(1),
Self::ResourceProject => serializer.serialize_i32(2),
Self::Disabled => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KeyProjectResolutionMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<KeyProjectResolutionMode>::new(
".google.cloud.kms.v1.AutokeyConfig.KeyProjectResolutionMode",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ShowEffectiveAutokeyConfigRequest {
pub parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ShowEffectiveAutokeyConfigRequest {
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
}
}
impl wkt::message::Message for ShowEffectiveAutokeyConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ShowEffectiveAutokeyConfigResponse {
pub key_project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ShowEffectiveAutokeyConfigResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_project = v.into();
self
}
}
impl wkt::message::Message for ShowEffectiveAutokeyConfigResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEkmConnectionsRequest {
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 ListEkmConnectionsRequest {
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 ListEkmConnectionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListEkmConnectionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEkmConnectionsResponse {
pub ekm_connections: std::vec::Vec<crate::model::EkmConnection>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEkmConnectionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ekm_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EkmConnection>,
{
use std::iter::Iterator;
self.ekm_connections = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListEkmConnectionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListEkmConnectionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEkmConnectionsResponse {
type PageItem = crate::model::EkmConnection;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.ekm_connections
}
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 GetEkmConnectionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEkmConnectionRequest {
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 GetEkmConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetEkmConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEkmConnectionRequest {
pub parent: std::string::String,
pub ekm_connection_id: std::string::String,
pub ekm_connection: std::option::Option<crate::model::EkmConnection>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEkmConnectionRequest {
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_ekm_connection_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.ekm_connection_id = v.into();
self
}
pub fn set_ekm_connection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EkmConnection>,
{
self.ekm_connection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ekm_connection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EkmConnection>,
{
self.ekm_connection = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateEkmConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateEkmConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEkmConnectionRequest {
pub ekm_connection: std::option::Option<crate::model::EkmConnection>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEkmConnectionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ekm_connection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EkmConnection>,
{
self.ekm_connection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ekm_connection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EkmConnection>,
{
self.ekm_connection = 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
}
}
impl wkt::message::Message for UpdateEkmConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.UpdateEkmConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEkmConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEkmConfigRequest {
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 GetEkmConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetEkmConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEkmConfigRequest {
pub ekm_config: std::option::Option<crate::model::EkmConfig>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEkmConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ekm_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EkmConfig>,
{
self.ekm_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ekm_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EkmConfig>,
{
self.ekm_config = 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
}
}
impl wkt::message::Message for UpdateEkmConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.UpdateEkmConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Certificate {
pub raw_der: ::bytes::Bytes,
pub parsed: bool,
pub issuer: std::string::String,
pub subject: std::string::String,
pub subject_alternative_dns_names: std::vec::Vec<std::string::String>,
pub not_before_time: std::option::Option<wkt::Timestamp>,
pub not_after_time: std::option::Option<wkt::Timestamp>,
pub serial_number: std::string::String,
pub sha256_fingerprint: std::string::String,
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_raw_der<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.raw_der = v.into();
self
}
pub fn set_parsed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.parsed = v.into();
self
}
pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issuer = v.into();
self
}
pub fn set_subject<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subject = v.into();
self
}
pub fn set_subject_alternative_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.subject_alternative_dns_names = v.into_iter().map(|i| i.into()).collect();
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
}
pub fn set_serial_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.serial_number = v.into();
self
}
pub fn set_sha256_fingerprint<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sha256_fingerprint = v.into();
self
}
}
impl wkt::message::Message for Certificate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.Certificate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EkmConnection {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub service_resolvers: std::vec::Vec<crate::model::ekm_connection::ServiceResolver>,
pub etag: std::string::String,
pub key_management_mode: crate::model::ekm_connection::KeyManagementMode,
pub crypto_space_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EkmConnection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_service_resolvers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ekm_connection::ServiceResolver>,
{
use std::iter::Iterator;
self.service_resolvers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_key_management_mode<
T: std::convert::Into<crate::model::ekm_connection::KeyManagementMode>,
>(
mut self,
v: T,
) -> Self {
self.key_management_mode = v.into();
self
}
pub fn set_crypto_space_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.crypto_space_path = v.into();
self
}
}
impl wkt::message::Message for EkmConnection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.EkmConnection"
}
}
pub mod ekm_connection {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceResolver {
pub service_directory_service: std::string::String,
pub endpoint_filter: std::string::String,
pub hostname: std::string::String,
pub server_certificates: std::vec::Vec<crate::model::Certificate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceResolver {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_directory_service<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_directory_service = v.into();
self
}
pub fn set_endpoint_filter<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.endpoint_filter = v.into();
self
}
pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hostname = v.into();
self
}
pub fn set_server_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.server_certificates = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ServiceResolver {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.EkmConnection.ServiceResolver"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyManagementMode {
Unspecified,
Manual,
CloudKms,
UnknownValue(key_management_mode::UnknownValue),
}
#[doc(hidden)]
pub mod key_management_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KeyManagementMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Manual => std::option::Option::Some(1),
Self::CloudKms => 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("KEY_MANAGEMENT_MODE_UNSPECIFIED"),
Self::Manual => std::option::Option::Some("MANUAL"),
Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KeyManagementMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KeyManagementMode {
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 KeyManagementMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Manual,
2 => Self::CloudKms,
_ => Self::UnknownValue(key_management_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KeyManagementMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KEY_MANAGEMENT_MODE_UNSPECIFIED" => Self::Unspecified,
"MANUAL" => Self::Manual,
"CLOUD_KMS" => Self::CloudKms,
_ => Self::UnknownValue(key_management_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KeyManagementMode {
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::Manual => serializer.serialize_i32(1),
Self::CloudKms => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KeyManagementMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<KeyManagementMode>::new(
".google.cloud.kms.v1.EkmConnection.KeyManagementMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EkmConfig {
pub name: std::string::String,
pub default_ekm_connection: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EkmConfig {
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_default_ekm_connection<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_ekm_connection = v.into();
self
}
}
impl wkt::message::Message for EkmConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.EkmConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyConnectivityRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyConnectivityRequest {
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 VerifyConnectivityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.VerifyConnectivityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyConnectivityResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyConnectivityResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for VerifyConnectivityResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.VerifyConnectivityResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SingleTenantHsmInstance {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::single_tenant_hsm_instance::State,
pub quorum_auth: std::option::Option<crate::model::single_tenant_hsm_instance::QuorumAuth>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub unrefreshed_duration_until_disable: std::option::Option<wkt::Duration>,
pub disable_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SingleTenantHsmInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::single_tenant_hsm_instance::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_quorum_auth<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::single_tenant_hsm_instance::QuorumAuth>,
{
self.quorum_auth = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_quorum_auth<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::single_tenant_hsm_instance::QuorumAuth>,
{
self.quorum_auth = 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_unrefreshed_duration_until_disable<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.unrefreshed_duration_until_disable = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_unrefreshed_duration_until_disable<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.unrefreshed_duration_until_disable = v.map(|x| x.into());
self
}
pub fn set_disable_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.disable_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disable_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.disable_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SingleTenantHsmInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstance"
}
}
pub mod single_tenant_hsm_instance {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuorumAuth {
pub total_approver_count: i32,
pub required_approver_count: i32,
pub two_factor_public_key_pems: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuorumAuth {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_total_approver_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_approver_count = v.into();
self
}
pub fn set_required_approver_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.required_approver_count = v.into();
self
}
pub fn set_two_factor_public_key_pems<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.two_factor_public_key_pems = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for QuorumAuth {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
PendingTwoFactorAuthRegistration,
Active,
Disabling,
Disabled,
Deleting,
Deleted,
Failed,
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::Creating => std::option::Option::Some(1),
Self::PendingTwoFactorAuthRegistration => std::option::Option::Some(2),
Self::Active => std::option::Option::Some(3),
Self::Disabling => std::option::Option::Some(4),
Self::Disabled => std::option::Option::Some(5),
Self::Deleting => std::option::Option::Some(6),
Self::Deleted => std::option::Option::Some(7),
Self::Failed => 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("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::PendingTwoFactorAuthRegistration => {
std::option::Option::Some("PENDING_TWO_FACTOR_AUTH_REGISTRATION")
}
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Disabling => std::option::Option::Some("DISABLING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::Failed => std::option::Option::Some("FAILED"),
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::Creating,
2 => Self::PendingTwoFactorAuthRegistration,
3 => Self::Active,
4 => Self::Disabling,
5 => Self::Disabled,
6 => Self::Deleting,
7 => Self::Deleted,
8 => Self::Failed,
_ => 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,
"CREATING" => Self::Creating,
"PENDING_TWO_FACTOR_AUTH_REGISTRATION" => Self::PendingTwoFactorAuthRegistration,
"ACTIVE" => Self::Active,
"DISABLING" => Self::Disabling,
"DISABLED" => Self::Disabled,
"DELETING" => Self::Deleting,
"DELETED" => Self::Deleted,
"FAILED" => Self::Failed,
_ => 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::Creating => serializer.serialize_i32(1),
Self::PendingTwoFactorAuthRegistration => serializer.serialize_i32(2),
Self::Active => serializer.serialize_i32(3),
Self::Disabling => serializer.serialize_i32(4),
Self::Disabled => serializer.serialize_i32(5),
Self::Deleting => serializer.serialize_i32(6),
Self::Deleted => serializer.serialize_i32(7),
Self::Failed => serializer.serialize_i32(8),
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.kms.v1.SingleTenantHsmInstance.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SingleTenantHsmInstanceProposal {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::single_tenant_hsm_instance_proposal::State,
pub failure_reason: std::string::String,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub purge_time: std::option::Option<wkt::Timestamp>,
pub approval_parameters:
std::option::Option<crate::model::single_tenant_hsm_instance_proposal::ApprovalParameters>,
pub expiration:
std::option::Option<crate::model::single_tenant_hsm_instance_proposal::Expiration>,
pub operation:
std::option::Option<crate::model::single_tenant_hsm_instance_proposal::Operation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SingleTenantHsmInstanceProposal {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_state<
T: std::convert::Into<crate::model::single_tenant_hsm_instance_proposal::State>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_reason = v.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_purge_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.purge_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_purge_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.purge_time = v.map(|x| x.into());
self
}
pub fn set_approval_parameters<
T: std::convert::Into<
std::option::Option<
crate::model::single_tenant_hsm_instance_proposal::ApprovalParameters,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.approval_parameters = v.into();
self
}
pub fn quorum_parameters(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::QuorumParameters>,
> {
#[allow(unreachable_patterns)]
self.approval_parameters.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::ApprovalParameters::QuorumParameters(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_quorum_parameters<
T: std::convert::Into<
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::QuorumParameters,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.approval_parameters = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::ApprovalParameters::QuorumParameters(
v.into(),
),
);
self
}
pub fn required_action_quorum_parameters(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RequiredActionQuorumParameters,
>,
> {
#[allow(unreachable_patterns)]
self.approval_parameters.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::ApprovalParameters::RequiredActionQuorumParameters(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_required_action_quorum_parameters<T: std::convert::Into<std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::RequiredActionQuorumParameters>>>(mut self, v: T) -> Self{
self.approval_parameters = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::ApprovalParameters::RequiredActionQuorumParameters(
v.into()
)
);
self
}
pub fn set_expiration<
T: std::convert::Into<
std::option::Option<crate::model::single_tenant_hsm_instance_proposal::Expiration>,
>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn expire_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Expiration::ExpireTime(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Expiration::ExpireTime(v.into()),
);
self
}
pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Expiration::Ttl(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
self.expiration = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Expiration::Ttl(v.into()),
);
self
}
pub fn set_operation<
T: std::convert::Into<
std::option::Option<crate::model::single_tenant_hsm_instance_proposal::Operation>,
>,
>(
mut self,
v: T,
) -> Self {
self.operation = v.into();
self
}
pub fn register_two_factor_auth_keys(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RegisterTwoFactorAuthKeys,
>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::RegisterTwoFactorAuthKeys(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_register_two_factor_auth_keys<
T: std::convert::Into<
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RegisterTwoFactorAuthKeys,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::RegisterTwoFactorAuthKeys(
v.into(),
),
);
self
}
pub fn disable_single_tenant_hsm_instance(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::DisableSingleTenantHsmInstance,
>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::DisableSingleTenantHsmInstance(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_disable_single_tenant_hsm_instance<T: std::convert::Into<std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::DisableSingleTenantHsmInstance>>>(mut self, v: T) -> Self{
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::DisableSingleTenantHsmInstance(
v.into()
)
);
self
}
pub fn enable_single_tenant_hsm_instance(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::EnableSingleTenantHsmInstance,
>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::EnableSingleTenantHsmInstance(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_enable_single_tenant_hsm_instance<T: std::convert::Into<std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::EnableSingleTenantHsmInstance>>>(mut self, v: T) -> Self{
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::EnableSingleTenantHsmInstance(
v.into()
)
);
self
}
pub fn delete_single_tenant_hsm_instance(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::DeleteSingleTenantHsmInstance,
>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::DeleteSingleTenantHsmInstance(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_delete_single_tenant_hsm_instance<T: std::convert::Into<std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::DeleteSingleTenantHsmInstance>>>(mut self, v: T) -> Self{
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::DeleteSingleTenantHsmInstance(
v.into()
)
);
self
}
pub fn add_quorum_member(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::AddQuorumMember>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::AddQuorumMember(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_add_quorum_member<
T: std::convert::Into<
std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::AddQuorumMember>,
>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::AddQuorumMember(v.into()),
);
self
}
pub fn remove_quorum_member(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::RemoveQuorumMember>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::RemoveQuorumMember(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_remove_quorum_member<
T: std::convert::Into<
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RemoveQuorumMember,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::RemoveQuorumMember(
v.into(),
),
);
self
}
pub fn refresh_single_tenant_hsm_instance(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RefreshSingleTenantHsmInstance,
>,
> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::single_tenant_hsm_instance_proposal::Operation::RefreshSingleTenantHsmInstance(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_refresh_single_tenant_hsm_instance<T: std::convert::Into<std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::RefreshSingleTenantHsmInstance>>>(mut self, v: T) -> Self{
self.operation = std::option::Option::Some(
crate::model::single_tenant_hsm_instance_proposal::Operation::RefreshSingleTenantHsmInstance(
v.into()
)
);
self
}
}
impl wkt::message::Message for SingleTenantHsmInstanceProposal {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal"
}
}
pub mod single_tenant_hsm_instance_proposal {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuorumParameters {
pub required_approver_count: i32,
pub challenges: std::vec::Vec<crate::model::Challenge>,
pub approved_two_factor_public_key_pems: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuorumParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_required_approver_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.required_approver_count = v.into();
self
}
pub fn set_challenges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Challenge>,
{
use std::iter::Iterator;
self.challenges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_approved_two_factor_public_key_pems<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.approved_two_factor_public_key_pems = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for QuorumParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RequiredActionQuorumParameters {
pub required_challenges: std::vec::Vec<crate::model::Challenge>,
pub required_approver_count: i32,
pub quorum_challenges: std::vec::Vec<crate::model::Challenge>,
pub approved_two_factor_public_key_pems: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RequiredActionQuorumParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_required_challenges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Challenge>,
{
use std::iter::Iterator;
self.required_challenges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_required_approver_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.required_approver_count = v.into();
self
}
pub fn set_quorum_challenges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Challenge>,
{
use std::iter::Iterator;
self.quorum_challenges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_approved_two_factor_public_key_pems<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.approved_two_factor_public_key_pems = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RequiredActionQuorumParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegisterTwoFactorAuthKeys {
pub required_approver_count: i32,
pub two_factor_public_key_pems: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RegisterTwoFactorAuthKeys {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_required_approver_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.required_approver_count = v.into();
self
}
pub fn set_two_factor_public_key_pems<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.two_factor_public_key_pems = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RegisterTwoFactorAuthKeys {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeys"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableSingleTenantHsmInstance {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisableSingleTenantHsmInstance {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DisableSingleTenantHsmInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnableSingleTenantHsmInstance {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnableSingleTenantHsmInstance {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for EnableSingleTenantHsmInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSingleTenantHsmInstance {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSingleTenantHsmInstance {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteSingleTenantHsmInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AddQuorumMember {
pub two_factor_public_key_pem: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AddQuorumMember {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_two_factor_public_key_pem<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.two_factor_public_key_pem = v.into();
self
}
}
impl wkt::message::Message for AddQuorumMember {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMember"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveQuorumMember {
pub two_factor_public_key_pem: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoveQuorumMember {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_two_factor_public_key_pem<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.two_factor_public_key_pem = v.into();
self
}
}
impl wkt::message::Message for RemoveQuorumMember {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMember"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RefreshSingleTenantHsmInstance {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RefreshSingleTenantHsmInstance {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RefreshSingleTenantHsmInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstance"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Pending,
Approved,
Running,
Succeeded,
Failed,
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::Creating => std::option::Option::Some(1),
Self::Pending => std::option::Option::Some(2),
Self::Approved => std::option::Option::Some(3),
Self::Running => std::option::Option::Some(4),
Self::Succeeded => std::option::Option::Some(5),
Self::Failed => std::option::Option::Some(6),
Self::Deleted => std::option::Option::Some(7),
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::Creating => std::option::Option::Some("CREATING"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Approved => std::option::Option::Some("APPROVED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
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::Creating,
2 => Self::Pending,
3 => Self::Approved,
4 => Self::Running,
5 => Self::Succeeded,
6 => Self::Failed,
7 => 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,
"CREATING" => Self::Creating,
"PENDING" => Self::Pending,
"APPROVED" => Self::Approved,
"RUNNING" => Self::Running,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"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::Creating => serializer.serialize_i32(1),
Self::Pending => serializer.serialize_i32(2),
Self::Approved => serializer.serialize_i32(3),
Self::Running => serializer.serialize_i32(4),
Self::Succeeded => serializer.serialize_i32(5),
Self::Failed => serializer.serialize_i32(6),
Self::Deleted => serializer.serialize_i32(7),
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.kms.v1.SingleTenantHsmInstanceProposal.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ApprovalParameters {
QuorumParameters(
std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::QuorumParameters>,
),
RequiredActionQuorumParameters(
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RequiredActionQuorumParameters,
>,
),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
ExpireTime(std::boxed::Box<wkt::Timestamp>),
Ttl(std::boxed::Box<wkt::Duration>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Operation {
RegisterTwoFactorAuthKeys(
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RegisterTwoFactorAuthKeys,
>,
),
DisableSingleTenantHsmInstance(
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::DisableSingleTenantHsmInstance,
>,
),
EnableSingleTenantHsmInstance(
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::EnableSingleTenantHsmInstance,
>,
),
DeleteSingleTenantHsmInstance(
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::DeleteSingleTenantHsmInstance,
>,
),
AddQuorumMember(
std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::AddQuorumMember>,
),
RemoveQuorumMember(
std::boxed::Box<crate::model::single_tenant_hsm_instance_proposal::RemoveQuorumMember>,
),
RefreshSingleTenantHsmInstance(
std::boxed::Box<
crate::model::single_tenant_hsm_instance_proposal::RefreshSingleTenantHsmInstance,
>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Challenge {
pub challenge: ::bytes::Bytes,
pub public_key_pem: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Challenge {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_challenge<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.challenge = v.into();
self
}
pub fn set_public_key_pem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_key_pem = v.into();
self
}
}
impl wkt::message::Message for Challenge {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.Challenge"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChallengeReply {
pub signed_challenge: ::bytes::Bytes,
pub public_key_pem: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChallengeReply {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_signed_challenge<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.signed_challenge = v.into();
self
}
pub fn set_public_key_pem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_key_pem = v.into();
self
}
}
impl wkt::message::Message for ChallengeReply {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ChallengeReply"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSingleTenantHsmInstancesRequest {
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 show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSingleTenantHsmInstancesRequest {
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
}
pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListSingleTenantHsmInstancesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSingleTenantHsmInstancesResponse {
pub single_tenant_hsm_instances: std::vec::Vec<crate::model::SingleTenantHsmInstance>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSingleTenantHsmInstancesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_single_tenant_hsm_instances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SingleTenantHsmInstance>,
{
use std::iter::Iterator;
self.single_tenant_hsm_instances = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListSingleTenantHsmInstancesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListSingleTenantHsmInstancesResponse
{
type PageItem = crate::model::SingleTenantHsmInstance;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.single_tenant_hsm_instances
}
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 GetSingleTenantHsmInstanceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSingleTenantHsmInstanceRequest {
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 GetSingleTenantHsmInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetSingleTenantHsmInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSingleTenantHsmInstanceRequest {
pub parent: std::string::String,
pub single_tenant_hsm_instance_id: std::string::String,
pub single_tenant_hsm_instance: std::option::Option<crate::model::SingleTenantHsmInstance>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSingleTenantHsmInstanceRequest {
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_single_tenant_hsm_instance_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.single_tenant_hsm_instance_id = v.into();
self
}
pub fn set_single_tenant_hsm_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SingleTenantHsmInstance>,
{
self.single_tenant_hsm_instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_single_tenant_hsm_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SingleTenantHsmInstance>,
{
self.single_tenant_hsm_instance = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSingleTenantHsmInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateSingleTenantHsmInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSingleTenantHsmInstanceMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSingleTenantHsmInstanceMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateSingleTenantHsmInstanceMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateSingleTenantHsmInstanceMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSingleTenantHsmInstanceProposalRequest {
pub parent: std::string::String,
pub single_tenant_hsm_instance_proposal_id: std::string::String,
pub single_tenant_hsm_instance_proposal:
std::option::Option<crate::model::SingleTenantHsmInstanceProposal>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSingleTenantHsmInstanceProposalRequest {
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_single_tenant_hsm_instance_proposal_id<
T: std::convert::Into<std::string::String>,
>(
mut self,
v: T,
) -> Self {
self.single_tenant_hsm_instance_proposal_id = v.into();
self
}
pub fn set_single_tenant_hsm_instance_proposal<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
{
self.single_tenant_hsm_instance_proposal = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_single_tenant_hsm_instance_proposal<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
{
self.single_tenant_hsm_instance_proposal = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSingleTenantHsmInstanceProposalRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSingleTenantHsmInstanceProposalMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSingleTenantHsmInstanceProposalMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateSingleTenantHsmInstanceProposalMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSingleTenantHsmInstanceProposalRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSingleTenantHsmInstanceProposalRequest {
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 GetSingleTenantHsmInstanceProposalRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApproveSingleTenantHsmInstanceProposalRequest {
pub name: std::string::String,
pub approval_payload: std::option::Option<
crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApproveSingleTenantHsmInstanceProposalRequest {
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_approval_payload<T: std::convert::Into<std::option::Option<crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload>>>(mut self, v: T) -> Self
{
self.approval_payload = v.into();
self
}
pub fn quorum_reply(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::approve_single_tenant_hsm_instance_proposal_request::QuorumReply,
>,
> {
#[allow(unreachable_patterns)]
self.approval_payload.as_ref().and_then(|v| match v {
crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload::QuorumReply(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_quorum_reply<
T: std::convert::Into<
std::boxed::Box<
crate::model::approve_single_tenant_hsm_instance_proposal_request::QuorumReply,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.approval_payload = std::option::Option::Some(
crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload::QuorumReply(
v.into()
)
);
self
}
pub fn required_action_quorum_reply(&self) -> std::option::Option<&std::boxed::Box<crate::model::approve_single_tenant_hsm_instance_proposal_request::RequiredActionQuorumReply>>{
#[allow(unreachable_patterns)]
self.approval_payload.as_ref().and_then(|v| match v {
crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload::RequiredActionQuorumReply(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_required_action_quorum_reply<T: std::convert::Into<std::boxed::Box<crate::model::approve_single_tenant_hsm_instance_proposal_request::RequiredActionQuorumReply>>>(mut self, v: T) -> Self{
self.approval_payload = std::option::Option::Some(
crate::model::approve_single_tenant_hsm_instance_proposal_request::ApprovalPayload::RequiredActionQuorumReply(
v.into()
)
);
self
}
}
impl wkt::message::Message for ApproveSingleTenantHsmInstanceProposalRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest"
}
}
pub mod approve_single_tenant_hsm_instance_proposal_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuorumReply {
pub challenge_replies: std::vec::Vec<crate::model::ChallengeReply>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuorumReply {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_challenge_replies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ChallengeReply>,
{
use std::iter::Iterator;
self.challenge_replies = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for QuorumReply {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReply"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RequiredActionQuorumReply {
pub required_challenge_replies: std::vec::Vec<crate::model::ChallengeReply>,
pub quorum_challenge_replies: std::vec::Vec<crate::model::ChallengeReply>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RequiredActionQuorumReply {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_required_challenge_replies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ChallengeReply>,
{
use std::iter::Iterator;
self.required_challenge_replies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_quorum_challenge_replies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ChallengeReply>,
{
use std::iter::Iterator;
self.quorum_challenge_replies = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RequiredActionQuorumReply {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ApprovalPayload {
QuorumReply(std::boxed::Box<crate::model::approve_single_tenant_hsm_instance_proposal_request::QuorumReply>),
RequiredActionQuorumReply(std::boxed::Box<crate::model::approve_single_tenant_hsm_instance_proposal_request::RequiredActionQuorumReply>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApproveSingleTenantHsmInstanceProposalResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApproveSingleTenantHsmInstanceProposalResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ApproveSingleTenantHsmInstanceProposalResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteSingleTenantHsmInstanceProposalRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteSingleTenantHsmInstanceProposalRequest {
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 ExecuteSingleTenantHsmInstanceProposalRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteSingleTenantHsmInstanceProposalResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteSingleTenantHsmInstanceProposalResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ExecuteSingleTenantHsmInstanceProposalResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteSingleTenantHsmInstanceProposalMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteSingleTenantHsmInstanceProposalMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ExecuteSingleTenantHsmInstanceProposalMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSingleTenantHsmInstanceProposalsRequest {
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 show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSingleTenantHsmInstanceProposalsRequest {
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
}
pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListSingleTenantHsmInstanceProposalsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSingleTenantHsmInstanceProposalsResponse {
pub single_tenant_hsm_instance_proposals:
std::vec::Vec<crate::model::SingleTenantHsmInstanceProposal>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSingleTenantHsmInstanceProposalsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_single_tenant_hsm_instance_proposals<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SingleTenantHsmInstanceProposal>,
{
use std::iter::Iterator;
self.single_tenant_hsm_instance_proposals = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListSingleTenantHsmInstanceProposalsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListSingleTenantHsmInstanceProposalsResponse
{
type PageItem = crate::model::SingleTenantHsmInstanceProposal;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.single_tenant_hsm_instance_proposals
}
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 DeleteSingleTenantHsmInstanceProposalRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSingleTenantHsmInstanceProposalRequest {
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 DeleteSingleTenantHsmInstanceProposalRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyRing {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyRing {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for KeyRing {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.KeyRing"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CryptoKey {
pub name: std::string::String,
pub primary: std::option::Option<crate::model::CryptoKeyVersion>,
pub purpose: crate::model::crypto_key::CryptoKeyPurpose,
pub create_time: std::option::Option<wkt::Timestamp>,
pub next_rotation_time: std::option::Option<wkt::Timestamp>,
pub version_template: std::option::Option<crate::model::CryptoKeyVersionTemplate>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub import_only: bool,
pub destroy_scheduled_duration: std::option::Option<wkt::Duration>,
pub crypto_key_backend: std::string::String,
pub key_access_justifications_policy:
std::option::Option<crate::model::KeyAccessJustificationsPolicy>,
pub rotation_schedule: std::option::Option<crate::model::crypto_key::RotationSchedule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CryptoKey {
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_primary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersion>,
{
self.primary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_primary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersion>,
{
self.primary = v.map(|x| x.into());
self
}
pub fn set_purpose<T: std::convert::Into<crate::model::crypto_key::CryptoKeyPurpose>>(
mut self,
v: T,
) -> Self {
self.purpose = 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_next_rotation_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.next_rotation_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_rotation_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.next_rotation_time = v.map(|x| x.into());
self
}
pub fn set_version_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersionTemplate>,
{
self.version_template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_version_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersionTemplate>,
{
self.version_template = 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_import_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.import_only = v.into();
self
}
pub fn set_destroy_scheduled_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.destroy_scheduled_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destroy_scheduled_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.destroy_scheduled_duration = v.map(|x| x.into());
self
}
pub fn set_crypto_key_backend<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.crypto_key_backend = v.into();
self
}
pub fn set_key_access_justifications_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KeyAccessJustificationsPolicy>,
{
self.key_access_justifications_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_key_access_justifications_policy<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::KeyAccessJustificationsPolicy>,
{
self.key_access_justifications_policy = v.map(|x| x.into());
self
}
pub fn set_rotation_schedule<
T: std::convert::Into<std::option::Option<crate::model::crypto_key::RotationSchedule>>,
>(
mut self,
v: T,
) -> Self {
self.rotation_schedule = v.into();
self
}
pub fn rotation_period(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.rotation_schedule.as_ref().and_then(|v| match v {
crate::model::crypto_key::RotationSchedule::RotationPeriod(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_rotation_period<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
mut self,
v: T,
) -> Self {
self.rotation_schedule = std::option::Option::Some(
crate::model::crypto_key::RotationSchedule::RotationPeriod(v.into()),
);
self
}
}
impl wkt::message::Message for CryptoKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CryptoKey"
}
}
pub mod crypto_key {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CryptoKeyPurpose {
Unspecified,
EncryptDecrypt,
AsymmetricSign,
AsymmetricDecrypt,
RawEncryptDecrypt,
Mac,
KeyEncapsulation,
UnknownValue(crypto_key_purpose::UnknownValue),
}
#[doc(hidden)]
pub mod crypto_key_purpose {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CryptoKeyPurpose {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::EncryptDecrypt => std::option::Option::Some(1),
Self::AsymmetricSign => std::option::Option::Some(5),
Self::AsymmetricDecrypt => std::option::Option::Some(6),
Self::RawEncryptDecrypt => std::option::Option::Some(7),
Self::Mac => std::option::Option::Some(9),
Self::KeyEncapsulation => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CRYPTO_KEY_PURPOSE_UNSPECIFIED"),
Self::EncryptDecrypt => std::option::Option::Some("ENCRYPT_DECRYPT"),
Self::AsymmetricSign => std::option::Option::Some("ASYMMETRIC_SIGN"),
Self::AsymmetricDecrypt => std::option::Option::Some("ASYMMETRIC_DECRYPT"),
Self::RawEncryptDecrypt => std::option::Option::Some("RAW_ENCRYPT_DECRYPT"),
Self::Mac => std::option::Option::Some("MAC"),
Self::KeyEncapsulation => std::option::Option::Some("KEY_ENCAPSULATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CryptoKeyPurpose {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CryptoKeyPurpose {
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 CryptoKeyPurpose {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EncryptDecrypt,
5 => Self::AsymmetricSign,
6 => Self::AsymmetricDecrypt,
7 => Self::RawEncryptDecrypt,
9 => Self::Mac,
10 => Self::KeyEncapsulation,
_ => Self::UnknownValue(crypto_key_purpose::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CryptoKeyPurpose {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CRYPTO_KEY_PURPOSE_UNSPECIFIED" => Self::Unspecified,
"ENCRYPT_DECRYPT" => Self::EncryptDecrypt,
"ASYMMETRIC_SIGN" => Self::AsymmetricSign,
"ASYMMETRIC_DECRYPT" => Self::AsymmetricDecrypt,
"RAW_ENCRYPT_DECRYPT" => Self::RawEncryptDecrypt,
"MAC" => Self::Mac,
"KEY_ENCAPSULATION" => Self::KeyEncapsulation,
_ => Self::UnknownValue(crypto_key_purpose::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CryptoKeyPurpose {
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::EncryptDecrypt => serializer.serialize_i32(1),
Self::AsymmetricSign => serializer.serialize_i32(5),
Self::AsymmetricDecrypt => serializer.serialize_i32(6),
Self::RawEncryptDecrypt => serializer.serialize_i32(7),
Self::Mac => serializer.serialize_i32(9),
Self::KeyEncapsulation => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CryptoKeyPurpose {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CryptoKeyPurpose>::new(
".google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RotationSchedule {
RotationPeriod(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CryptoKeyVersionTemplate {
pub protection_level: crate::model::ProtectionLevel,
pub algorithm: crate::model::crypto_key_version::CryptoKeyVersionAlgorithm,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CryptoKeyVersionTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
pub fn set_algorithm<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
>(
mut self,
v: T,
) -> Self {
self.algorithm = v.into();
self
}
}
impl wkt::message::Message for CryptoKeyVersionTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CryptoKeyVersionTemplate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyOperationAttestation {
pub format: crate::model::key_operation_attestation::AttestationFormat,
pub content: ::bytes::Bytes,
pub cert_chains:
std::option::Option<crate::model::key_operation_attestation::CertificateChains>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyOperationAttestation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_format<
T: std::convert::Into<crate::model::key_operation_attestation::AttestationFormat>,
>(
mut self,
v: T,
) -> Self {
self.format = v.into();
self
}
pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.content = v.into();
self
}
pub fn set_cert_chains<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::key_operation_attestation::CertificateChains>,
{
self.cert_chains = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cert_chains<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::key_operation_attestation::CertificateChains>,
{
self.cert_chains = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for KeyOperationAttestation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.KeyOperationAttestation"
}
}
pub mod key_operation_attestation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CertificateChains {
pub cavium_certs: std::vec::Vec<std::string::String>,
pub google_card_certs: std::vec::Vec<std::string::String>,
pub google_partition_certs: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CertificateChains {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cavium_certs<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.cavium_certs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_google_card_certs<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.google_card_certs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_google_partition_certs<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.google_partition_certs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CertificateChains {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.KeyOperationAttestation.CertificateChains"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AttestationFormat {
Unspecified,
CaviumV1Compressed,
CaviumV2Compressed,
UnknownValue(attestation_format::UnknownValue),
}
#[doc(hidden)]
pub mod attestation_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AttestationFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CaviumV1Compressed => std::option::Option::Some(3),
Self::CaviumV2Compressed => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ATTESTATION_FORMAT_UNSPECIFIED"),
Self::CaviumV1Compressed => std::option::Option::Some("CAVIUM_V1_COMPRESSED"),
Self::CaviumV2Compressed => std::option::Option::Some("CAVIUM_V2_COMPRESSED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AttestationFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AttestationFormat {
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 AttestationFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
3 => Self::CaviumV1Compressed,
4 => Self::CaviumV2Compressed,
_ => Self::UnknownValue(attestation_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AttestationFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ATTESTATION_FORMAT_UNSPECIFIED" => Self::Unspecified,
"CAVIUM_V1_COMPRESSED" => Self::CaviumV1Compressed,
"CAVIUM_V2_COMPRESSED" => Self::CaviumV2Compressed,
_ => Self::UnknownValue(attestation_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AttestationFormat {
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::CaviumV1Compressed => serializer.serialize_i32(3),
Self::CaviumV2Compressed => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AttestationFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttestationFormat>::new(
".google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CryptoKeyVersion {
pub name: std::string::String,
pub state: crate::model::crypto_key_version::CryptoKeyVersionState,
pub protection_level: crate::model::ProtectionLevel,
pub algorithm: crate::model::crypto_key_version::CryptoKeyVersionAlgorithm,
pub attestation: std::option::Option<crate::model::KeyOperationAttestation>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub generate_time: std::option::Option<wkt::Timestamp>,
pub destroy_time: std::option::Option<wkt::Timestamp>,
pub destroy_event_time: std::option::Option<wkt::Timestamp>,
pub import_job: std::string::String,
pub import_time: std::option::Option<wkt::Timestamp>,
pub import_failure_reason: std::string::String,
pub generation_failure_reason: std::string::String,
pub external_destruction_failure_reason: std::string::String,
pub external_protection_level_options:
std::option::Option<crate::model::ExternalProtectionLevelOptions>,
pub reimport_eligible: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CryptoKeyVersion {
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_state<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionState>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
pub fn set_algorithm<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
>(
mut self,
v: T,
) -> Self {
self.algorithm = v.into();
self
}
pub fn set_attestation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KeyOperationAttestation>,
{
self.attestation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attestation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KeyOperationAttestation>,
{
self.attestation = 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_generate_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.generate_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_generate_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.generate_time = v.map(|x| x.into());
self
}
pub fn set_destroy_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.destroy_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destroy_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.destroy_time = v.map(|x| x.into());
self
}
pub fn set_destroy_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.destroy_event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destroy_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.destroy_event_time = v.map(|x| x.into());
self
}
pub fn set_import_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.import_job = v.into();
self
}
pub fn set_import_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.import_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.import_time = v.map(|x| x.into());
self
}
pub fn set_import_failure_reason<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.import_failure_reason = v.into();
self
}
pub fn set_generation_failure_reason<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.generation_failure_reason = v.into();
self
}
pub fn set_external_destruction_failure_reason<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.external_destruction_failure_reason = v.into();
self
}
pub fn set_external_protection_level_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExternalProtectionLevelOptions>,
{
self.external_protection_level_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_external_protection_level_options<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::ExternalProtectionLevelOptions>,
{
self.external_protection_level_options = v.map(|x| x.into());
self
}
pub fn set_reimport_eligible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reimport_eligible = v.into();
self
}
}
impl wkt::message::Message for CryptoKeyVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CryptoKeyVersion"
}
}
pub mod crypto_key_version {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CryptoKeyVersionAlgorithm {
Unspecified,
GoogleSymmetricEncryption,
Aes128Gcm,
Aes256Gcm,
Aes128Cbc,
Aes256Cbc,
Aes128Ctr,
Aes256Ctr,
RsaSignPss2048Sha256,
RsaSignPss3072Sha256,
RsaSignPss4096Sha256,
RsaSignPss4096Sha512,
RsaSignPkcs12048Sha256,
RsaSignPkcs13072Sha256,
RsaSignPkcs14096Sha256,
RsaSignPkcs14096Sha512,
RsaSignRawPkcs12048,
RsaSignRawPkcs13072,
RsaSignRawPkcs14096,
RsaDecryptOaep2048Sha256,
RsaDecryptOaep3072Sha256,
RsaDecryptOaep4096Sha256,
RsaDecryptOaep4096Sha512,
RsaDecryptOaep2048Sha1,
RsaDecryptOaep3072Sha1,
RsaDecryptOaep4096Sha1,
EcSignP256Sha256,
EcSignP384Sha384,
EcSignSecp256K1Sha256,
EcSignEd25519,
HmacSha256,
HmacSha1,
HmacSha384,
HmacSha512,
HmacSha224,
ExternalSymmetricEncryption,
MlKem768,
MlKem1024,
KemXwing,
PqSignMlDsa44,
PqSignMlDsa65,
PqSignMlDsa87,
PqSignSlhDsaSha2128S,
PqSignHashSlhDsaSha2128SSha256,
PqSignMlDsa44ExternalMu,
PqSignMlDsa65ExternalMu,
PqSignMlDsa87ExternalMu,
UnknownValue(crypto_key_version_algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod crypto_key_version_algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CryptoKeyVersionAlgorithm {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GoogleSymmetricEncryption => std::option::Option::Some(1),
Self::Aes128Gcm => std::option::Option::Some(41),
Self::Aes256Gcm => std::option::Option::Some(19),
Self::Aes128Cbc => std::option::Option::Some(42),
Self::Aes256Cbc => std::option::Option::Some(43),
Self::Aes128Ctr => std::option::Option::Some(44),
Self::Aes256Ctr => std::option::Option::Some(45),
Self::RsaSignPss2048Sha256 => std::option::Option::Some(2),
Self::RsaSignPss3072Sha256 => std::option::Option::Some(3),
Self::RsaSignPss4096Sha256 => std::option::Option::Some(4),
Self::RsaSignPss4096Sha512 => std::option::Option::Some(15),
Self::RsaSignPkcs12048Sha256 => std::option::Option::Some(5),
Self::RsaSignPkcs13072Sha256 => std::option::Option::Some(6),
Self::RsaSignPkcs14096Sha256 => std::option::Option::Some(7),
Self::RsaSignPkcs14096Sha512 => std::option::Option::Some(16),
Self::RsaSignRawPkcs12048 => std::option::Option::Some(28),
Self::RsaSignRawPkcs13072 => std::option::Option::Some(29),
Self::RsaSignRawPkcs14096 => std::option::Option::Some(30),
Self::RsaDecryptOaep2048Sha256 => std::option::Option::Some(8),
Self::RsaDecryptOaep3072Sha256 => std::option::Option::Some(9),
Self::RsaDecryptOaep4096Sha256 => std::option::Option::Some(10),
Self::RsaDecryptOaep4096Sha512 => std::option::Option::Some(17),
Self::RsaDecryptOaep2048Sha1 => std::option::Option::Some(37),
Self::RsaDecryptOaep3072Sha1 => std::option::Option::Some(38),
Self::RsaDecryptOaep4096Sha1 => std::option::Option::Some(39),
Self::EcSignP256Sha256 => std::option::Option::Some(12),
Self::EcSignP384Sha384 => std::option::Option::Some(13),
Self::EcSignSecp256K1Sha256 => std::option::Option::Some(31),
Self::EcSignEd25519 => std::option::Option::Some(40),
Self::HmacSha256 => std::option::Option::Some(32),
Self::HmacSha1 => std::option::Option::Some(33),
Self::HmacSha384 => std::option::Option::Some(34),
Self::HmacSha512 => std::option::Option::Some(35),
Self::HmacSha224 => std::option::Option::Some(36),
Self::ExternalSymmetricEncryption => std::option::Option::Some(18),
Self::MlKem768 => std::option::Option::Some(47),
Self::MlKem1024 => std::option::Option::Some(48),
Self::KemXwing => std::option::Option::Some(63),
Self::PqSignMlDsa44 => std::option::Option::Some(68),
Self::PqSignMlDsa65 => std::option::Option::Some(56),
Self::PqSignMlDsa87 => std::option::Option::Some(69),
Self::PqSignSlhDsaSha2128S => std::option::Option::Some(57),
Self::PqSignHashSlhDsaSha2128SSha256 => std::option::Option::Some(60),
Self::PqSignMlDsa44ExternalMu => std::option::Option::Some(70),
Self::PqSignMlDsa65ExternalMu => std::option::Option::Some(67),
Self::PqSignMlDsa87ExternalMu => std::option::Option::Some(71),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED")
}
Self::GoogleSymmetricEncryption => {
std::option::Option::Some("GOOGLE_SYMMETRIC_ENCRYPTION")
}
Self::Aes128Gcm => std::option::Option::Some("AES_128_GCM"),
Self::Aes256Gcm => std::option::Option::Some("AES_256_GCM"),
Self::Aes128Cbc => std::option::Option::Some("AES_128_CBC"),
Self::Aes256Cbc => std::option::Option::Some("AES_256_CBC"),
Self::Aes128Ctr => std::option::Option::Some("AES_128_CTR"),
Self::Aes256Ctr => std::option::Option::Some("AES_256_CTR"),
Self::RsaSignPss2048Sha256 => std::option::Option::Some("RSA_SIGN_PSS_2048_SHA256"),
Self::RsaSignPss3072Sha256 => std::option::Option::Some("RSA_SIGN_PSS_3072_SHA256"),
Self::RsaSignPss4096Sha256 => std::option::Option::Some("RSA_SIGN_PSS_4096_SHA256"),
Self::RsaSignPss4096Sha512 => std::option::Option::Some("RSA_SIGN_PSS_4096_SHA512"),
Self::RsaSignPkcs12048Sha256 => {
std::option::Option::Some("RSA_SIGN_PKCS1_2048_SHA256")
}
Self::RsaSignPkcs13072Sha256 => {
std::option::Option::Some("RSA_SIGN_PKCS1_3072_SHA256")
}
Self::RsaSignPkcs14096Sha256 => {
std::option::Option::Some("RSA_SIGN_PKCS1_4096_SHA256")
}
Self::RsaSignPkcs14096Sha512 => {
std::option::Option::Some("RSA_SIGN_PKCS1_4096_SHA512")
}
Self::RsaSignRawPkcs12048 => std::option::Option::Some("RSA_SIGN_RAW_PKCS1_2048"),
Self::RsaSignRawPkcs13072 => std::option::Option::Some("RSA_SIGN_RAW_PKCS1_3072"),
Self::RsaSignRawPkcs14096 => std::option::Option::Some("RSA_SIGN_RAW_PKCS1_4096"),
Self::RsaDecryptOaep2048Sha256 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_2048_SHA256")
}
Self::RsaDecryptOaep3072Sha256 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_3072_SHA256")
}
Self::RsaDecryptOaep4096Sha256 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_4096_SHA256")
}
Self::RsaDecryptOaep4096Sha512 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_4096_SHA512")
}
Self::RsaDecryptOaep2048Sha1 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_2048_SHA1")
}
Self::RsaDecryptOaep3072Sha1 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_3072_SHA1")
}
Self::RsaDecryptOaep4096Sha1 => {
std::option::Option::Some("RSA_DECRYPT_OAEP_4096_SHA1")
}
Self::EcSignP256Sha256 => std::option::Option::Some("EC_SIGN_P256_SHA256"),
Self::EcSignP384Sha384 => std::option::Option::Some("EC_SIGN_P384_SHA384"),
Self::EcSignSecp256K1Sha256 => {
std::option::Option::Some("EC_SIGN_SECP256K1_SHA256")
}
Self::EcSignEd25519 => std::option::Option::Some("EC_SIGN_ED25519"),
Self::HmacSha256 => std::option::Option::Some("HMAC_SHA256"),
Self::HmacSha1 => std::option::Option::Some("HMAC_SHA1"),
Self::HmacSha384 => std::option::Option::Some("HMAC_SHA384"),
Self::HmacSha512 => std::option::Option::Some("HMAC_SHA512"),
Self::HmacSha224 => std::option::Option::Some("HMAC_SHA224"),
Self::ExternalSymmetricEncryption => {
std::option::Option::Some("EXTERNAL_SYMMETRIC_ENCRYPTION")
}
Self::MlKem768 => std::option::Option::Some("ML_KEM_768"),
Self::MlKem1024 => std::option::Option::Some("ML_KEM_1024"),
Self::KemXwing => std::option::Option::Some("KEM_XWING"),
Self::PqSignMlDsa44 => std::option::Option::Some("PQ_SIGN_ML_DSA_44"),
Self::PqSignMlDsa65 => std::option::Option::Some("PQ_SIGN_ML_DSA_65"),
Self::PqSignMlDsa87 => std::option::Option::Some("PQ_SIGN_ML_DSA_87"),
Self::PqSignSlhDsaSha2128S => {
std::option::Option::Some("PQ_SIGN_SLH_DSA_SHA2_128S")
}
Self::PqSignHashSlhDsaSha2128SSha256 => {
std::option::Option::Some("PQ_SIGN_HASH_SLH_DSA_SHA2_128S_SHA256")
}
Self::PqSignMlDsa44ExternalMu => {
std::option::Option::Some("PQ_SIGN_ML_DSA_44_EXTERNAL_MU")
}
Self::PqSignMlDsa65ExternalMu => {
std::option::Option::Some("PQ_SIGN_ML_DSA_65_EXTERNAL_MU")
}
Self::PqSignMlDsa87ExternalMu => {
std::option::Option::Some("PQ_SIGN_ML_DSA_87_EXTERNAL_MU")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CryptoKeyVersionAlgorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CryptoKeyVersionAlgorithm {
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 CryptoKeyVersionAlgorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GoogleSymmetricEncryption,
2 => Self::RsaSignPss2048Sha256,
3 => Self::RsaSignPss3072Sha256,
4 => Self::RsaSignPss4096Sha256,
5 => Self::RsaSignPkcs12048Sha256,
6 => Self::RsaSignPkcs13072Sha256,
7 => Self::RsaSignPkcs14096Sha256,
8 => Self::RsaDecryptOaep2048Sha256,
9 => Self::RsaDecryptOaep3072Sha256,
10 => Self::RsaDecryptOaep4096Sha256,
12 => Self::EcSignP256Sha256,
13 => Self::EcSignP384Sha384,
15 => Self::RsaSignPss4096Sha512,
16 => Self::RsaSignPkcs14096Sha512,
17 => Self::RsaDecryptOaep4096Sha512,
18 => Self::ExternalSymmetricEncryption,
19 => Self::Aes256Gcm,
28 => Self::RsaSignRawPkcs12048,
29 => Self::RsaSignRawPkcs13072,
30 => Self::RsaSignRawPkcs14096,
31 => Self::EcSignSecp256K1Sha256,
32 => Self::HmacSha256,
33 => Self::HmacSha1,
34 => Self::HmacSha384,
35 => Self::HmacSha512,
36 => Self::HmacSha224,
37 => Self::RsaDecryptOaep2048Sha1,
38 => Self::RsaDecryptOaep3072Sha1,
39 => Self::RsaDecryptOaep4096Sha1,
40 => Self::EcSignEd25519,
41 => Self::Aes128Gcm,
42 => Self::Aes128Cbc,
43 => Self::Aes256Cbc,
44 => Self::Aes128Ctr,
45 => Self::Aes256Ctr,
47 => Self::MlKem768,
48 => Self::MlKem1024,
56 => Self::PqSignMlDsa65,
57 => Self::PqSignSlhDsaSha2128S,
60 => Self::PqSignHashSlhDsaSha2128SSha256,
63 => Self::KemXwing,
67 => Self::PqSignMlDsa65ExternalMu,
68 => Self::PqSignMlDsa44,
69 => Self::PqSignMlDsa87,
70 => Self::PqSignMlDsa44ExternalMu,
71 => Self::PqSignMlDsa87ExternalMu,
_ => Self::UnknownValue(crypto_key_version_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CryptoKeyVersionAlgorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
"GOOGLE_SYMMETRIC_ENCRYPTION" => Self::GoogleSymmetricEncryption,
"AES_128_GCM" => Self::Aes128Gcm,
"AES_256_GCM" => Self::Aes256Gcm,
"AES_128_CBC" => Self::Aes128Cbc,
"AES_256_CBC" => Self::Aes256Cbc,
"AES_128_CTR" => Self::Aes128Ctr,
"AES_256_CTR" => Self::Aes256Ctr,
"RSA_SIGN_PSS_2048_SHA256" => Self::RsaSignPss2048Sha256,
"RSA_SIGN_PSS_3072_SHA256" => Self::RsaSignPss3072Sha256,
"RSA_SIGN_PSS_4096_SHA256" => Self::RsaSignPss4096Sha256,
"RSA_SIGN_PSS_4096_SHA512" => Self::RsaSignPss4096Sha512,
"RSA_SIGN_PKCS1_2048_SHA256" => Self::RsaSignPkcs12048Sha256,
"RSA_SIGN_PKCS1_3072_SHA256" => Self::RsaSignPkcs13072Sha256,
"RSA_SIGN_PKCS1_4096_SHA256" => Self::RsaSignPkcs14096Sha256,
"RSA_SIGN_PKCS1_4096_SHA512" => Self::RsaSignPkcs14096Sha512,
"RSA_SIGN_RAW_PKCS1_2048" => Self::RsaSignRawPkcs12048,
"RSA_SIGN_RAW_PKCS1_3072" => Self::RsaSignRawPkcs13072,
"RSA_SIGN_RAW_PKCS1_4096" => Self::RsaSignRawPkcs14096,
"RSA_DECRYPT_OAEP_2048_SHA256" => Self::RsaDecryptOaep2048Sha256,
"RSA_DECRYPT_OAEP_3072_SHA256" => Self::RsaDecryptOaep3072Sha256,
"RSA_DECRYPT_OAEP_4096_SHA256" => Self::RsaDecryptOaep4096Sha256,
"RSA_DECRYPT_OAEP_4096_SHA512" => Self::RsaDecryptOaep4096Sha512,
"RSA_DECRYPT_OAEP_2048_SHA1" => Self::RsaDecryptOaep2048Sha1,
"RSA_DECRYPT_OAEP_3072_SHA1" => Self::RsaDecryptOaep3072Sha1,
"RSA_DECRYPT_OAEP_4096_SHA1" => Self::RsaDecryptOaep4096Sha1,
"EC_SIGN_P256_SHA256" => Self::EcSignP256Sha256,
"EC_SIGN_P384_SHA384" => Self::EcSignP384Sha384,
"EC_SIGN_SECP256K1_SHA256" => Self::EcSignSecp256K1Sha256,
"EC_SIGN_ED25519" => Self::EcSignEd25519,
"HMAC_SHA256" => Self::HmacSha256,
"HMAC_SHA1" => Self::HmacSha1,
"HMAC_SHA384" => Self::HmacSha384,
"HMAC_SHA512" => Self::HmacSha512,
"HMAC_SHA224" => Self::HmacSha224,
"EXTERNAL_SYMMETRIC_ENCRYPTION" => Self::ExternalSymmetricEncryption,
"ML_KEM_768" => Self::MlKem768,
"ML_KEM_1024" => Self::MlKem1024,
"KEM_XWING" => Self::KemXwing,
"PQ_SIGN_ML_DSA_44" => Self::PqSignMlDsa44,
"PQ_SIGN_ML_DSA_65" => Self::PqSignMlDsa65,
"PQ_SIGN_ML_DSA_87" => Self::PqSignMlDsa87,
"PQ_SIGN_SLH_DSA_SHA2_128S" => Self::PqSignSlhDsaSha2128S,
"PQ_SIGN_HASH_SLH_DSA_SHA2_128S_SHA256" => Self::PqSignHashSlhDsaSha2128SSha256,
"PQ_SIGN_ML_DSA_44_EXTERNAL_MU" => Self::PqSignMlDsa44ExternalMu,
"PQ_SIGN_ML_DSA_65_EXTERNAL_MU" => Self::PqSignMlDsa65ExternalMu,
"PQ_SIGN_ML_DSA_87_EXTERNAL_MU" => Self::PqSignMlDsa87ExternalMu,
_ => Self::UnknownValue(crypto_key_version_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CryptoKeyVersionAlgorithm {
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::GoogleSymmetricEncryption => serializer.serialize_i32(1),
Self::Aes128Gcm => serializer.serialize_i32(41),
Self::Aes256Gcm => serializer.serialize_i32(19),
Self::Aes128Cbc => serializer.serialize_i32(42),
Self::Aes256Cbc => serializer.serialize_i32(43),
Self::Aes128Ctr => serializer.serialize_i32(44),
Self::Aes256Ctr => serializer.serialize_i32(45),
Self::RsaSignPss2048Sha256 => serializer.serialize_i32(2),
Self::RsaSignPss3072Sha256 => serializer.serialize_i32(3),
Self::RsaSignPss4096Sha256 => serializer.serialize_i32(4),
Self::RsaSignPss4096Sha512 => serializer.serialize_i32(15),
Self::RsaSignPkcs12048Sha256 => serializer.serialize_i32(5),
Self::RsaSignPkcs13072Sha256 => serializer.serialize_i32(6),
Self::RsaSignPkcs14096Sha256 => serializer.serialize_i32(7),
Self::RsaSignPkcs14096Sha512 => serializer.serialize_i32(16),
Self::RsaSignRawPkcs12048 => serializer.serialize_i32(28),
Self::RsaSignRawPkcs13072 => serializer.serialize_i32(29),
Self::RsaSignRawPkcs14096 => serializer.serialize_i32(30),
Self::RsaDecryptOaep2048Sha256 => serializer.serialize_i32(8),
Self::RsaDecryptOaep3072Sha256 => serializer.serialize_i32(9),
Self::RsaDecryptOaep4096Sha256 => serializer.serialize_i32(10),
Self::RsaDecryptOaep4096Sha512 => serializer.serialize_i32(17),
Self::RsaDecryptOaep2048Sha1 => serializer.serialize_i32(37),
Self::RsaDecryptOaep3072Sha1 => serializer.serialize_i32(38),
Self::RsaDecryptOaep4096Sha1 => serializer.serialize_i32(39),
Self::EcSignP256Sha256 => serializer.serialize_i32(12),
Self::EcSignP384Sha384 => serializer.serialize_i32(13),
Self::EcSignSecp256K1Sha256 => serializer.serialize_i32(31),
Self::EcSignEd25519 => serializer.serialize_i32(40),
Self::HmacSha256 => serializer.serialize_i32(32),
Self::HmacSha1 => serializer.serialize_i32(33),
Self::HmacSha384 => serializer.serialize_i32(34),
Self::HmacSha512 => serializer.serialize_i32(35),
Self::HmacSha224 => serializer.serialize_i32(36),
Self::ExternalSymmetricEncryption => serializer.serialize_i32(18),
Self::MlKem768 => serializer.serialize_i32(47),
Self::MlKem1024 => serializer.serialize_i32(48),
Self::KemXwing => serializer.serialize_i32(63),
Self::PqSignMlDsa44 => serializer.serialize_i32(68),
Self::PqSignMlDsa65 => serializer.serialize_i32(56),
Self::PqSignMlDsa87 => serializer.serialize_i32(69),
Self::PqSignSlhDsaSha2128S => serializer.serialize_i32(57),
Self::PqSignHashSlhDsaSha2128SSha256 => serializer.serialize_i32(60),
Self::PqSignMlDsa44ExternalMu => serializer.serialize_i32(70),
Self::PqSignMlDsa65ExternalMu => serializer.serialize_i32(67),
Self::PqSignMlDsa87ExternalMu => serializer.serialize_i32(71),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CryptoKeyVersionAlgorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<CryptoKeyVersionAlgorithm>::new(
".google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CryptoKeyVersionState {
Unspecified,
PendingGeneration,
Enabled,
Disabled,
Destroyed,
DestroyScheduled,
PendingImport,
ImportFailed,
GenerationFailed,
PendingExternalDestruction,
ExternalDestructionFailed,
UnknownValue(crypto_key_version_state::UnknownValue),
}
#[doc(hidden)]
pub mod crypto_key_version_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CryptoKeyVersionState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PendingGeneration => std::option::Option::Some(5),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::Destroyed => std::option::Option::Some(3),
Self::DestroyScheduled => std::option::Option::Some(4),
Self::PendingImport => std::option::Option::Some(6),
Self::ImportFailed => std::option::Option::Some(7),
Self::GenerationFailed => std::option::Option::Some(8),
Self::PendingExternalDestruction => std::option::Option::Some(9),
Self::ExternalDestructionFailed => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("CRYPTO_KEY_VERSION_STATE_UNSPECIFIED")
}
Self::PendingGeneration => std::option::Option::Some("PENDING_GENERATION"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Destroyed => std::option::Option::Some("DESTROYED"),
Self::DestroyScheduled => std::option::Option::Some("DESTROY_SCHEDULED"),
Self::PendingImport => std::option::Option::Some("PENDING_IMPORT"),
Self::ImportFailed => std::option::Option::Some("IMPORT_FAILED"),
Self::GenerationFailed => std::option::Option::Some("GENERATION_FAILED"),
Self::PendingExternalDestruction => {
std::option::Option::Some("PENDING_EXTERNAL_DESTRUCTION")
}
Self::ExternalDestructionFailed => {
std::option::Option::Some("EXTERNAL_DESTRUCTION_FAILED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CryptoKeyVersionState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CryptoKeyVersionState {
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 CryptoKeyVersionState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
3 => Self::Destroyed,
4 => Self::DestroyScheduled,
5 => Self::PendingGeneration,
6 => Self::PendingImport,
7 => Self::ImportFailed,
8 => Self::GenerationFailed,
9 => Self::PendingExternalDestruction,
10 => Self::ExternalDestructionFailed,
_ => Self::UnknownValue(crypto_key_version_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CryptoKeyVersionState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING_GENERATION" => Self::PendingGeneration,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"DESTROYED" => Self::Destroyed,
"DESTROY_SCHEDULED" => Self::DestroyScheduled,
"PENDING_IMPORT" => Self::PendingImport,
"IMPORT_FAILED" => Self::ImportFailed,
"GENERATION_FAILED" => Self::GenerationFailed,
"PENDING_EXTERNAL_DESTRUCTION" => Self::PendingExternalDestruction,
"EXTERNAL_DESTRUCTION_FAILED" => Self::ExternalDestructionFailed,
_ => Self::UnknownValue(crypto_key_version_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CryptoKeyVersionState {
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::PendingGeneration => serializer.serialize_i32(5),
Self::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::Destroyed => serializer.serialize_i32(3),
Self::DestroyScheduled => serializer.serialize_i32(4),
Self::PendingImport => serializer.serialize_i32(6),
Self::ImportFailed => serializer.serialize_i32(7),
Self::GenerationFailed => serializer.serialize_i32(8),
Self::PendingExternalDestruction => serializer.serialize_i32(9),
Self::ExternalDestructionFailed => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CryptoKeyVersionState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CryptoKeyVersionState>::new(
".google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CryptoKeyVersionView {
Unspecified,
Full,
UnknownValue(crypto_key_version_view::UnknownValue),
}
#[doc(hidden)]
pub mod crypto_key_version_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CryptoKeyVersionView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Full => 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("CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED")
}
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CryptoKeyVersionView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CryptoKeyVersionView {
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 CryptoKeyVersionView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Full,
_ => Self::UnknownValue(crypto_key_version_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CryptoKeyVersionView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED" => Self::Unspecified,
"FULL" => Self::Full,
_ => Self::UnknownValue(crypto_key_version_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CryptoKeyVersionView {
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::Full => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CryptoKeyVersionView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CryptoKeyVersionView>::new(
".google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChecksummedData {
pub data: ::bytes::Bytes,
pub crc32c_checksum: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChecksummedData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
pub fn set_crc32c_checksum<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.crc32c_checksum = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_crc32c_checksum<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.crc32c_checksum = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ChecksummedData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ChecksummedData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PublicKey {
pub pem: std::string::String,
pub algorithm: crate::model::crypto_key_version::CryptoKeyVersionAlgorithm,
pub pem_crc32c: std::option::Option<wkt::Int64Value>,
pub name: std::string::String,
pub protection_level: crate::model::ProtectionLevel,
pub public_key_format: crate::model::public_key::PublicKeyFormat,
pub public_key: std::option::Option<crate::model::ChecksummedData>,
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_pem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pem = v.into();
self
}
pub fn set_algorithm<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
>(
mut self,
v: T,
) -> Self {
self.algorithm = v.into();
self
}
pub fn set_pem_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.pem_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pem_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.pem_crc32c = v.map(|x| x.into());
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
pub fn set_public_key_format<
T: std::convert::Into<crate::model::public_key::PublicKeyFormat>,
>(
mut self,
v: T,
) -> Self {
self.public_key_format = v.into();
self
}
pub fn set_public_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ChecksummedData>,
{
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::ChecksummedData>,
{
self.public_key = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PublicKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.PublicKey"
}
}
pub mod public_key {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PublicKeyFormat {
Unspecified,
Pem,
Der,
NistPqc,
XwingRawBytes,
UnknownValue(public_key_format::UnknownValue),
}
#[doc(hidden)]
pub mod public_key_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PublicKeyFormat {
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::NistPqc => std::option::Option::Some(3),
Self::XwingRawBytes => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PUBLIC_KEY_FORMAT_UNSPECIFIED"),
Self::Pem => std::option::Option::Some("PEM"),
Self::Der => std::option::Option::Some("DER"),
Self::NistPqc => std::option::Option::Some("NIST_PQC"),
Self::XwingRawBytes => std::option::Option::Some("XWING_RAW_BYTES"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PublicKeyFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PublicKeyFormat {
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 PublicKeyFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pem,
2 => Self::Der,
3 => Self::NistPqc,
4 => Self::XwingRawBytes,
_ => Self::UnknownValue(public_key_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PublicKeyFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PUBLIC_KEY_FORMAT_UNSPECIFIED" => Self::Unspecified,
"PEM" => Self::Pem,
"DER" => Self::Der,
"NIST_PQC" => Self::NistPqc,
"XWING_RAW_BYTES" => Self::XwingRawBytes,
_ => Self::UnknownValue(public_key_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PublicKeyFormat {
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::NistPqc => serializer.serialize_i32(3),
Self::XwingRawBytes => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PublicKeyFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PublicKeyFormat>::new(
".google.cloud.kms.v1.PublicKey.PublicKeyFormat",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportJob {
pub name: std::string::String,
pub import_method: crate::model::import_job::ImportMethod,
pub protection_level: crate::model::ProtectionLevel,
pub create_time: std::option::Option<wkt::Timestamp>,
pub generate_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub expire_event_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::import_job::ImportJobState,
pub public_key: std::option::Option<crate::model::import_job::WrappingPublicKey>,
pub attestation: std::option::Option<crate::model::KeyOperationAttestation>,
pub crypto_key_backend: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportJob {
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_import_method<T: std::convert::Into<crate::model::import_job::ImportMethod>>(
mut self,
v: T,
) -> Self {
self.import_method = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = 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_generate_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.generate_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_generate_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.generate_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_expire_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_event_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::import_job::ImportJobState>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_public_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::import_job::WrappingPublicKey>,
{
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::import_job::WrappingPublicKey>,
{
self.public_key = v.map(|x| x.into());
self
}
pub fn set_attestation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KeyOperationAttestation>,
{
self.attestation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attestation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KeyOperationAttestation>,
{
self.attestation = v.map(|x| x.into());
self
}
pub fn set_crypto_key_backend<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.crypto_key_backend = v.into();
self
}
}
impl wkt::message::Message for ImportJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ImportJob"
}
}
pub mod import_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WrappingPublicKey {
pub pem: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WrappingPublicKey {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pem = v.into();
self
}
}
impl wkt::message::Message for WrappingPublicKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ImportJob.WrappingPublicKey"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImportMethod {
Unspecified,
RsaOaep3072Sha1Aes256,
RsaOaep4096Sha1Aes256,
RsaOaep3072Sha256Aes256,
RsaOaep4096Sha256Aes256,
RsaOaep3072Sha256,
RsaOaep4096Sha256,
UnknownValue(import_method::UnknownValue),
}
#[doc(hidden)]
pub mod import_method {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImportMethod {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RsaOaep3072Sha1Aes256 => std::option::Option::Some(1),
Self::RsaOaep4096Sha1Aes256 => std::option::Option::Some(2),
Self::RsaOaep3072Sha256Aes256 => std::option::Option::Some(3),
Self::RsaOaep4096Sha256Aes256 => std::option::Option::Some(4),
Self::RsaOaep3072Sha256 => std::option::Option::Some(5),
Self::RsaOaep4096Sha256 => 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("IMPORT_METHOD_UNSPECIFIED"),
Self::RsaOaep3072Sha1Aes256 => {
std::option::Option::Some("RSA_OAEP_3072_SHA1_AES_256")
}
Self::RsaOaep4096Sha1Aes256 => {
std::option::Option::Some("RSA_OAEP_4096_SHA1_AES_256")
}
Self::RsaOaep3072Sha256Aes256 => {
std::option::Option::Some("RSA_OAEP_3072_SHA256_AES_256")
}
Self::RsaOaep4096Sha256Aes256 => {
std::option::Option::Some("RSA_OAEP_4096_SHA256_AES_256")
}
Self::RsaOaep3072Sha256 => std::option::Option::Some("RSA_OAEP_3072_SHA256"),
Self::RsaOaep4096Sha256 => std::option::Option::Some("RSA_OAEP_4096_SHA256"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImportMethod {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImportMethod {
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 ImportMethod {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RsaOaep3072Sha1Aes256,
2 => Self::RsaOaep4096Sha1Aes256,
3 => Self::RsaOaep3072Sha256Aes256,
4 => Self::RsaOaep4096Sha256Aes256,
5 => Self::RsaOaep3072Sha256,
6 => Self::RsaOaep4096Sha256,
_ => Self::UnknownValue(import_method::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImportMethod {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPORT_METHOD_UNSPECIFIED" => Self::Unspecified,
"RSA_OAEP_3072_SHA1_AES_256" => Self::RsaOaep3072Sha1Aes256,
"RSA_OAEP_4096_SHA1_AES_256" => Self::RsaOaep4096Sha1Aes256,
"RSA_OAEP_3072_SHA256_AES_256" => Self::RsaOaep3072Sha256Aes256,
"RSA_OAEP_4096_SHA256_AES_256" => Self::RsaOaep4096Sha256Aes256,
"RSA_OAEP_3072_SHA256" => Self::RsaOaep3072Sha256,
"RSA_OAEP_4096_SHA256" => Self::RsaOaep4096Sha256,
_ => Self::UnknownValue(import_method::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImportMethod {
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::RsaOaep3072Sha1Aes256 => serializer.serialize_i32(1),
Self::RsaOaep4096Sha1Aes256 => serializer.serialize_i32(2),
Self::RsaOaep3072Sha256Aes256 => serializer.serialize_i32(3),
Self::RsaOaep4096Sha256Aes256 => serializer.serialize_i32(4),
Self::RsaOaep3072Sha256 => serializer.serialize_i32(5),
Self::RsaOaep4096Sha256 => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ImportMethod {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportMethod>::new(
".google.cloud.kms.v1.ImportJob.ImportMethod",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImportJobState {
Unspecified,
PendingGeneration,
Active,
Expired,
UnknownValue(import_job_state::UnknownValue),
}
#[doc(hidden)]
pub mod import_job_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImportJobState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PendingGeneration => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Expired => 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("IMPORT_JOB_STATE_UNSPECIFIED"),
Self::PendingGeneration => std::option::Option::Some("PENDING_GENERATION"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Expired => std::option::Option::Some("EXPIRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImportJobState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImportJobState {
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 ImportJobState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PendingGeneration,
2 => Self::Active,
3 => Self::Expired,
_ => Self::UnknownValue(import_job_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImportJobState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPORT_JOB_STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING_GENERATION" => Self::PendingGeneration,
"ACTIVE" => Self::Active,
"EXPIRED" => Self::Expired,
_ => Self::UnknownValue(import_job_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImportJobState {
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::PendingGeneration => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Expired => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ImportJobState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportJobState>::new(
".google.cloud.kms.v1.ImportJob.ImportJobState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExternalProtectionLevelOptions {
pub external_key_uri: std::string::String,
pub ekm_connection_key_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExternalProtectionLevelOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_external_key_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.external_key_uri = v.into();
self
}
pub fn set_ekm_connection_key_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.ekm_connection_key_path = v.into();
self
}
}
impl wkt::message::Message for ExternalProtectionLevelOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ExternalProtectionLevelOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyAccessJustificationsPolicy {
pub allowed_access_reasons: std::vec::Vec<crate::model::AccessReason>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyAccessJustificationsPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_access_reasons<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AccessReason>,
{
use std::iter::Iterator;
self.allowed_access_reasons = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for KeyAccessJustificationsPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.KeyAccessJustificationsPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetiredResource {
pub name: std::string::String,
pub original_resource: std::string::String,
pub resource_type: std::string::String,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetiredResource {
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_original_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.original_resource = v.into();
self
}
pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_type = v.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
}
}
impl wkt::message::Message for RetiredResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.RetiredResource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListKeyRingsRequest {
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 ListKeyRingsRequest {
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 ListKeyRingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListKeyRingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCryptoKeysRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub version_view: crate::model::crypto_key_version::CryptoKeyVersionView,
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 ListCryptoKeysRequest {
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_version_view<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionView>,
>(
mut self,
v: T,
) -> Self {
self.version_view = 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 ListCryptoKeysRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListCryptoKeysRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCryptoKeyVersionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::crypto_key_version::CryptoKeyVersionView,
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 ListCryptoKeyVersionsRequest {
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_view<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionView>,
>(
mut self,
v: T,
) -> Self {
self.view = 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 ListCryptoKeyVersionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListCryptoKeyVersionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImportJobsRequest {
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 ListImportJobsRequest {
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 ListImportJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListImportJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRetiredResourcesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRetiredResourcesRequest {
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
}
}
impl wkt::message::Message for ListRetiredResourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListRetiredResourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListKeyRingsResponse {
pub key_rings: std::vec::Vec<crate::model::KeyRing>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListKeyRingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_rings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::KeyRing>,
{
use std::iter::Iterator;
self.key_rings = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListKeyRingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListKeyRingsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListKeyRingsResponse {
type PageItem = crate::model::KeyRing;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.key_rings
}
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 ListCryptoKeysResponse {
pub crypto_keys: std::vec::Vec<crate::model::CryptoKey>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCryptoKeysResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_crypto_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CryptoKey>,
{
use std::iter::Iterator;
self.crypto_keys = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListCryptoKeysResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListCryptoKeysResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCryptoKeysResponse {
type PageItem = crate::model::CryptoKey;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.crypto_keys
}
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 ListCryptoKeyVersionsResponse {
pub crypto_key_versions: std::vec::Vec<crate::model::CryptoKeyVersion>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCryptoKeyVersionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_crypto_key_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CryptoKeyVersion>,
{
use std::iter::Iterator;
self.crypto_key_versions = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListCryptoKeyVersionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListCryptoKeyVersionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCryptoKeyVersionsResponse {
type PageItem = crate::model::CryptoKeyVersion;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.crypto_key_versions
}
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 ListImportJobsResponse {
pub import_jobs: std::vec::Vec<crate::model::ImportJob>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListImportJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_import_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImportJob>,
{
use std::iter::Iterator;
self.import_jobs = 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_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListImportJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListImportJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListImportJobsResponse {
type PageItem = crate::model::ImportJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.import_jobs
}
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 ListRetiredResourcesResponse {
pub retired_resources: std::vec::Vec<crate::model::RetiredResource>,
pub next_page_token: std::string::String,
pub total_size: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRetiredResourcesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retired_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RetiredResource>,
{
use std::iter::Iterator;
self.retired_resources = 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_total_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListRetiredResourcesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ListRetiredResourcesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRetiredResourcesResponse {
type PageItem = crate::model::RetiredResource;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.retired_resources
}
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 GetKeyRingRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetKeyRingRequest {
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 GetKeyRingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetKeyRingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCryptoKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCryptoKeyRequest {
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 GetCryptoKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetCryptoKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCryptoKeyVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCryptoKeyVersionRequest {
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 GetCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetCryptoKeyVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPublicKeyRequest {
pub name: std::string::String,
pub public_key_format: crate::model::public_key::PublicKeyFormat,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetPublicKeyRequest {
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_public_key_format<
T: std::convert::Into<crate::model::public_key::PublicKeyFormat>,
>(
mut self,
v: T,
) -> Self {
self.public_key_format = v.into();
self
}
}
impl wkt::message::Message for GetPublicKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetPublicKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetImportJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetImportJobRequest {
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 GetImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRetiredResourceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRetiredResourceRequest {
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 GetRetiredResourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GetRetiredResourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateKeyRingRequest {
pub parent: std::string::String,
pub key_ring_id: std::string::String,
pub key_ring: std::option::Option<crate::model::KeyRing>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateKeyRingRequest {
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_key_ring_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_ring_id = v.into();
self
}
pub fn set_key_ring<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KeyRing>,
{
self.key_ring = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_key_ring<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KeyRing>,
{
self.key_ring = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateKeyRingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateKeyRingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCryptoKeyRequest {
pub parent: std::string::String,
pub crypto_key_id: std::string::String,
pub crypto_key: std::option::Option<crate::model::CryptoKey>,
pub skip_initial_version_creation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCryptoKeyRequest {
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_crypto_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.crypto_key_id = v.into();
self
}
pub fn set_crypto_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CryptoKey>,
{
self.crypto_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CryptoKey>,
{
self.crypto_key = v.map(|x| x.into());
self
}
pub fn set_skip_initial_version_creation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_initial_version_creation = v.into();
self
}
}
impl wkt::message::Message for CreateCryptoKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateCryptoKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCryptoKeyVersionRequest {
pub parent: std::string::String,
pub crypto_key_version: std::option::Option<crate::model::CryptoKeyVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCryptoKeyVersionRequest {
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_crypto_key_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersion>,
{
self.crypto_key_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersion>,
{
self.crypto_key_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateCryptoKeyVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCryptoKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCryptoKeyRequest {
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 DeleteCryptoKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DeleteCryptoKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCryptoKeyVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCryptoKeyVersionRequest {
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 DeleteCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DeleteCryptoKeyVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportCryptoKeyVersionRequest {
pub parent: std::string::String,
pub crypto_key_version: std::string::String,
pub algorithm: crate::model::crypto_key_version::CryptoKeyVersionAlgorithm,
pub import_job: std::string::String,
pub wrapped_key: ::bytes::Bytes,
pub wrapped_key_material:
std::option::Option<crate::model::import_crypto_key_version_request::WrappedKeyMaterial>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportCryptoKeyVersionRequest {
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_crypto_key_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.crypto_key_version = v.into();
self
}
pub fn set_algorithm<
T: std::convert::Into<crate::model::crypto_key_version::CryptoKeyVersionAlgorithm>,
>(
mut self,
v: T,
) -> Self {
self.algorithm = v.into();
self
}
pub fn set_import_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.import_job = v.into();
self
}
pub fn set_wrapped_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.wrapped_key = v.into();
self
}
pub fn set_wrapped_key_material<
T: std::convert::Into<
std::option::Option<
crate::model::import_crypto_key_version_request::WrappedKeyMaterial,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.wrapped_key_material = v.into();
self
}
pub fn rsa_aes_wrapped_key(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.wrapped_key_material.as_ref().and_then(|v| match v {
crate::model::import_crypto_key_version_request::WrappedKeyMaterial::RsaAesWrappedKey(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_rsa_aes_wrapped_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.wrapped_key_material = std::option::Option::Some(
crate::model::import_crypto_key_version_request::WrappedKeyMaterial::RsaAesWrappedKey(
v.into(),
),
);
self
}
}
impl wkt::message::Message for ImportCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.ImportCryptoKeyVersionRequest"
}
}
pub mod import_crypto_key_version_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum WrappedKeyMaterial {
RsaAesWrappedKey(::bytes::Bytes),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateImportJobRequest {
pub parent: std::string::String,
pub import_job_id: std::string::String,
pub import_job: std::option::Option<crate::model::ImportJob>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateImportJobRequest {
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_import_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.import_job_id = v.into();
self
}
pub fn set_import_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImportJob>,
{
self.import_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImportJob>,
{
self.import_job = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.CreateImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCryptoKeyRequest {
pub crypto_key: std::option::Option<crate::model::CryptoKey>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCryptoKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_crypto_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CryptoKey>,
{
self.crypto_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_crypto_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CryptoKey>,
{
self.crypto_key = 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
}
}
impl wkt::message::Message for UpdateCryptoKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.UpdateCryptoKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCryptoKeyVersionRequest {
pub crypto_key_version: std::option::Option<crate::model::CryptoKeyVersion>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCryptoKeyVersionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_crypto_key_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersion>,
{
self.crypto_key_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_crypto_key_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CryptoKeyVersion>,
{
self.crypto_key_version = 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
}
}
impl wkt::message::Message for UpdateCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.UpdateCryptoKeyVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCryptoKeyPrimaryVersionRequest {
pub name: std::string::String,
pub crypto_key_version_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCryptoKeyPrimaryVersionRequest {
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_crypto_key_version_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.crypto_key_version_id = v.into();
self
}
}
impl wkt::message::Message for UpdateCryptoKeyPrimaryVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestroyCryptoKeyVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestroyCryptoKeyVersionRequest {
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 DestroyCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DestroyCryptoKeyVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreCryptoKeyVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreCryptoKeyVersionRequest {
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 RestoreCryptoKeyVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.RestoreCryptoKeyVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptRequest {
pub name: std::string::String,
pub plaintext: ::bytes::Bytes,
pub additional_authenticated_data: ::bytes::Bytes,
pub plaintext_crc32c: std::option::Option<wkt::Int64Value>,
pub additional_authenticated_data_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptRequest {
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_plaintext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.plaintext = v.into();
self
}
pub fn set_additional_authenticated_data<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.additional_authenticated_data = v.into();
self
}
pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = v.map(|x| x.into());
self
}
pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EncryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.EncryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DecryptRequest {
pub name: std::string::String,
pub ciphertext: ::bytes::Bytes,
pub additional_authenticated_data: ::bytes::Bytes,
pub ciphertext_crc32c: std::option::Option<wkt::Int64Value>,
pub additional_authenticated_data_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DecryptRequest {
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_ciphertext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ciphertext = v.into();
self
}
pub fn set_additional_authenticated_data<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.additional_authenticated_data = v.into();
self
}
pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = v.map(|x| x.into());
self
}
pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DecryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DecryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RawEncryptRequest {
pub name: std::string::String,
pub plaintext: ::bytes::Bytes,
pub additional_authenticated_data: ::bytes::Bytes,
pub plaintext_crc32c: std::option::Option<wkt::Int64Value>,
pub additional_authenticated_data_crc32c: std::option::Option<wkt::Int64Value>,
pub initialization_vector: ::bytes::Bytes,
pub initialization_vector_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RawEncryptRequest {
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_plaintext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.plaintext = v.into();
self
}
pub fn set_additional_authenticated_data<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.additional_authenticated_data = v.into();
self
}
pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = v.map(|x| x.into());
self
}
pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = v.map(|x| x.into());
self
}
pub fn set_initialization_vector<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.initialization_vector = v.into();
self
}
pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.initialization_vector_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_initialization_vector_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.initialization_vector_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RawEncryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.RawEncryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RawDecryptRequest {
pub name: std::string::String,
pub ciphertext: ::bytes::Bytes,
pub additional_authenticated_data: ::bytes::Bytes,
pub initialization_vector: ::bytes::Bytes,
pub tag_length: i32,
pub ciphertext_crc32c: std::option::Option<wkt::Int64Value>,
pub additional_authenticated_data_crc32c: std::option::Option<wkt::Int64Value>,
pub initialization_vector_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RawDecryptRequest {
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_ciphertext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ciphertext = v.into();
self
}
pub fn set_additional_authenticated_data<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.additional_authenticated_data = v.into();
self
}
pub fn set_initialization_vector<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.initialization_vector = v.into();
self
}
pub fn set_tag_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.tag_length = v.into();
self
}
pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = v.map(|x| x.into());
self
}
pub fn set_additional_authenticated_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_additional_authenticated_data_crc32c<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.additional_authenticated_data_crc32c = v.map(|x| x.into());
self
}
pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.initialization_vector_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_initialization_vector_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.initialization_vector_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RawDecryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.RawDecryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AsymmetricSignRequest {
pub name: std::string::String,
pub digest: std::option::Option<crate::model::Digest>,
pub digest_crc32c: std::option::Option<wkt::Int64Value>,
pub data: ::bytes::Bytes,
pub data_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AsymmetricSignRequest {
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_digest<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Digest>,
{
self.digest = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Digest>,
{
self.digest = v.map(|x| x.into());
self
}
pub fn set_digest_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.digest_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_digest_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.digest_crc32c = v.map(|x| x.into());
self
}
pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
pub fn set_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AsymmetricSignRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.AsymmetricSignRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AsymmetricDecryptRequest {
pub name: std::string::String,
pub ciphertext: ::bytes::Bytes,
pub ciphertext_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AsymmetricDecryptRequest {
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_ciphertext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ciphertext = v.into();
self
}
pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AsymmetricDecryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.AsymmetricDecryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MacSignRequest {
pub name: std::string::String,
pub data: ::bytes::Bytes,
pub data_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MacSignRequest {
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_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
pub fn set_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MacSignRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.MacSignRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MacVerifyRequest {
pub name: std::string::String,
pub data: ::bytes::Bytes,
pub data_crc32c: std::option::Option<wkt::Int64Value>,
pub mac: ::bytes::Bytes,
pub mac_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MacVerifyRequest {
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_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
pub fn set_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = v.map(|x| x.into());
self
}
pub fn set_mac<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.mac = v.into();
self
}
pub fn set_mac_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.mac_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mac_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.mac_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MacVerifyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.MacVerifyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DecapsulateRequest {
pub name: std::string::String,
pub ciphertext: ::bytes::Bytes,
pub ciphertext_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DecapsulateRequest {
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_ciphertext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ciphertext = v.into();
self
}
pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DecapsulateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DecapsulateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateRandomBytesRequest {
pub location: std::string::String,
pub length_bytes: i32,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateRandomBytesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_length_bytes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.length_bytes = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for GenerateRandomBytesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GenerateRandomBytesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptResponse {
pub name: std::string::String,
pub ciphertext: ::bytes::Bytes,
pub ciphertext_crc32c: std::option::Option<wkt::Int64Value>,
pub verified_plaintext_crc32c: bool,
pub verified_additional_authenticated_data_crc32c: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptResponse {
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_ciphertext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ciphertext = v.into();
self
}
pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = v.map(|x| x.into());
self
}
pub fn set_verified_plaintext_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_plaintext_crc32c = v.into();
self
}
pub fn set_verified_additional_authenticated_data_crc32c<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.verified_additional_authenticated_data_crc32c = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for EncryptResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.EncryptResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DecryptResponse {
pub plaintext: ::bytes::Bytes,
pub plaintext_crc32c: std::option::Option<wkt::Int64Value>,
pub used_primary: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DecryptResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_plaintext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.plaintext = v.into();
self
}
pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = v.map(|x| x.into());
self
}
pub fn set_used_primary<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.used_primary = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for DecryptResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DecryptResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RawEncryptResponse {
pub ciphertext: ::bytes::Bytes,
pub initialization_vector: ::bytes::Bytes,
pub tag_length: i32,
pub ciphertext_crc32c: std::option::Option<wkt::Int64Value>,
pub initialization_vector_crc32c: std::option::Option<wkt::Int64Value>,
pub verified_plaintext_crc32c: bool,
pub verified_additional_authenticated_data_crc32c: bool,
pub verified_initialization_vector_crc32c: bool,
pub name: std::string::String,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RawEncryptResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ciphertext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.ciphertext = v.into();
self
}
pub fn set_initialization_vector<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.initialization_vector = v.into();
self
}
pub fn set_tag_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.tag_length = v.into();
self
}
pub fn set_ciphertext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ciphertext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.ciphertext_crc32c = v.map(|x| x.into());
self
}
pub fn set_initialization_vector_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.initialization_vector_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_initialization_vector_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.initialization_vector_crc32c = v.map(|x| x.into());
self
}
pub fn set_verified_plaintext_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_plaintext_crc32c = v.into();
self
}
pub fn set_verified_additional_authenticated_data_crc32c<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.verified_additional_authenticated_data_crc32c = v.into();
self
}
pub fn set_verified_initialization_vector_crc32c<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.verified_initialization_vector_crc32c = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for RawEncryptResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.RawEncryptResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RawDecryptResponse {
pub plaintext: ::bytes::Bytes,
pub plaintext_crc32c: std::option::Option<wkt::Int64Value>,
pub protection_level: crate::model::ProtectionLevel,
pub verified_ciphertext_crc32c: bool,
pub verified_additional_authenticated_data_crc32c: bool,
pub verified_initialization_vector_crc32c: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RawDecryptResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_plaintext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.plaintext = v.into();
self
}
pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = v.map(|x| x.into());
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
pub fn set_verified_ciphertext_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_ciphertext_crc32c = v.into();
self
}
pub fn set_verified_additional_authenticated_data_crc32c<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.verified_additional_authenticated_data_crc32c = v.into();
self
}
pub fn set_verified_initialization_vector_crc32c<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.verified_initialization_vector_crc32c = v.into();
self
}
}
impl wkt::message::Message for RawDecryptResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.RawDecryptResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AsymmetricSignResponse {
pub signature: ::bytes::Bytes,
pub signature_crc32c: std::option::Option<wkt::Int64Value>,
pub verified_digest_crc32c: bool,
pub name: std::string::String,
pub verified_data_crc32c: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AsymmetricSignResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.signature = v.into();
self
}
pub fn set_signature_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.signature_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_signature_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.signature_crc32c = v.map(|x| x.into());
self
}
pub fn set_verified_digest_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_digest_crc32c = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_verified_data_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_data_crc32c = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for AsymmetricSignResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.AsymmetricSignResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AsymmetricDecryptResponse {
pub plaintext: ::bytes::Bytes,
pub plaintext_crc32c: std::option::Option<wkt::Int64Value>,
pub verified_ciphertext_crc32c: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AsymmetricDecryptResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_plaintext<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.plaintext = v.into();
self
}
pub fn set_plaintext_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_plaintext_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.plaintext_crc32c = v.map(|x| x.into());
self
}
pub fn set_verified_ciphertext_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_ciphertext_crc32c = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for AsymmetricDecryptResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.AsymmetricDecryptResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MacSignResponse {
pub name: std::string::String,
pub mac: ::bytes::Bytes,
pub mac_crc32c: std::option::Option<wkt::Int64Value>,
pub verified_data_crc32c: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MacSignResponse {
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_mac<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.mac = v.into();
self
}
pub fn set_mac_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.mac_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mac_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.mac_crc32c = v.map(|x| x.into());
self
}
pub fn set_verified_data_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_data_crc32c = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for MacSignResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.MacSignResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MacVerifyResponse {
pub name: std::string::String,
pub success: bool,
pub verified_data_crc32c: bool,
pub verified_mac_crc32c: bool,
pub verified_success_integrity: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MacVerifyResponse {
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_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.success = v.into();
self
}
pub fn set_verified_data_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_data_crc32c = v.into();
self
}
pub fn set_verified_mac_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_mac_crc32c = v.into();
self
}
pub fn set_verified_success_integrity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_success_integrity = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for MacVerifyResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.MacVerifyResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DecapsulateResponse {
pub name: std::string::String,
pub shared_secret: ::bytes::Bytes,
pub shared_secret_crc32c: std::option::Option<i64>,
pub verified_ciphertext_crc32c: bool,
pub protection_level: crate::model::ProtectionLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DecapsulateResponse {
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_shared_secret<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.shared_secret = v.into();
self
}
pub fn set_shared_secret_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.shared_secret_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_shared_secret_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.shared_secret_crc32c = v.map(|x| x.into());
self
}
pub fn set_verified_ciphertext_crc32c<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verified_ciphertext_crc32c = v.into();
self
}
pub fn set_protection_level<T: std::convert::Into<crate::model::ProtectionLevel>>(
mut self,
v: T,
) -> Self {
self.protection_level = v.into();
self
}
}
impl wkt::message::Message for DecapsulateResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DecapsulateResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateRandomBytesResponse {
pub data: ::bytes::Bytes,
pub data_crc32c: std::option::Option<wkt::Int64Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateRandomBytesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
pub fn set_data_crc32c<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GenerateRandomBytesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.GenerateRandomBytesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Digest {
pub digest: std::option::Option<crate::model::digest::Digest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Digest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_digest<T: std::convert::Into<std::option::Option<crate::model::digest::Digest>>>(
mut self,
v: T,
) -> Self {
self.digest = v.into();
self
}
pub fn sha256(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.digest.as_ref().and_then(|v| match v {
crate::model::digest::Digest::Sha256(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sha256<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.digest = std::option::Option::Some(crate::model::digest::Digest::Sha256(v.into()));
self
}
pub fn sha384(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.digest.as_ref().and_then(|v| match v {
crate::model::digest::Digest::Sha384(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sha384<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.digest = std::option::Option::Some(crate::model::digest::Digest::Sha384(v.into()));
self
}
pub fn sha512(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.digest.as_ref().and_then(|v| match v {
crate::model::digest::Digest::Sha512(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sha512<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.digest = std::option::Option::Some(crate::model::digest::Digest::Sha512(v.into()));
self
}
}
impl wkt::message::Message for Digest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.Digest"
}
}
pub mod digest {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Digest {
Sha256(::bytes::Bytes),
Sha384(::bytes::Bytes),
Sha512(::bytes::Bytes),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
pub hsm_available: bool,
pub ekm_available: bool,
pub hsm_single_tenant_available: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hsm_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.hsm_available = v.into();
self
}
pub fn set_ekm_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ekm_available = v.into();
self
}
pub fn set_hsm_single_tenant_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.hsm_single_tenant_available = v.into();
self
}
}
impl wkt::message::Message for LocationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.LocationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCryptoKeyMetadata {
pub retired_resource: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCryptoKeyMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retired_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.retired_resource = v.into();
self
}
}
impl wkt::message::Message for DeleteCryptoKeyMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DeleteCryptoKeyMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCryptoKeyVersionMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCryptoKeyVersionMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteCryptoKeyVersionMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.kms.v1.DeleteCryptoKeyVersionMetadata"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ProtectionLevel {
Unspecified,
Software,
Hsm,
External,
ExternalVpc,
HsmSingleTenant,
UnknownValue(protection_level::UnknownValue),
}
#[doc(hidden)]
pub mod protection_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ProtectionLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Software => std::option::Option::Some(1),
Self::Hsm => std::option::Option::Some(2),
Self::External => std::option::Option::Some(3),
Self::ExternalVpc => std::option::Option::Some(4),
Self::HsmSingleTenant => 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("PROTECTION_LEVEL_UNSPECIFIED"),
Self::Software => std::option::Option::Some("SOFTWARE"),
Self::Hsm => std::option::Option::Some("HSM"),
Self::External => std::option::Option::Some("EXTERNAL"),
Self::ExternalVpc => std::option::Option::Some("EXTERNAL_VPC"),
Self::HsmSingleTenant => std::option::Option::Some("HSM_SINGLE_TENANT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ProtectionLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ProtectionLevel {
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 ProtectionLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Software,
2 => Self::Hsm,
3 => Self::External,
4 => Self::ExternalVpc,
5 => Self::HsmSingleTenant,
_ => Self::UnknownValue(protection_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ProtectionLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PROTECTION_LEVEL_UNSPECIFIED" => Self::Unspecified,
"SOFTWARE" => Self::Software,
"HSM" => Self::Hsm,
"EXTERNAL" => Self::External,
"EXTERNAL_VPC" => Self::ExternalVpc,
"HSM_SINGLE_TENANT" => Self::HsmSingleTenant,
_ => Self::UnknownValue(protection_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ProtectionLevel {
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::Software => serializer.serialize_i32(1),
Self::Hsm => serializer.serialize_i32(2),
Self::External => serializer.serialize_i32(3),
Self::ExternalVpc => serializer.serialize_i32(4),
Self::HsmSingleTenant => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ProtectionLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtectionLevel>::new(
".google.cloud.kms.v1.ProtectionLevel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AccessReason {
ReasonUnspecified,
CustomerInitiatedSupport,
GoogleInitiatedService,
ThirdPartyDataRequest,
GoogleInitiatedReview,
CustomerInitiatedAccess,
GoogleInitiatedSystemOperation,
ReasonNotExpected,
#[deprecated]
ModifiedCustomerInitiatedAccess,
#[deprecated]
ModifiedGoogleInitiatedSystemOperation,
GoogleResponseToProductionAlert,
CustomerAuthorizedWorkflowServicing,
UnknownValue(access_reason::UnknownValue),
}
#[doc(hidden)]
pub mod access_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AccessReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::ReasonUnspecified => std::option::Option::Some(0),
Self::CustomerInitiatedSupport => std::option::Option::Some(1),
Self::GoogleInitiatedService => std::option::Option::Some(2),
Self::ThirdPartyDataRequest => std::option::Option::Some(3),
Self::GoogleInitiatedReview => std::option::Option::Some(4),
Self::CustomerInitiatedAccess => std::option::Option::Some(5),
Self::GoogleInitiatedSystemOperation => std::option::Option::Some(6),
Self::ReasonNotExpected => std::option::Option::Some(7),
Self::ModifiedCustomerInitiatedAccess => std::option::Option::Some(8),
Self::ModifiedGoogleInitiatedSystemOperation => std::option::Option::Some(9),
Self::GoogleResponseToProductionAlert => std::option::Option::Some(10),
Self::CustomerAuthorizedWorkflowServicing => std::option::Option::Some(11),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::ReasonUnspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
Self::CustomerInitiatedSupport => {
std::option::Option::Some("CUSTOMER_INITIATED_SUPPORT")
}
Self::GoogleInitiatedService => std::option::Option::Some("GOOGLE_INITIATED_SERVICE"),
Self::ThirdPartyDataRequest => std::option::Option::Some("THIRD_PARTY_DATA_REQUEST"),
Self::GoogleInitiatedReview => std::option::Option::Some("GOOGLE_INITIATED_REVIEW"),
Self::CustomerInitiatedAccess => std::option::Option::Some("CUSTOMER_INITIATED_ACCESS"),
Self::GoogleInitiatedSystemOperation => {
std::option::Option::Some("GOOGLE_INITIATED_SYSTEM_OPERATION")
}
Self::ReasonNotExpected => std::option::Option::Some("REASON_NOT_EXPECTED"),
Self::ModifiedCustomerInitiatedAccess => {
std::option::Option::Some("MODIFIED_CUSTOMER_INITIATED_ACCESS")
}
Self::ModifiedGoogleInitiatedSystemOperation => {
std::option::Option::Some("MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION")
}
Self::GoogleResponseToProductionAlert => {
std::option::Option::Some("GOOGLE_RESPONSE_TO_PRODUCTION_ALERT")
}
Self::CustomerAuthorizedWorkflowServicing => {
std::option::Option::Some("CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AccessReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AccessReason {
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 AccessReason {
fn from(value: i32) -> Self {
match value {
0 => Self::ReasonUnspecified,
1 => Self::CustomerInitiatedSupport,
2 => Self::GoogleInitiatedService,
3 => Self::ThirdPartyDataRequest,
4 => Self::GoogleInitiatedReview,
5 => Self::CustomerInitiatedAccess,
6 => Self::GoogleInitiatedSystemOperation,
7 => Self::ReasonNotExpected,
8 => Self::ModifiedCustomerInitiatedAccess,
9 => Self::ModifiedGoogleInitiatedSystemOperation,
10 => Self::GoogleResponseToProductionAlert,
11 => Self::CustomerAuthorizedWorkflowServicing,
_ => Self::UnknownValue(access_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AccessReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REASON_UNSPECIFIED" => Self::ReasonUnspecified,
"CUSTOMER_INITIATED_SUPPORT" => Self::CustomerInitiatedSupport,
"GOOGLE_INITIATED_SERVICE" => Self::GoogleInitiatedService,
"THIRD_PARTY_DATA_REQUEST" => Self::ThirdPartyDataRequest,
"GOOGLE_INITIATED_REVIEW" => Self::GoogleInitiatedReview,
"CUSTOMER_INITIATED_ACCESS" => Self::CustomerInitiatedAccess,
"GOOGLE_INITIATED_SYSTEM_OPERATION" => Self::GoogleInitiatedSystemOperation,
"REASON_NOT_EXPECTED" => Self::ReasonNotExpected,
"MODIFIED_CUSTOMER_INITIATED_ACCESS" => Self::ModifiedCustomerInitiatedAccess,
"MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION" => {
Self::ModifiedGoogleInitiatedSystemOperation
}
"GOOGLE_RESPONSE_TO_PRODUCTION_ALERT" => Self::GoogleResponseToProductionAlert,
"CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING" => Self::CustomerAuthorizedWorkflowServicing,
_ => Self::UnknownValue(access_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AccessReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::ReasonUnspecified => serializer.serialize_i32(0),
Self::CustomerInitiatedSupport => serializer.serialize_i32(1),
Self::GoogleInitiatedService => serializer.serialize_i32(2),
Self::ThirdPartyDataRequest => serializer.serialize_i32(3),
Self::GoogleInitiatedReview => serializer.serialize_i32(4),
Self::CustomerInitiatedAccess => serializer.serialize_i32(5),
Self::GoogleInitiatedSystemOperation => serializer.serialize_i32(6),
Self::ReasonNotExpected => serializer.serialize_i32(7),
Self::ModifiedCustomerInitiatedAccess => serializer.serialize_i32(8),
Self::ModifiedGoogleInitiatedSystemOperation => serializer.serialize_i32(9),
Self::GoogleResponseToProductionAlert => serializer.serialize_i32(10),
Self::CustomerAuthorizedWorkflowServicing => serializer.serialize_i32(11),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AccessReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessReason>::new(
".google.cloud.kms.v1.AccessReason",
))
}
}