#![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 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 Secret {
pub name: std::string::String,
pub replication: std::option::Option<crate::model::Replication>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub topics: std::vec::Vec<crate::model::Topic>,
pub etag: std::string::String,
pub rotation: std::option::Option<crate::model::Rotation>,
pub version_aliases: std::collections::HashMap<std::string::String, i64>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub version_destroy_ttl: std::option::Option<wkt::Duration>,
pub customer_managed_encryption: std::option::Option<crate::model::CustomerManagedEncryption>,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub expiration: std::option::Option<crate::model::secret::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Secret {
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_replication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Replication>,
{
self.replication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Replication>,
{
self.replication = 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_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_topics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Topic>,
{
use std::iter::Iterator;
self.topics = 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_rotation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Rotation>,
{
self.rotation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rotation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Rotation>,
{
self.rotation = v.map(|x| x.into());
self
}
pub fn set_version_aliases<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<i64>,
{
use std::iter::Iterator;
self.version_aliases = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_annotations<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.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_version_destroy_ttl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.version_destroy_ttl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_version_destroy_ttl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.version_destroy_ttl = v.map(|x| x.into());
self
}
pub fn set_customer_managed_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryption>,
{
self.customer_managed_encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer_managed_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryption>,
{
self.customer_managed_encryption = v.map(|x| x.into());
self
}
pub fn set_tags<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.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_expiration<
T: std::convert::Into<std::option::Option<crate::model::secret::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::secret::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::secret::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::secret::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::secret::Expiration::Ttl(v.into()));
self
}
}
impl wkt::message::Message for Secret {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Secret"
}
}
pub mod secret {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
ExpireTime(std::boxed::Box<wkt::Timestamp>),
Ttl(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecretVersion {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub destroy_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::secret_version::State,
pub replication_status: std::option::Option<crate::model::ReplicationStatus>,
pub etag: std::string::String,
pub client_specified_payload_checksum: bool,
pub scheduled_destroy_time: std::option::Option<wkt::Timestamp>,
pub customer_managed_encryption:
std::option::Option<crate::model::CustomerManagedEncryptionStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecretVersion {
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_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_state<T: std::convert::Into<crate::model::secret_version::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_replication_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReplicationStatus>,
{
self.replication_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReplicationStatus>,
{
self.replication_status = v.map(|x| x.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_client_specified_payload_checksum<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.client_specified_payload_checksum = v.into();
self
}
pub fn set_scheduled_destroy_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.scheduled_destroy_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scheduled_destroy_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.scheduled_destroy_time = v.map(|x| x.into());
self
}
pub fn set_customer_managed_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryptionStatus>,
{
self.customer_managed_encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer_managed_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryptionStatus>,
{
self.customer_managed_encryption = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SecretVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.SecretVersion"
}
}
pub mod secret_version {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Enabled,
Disabled,
Destroyed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::Destroyed => 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("STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Destroyed => std::option::Option::Some("DESTROYED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
3 => Self::Destroyed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"DESTROYED" => Self::Destroyed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::Destroyed => serializer.serialize_i32(3),
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.secretmanager.v1.SecretVersion.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Replication {
pub replication: std::option::Option<crate::model::replication::Replication>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Replication {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replication<
T: std::convert::Into<std::option::Option<crate::model::replication::Replication>>,
>(
mut self,
v: T,
) -> Self {
self.replication = v.into();
self
}
pub fn automatic(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::replication::Automatic>> {
#[allow(unreachable_patterns)]
self.replication.as_ref().and_then(|v| match v {
crate::model::replication::Replication::Automatic(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_automatic<
T: std::convert::Into<std::boxed::Box<crate::model::replication::Automatic>>,
>(
mut self,
v: T,
) -> Self {
self.replication =
std::option::Option::Some(crate::model::replication::Replication::Automatic(v.into()));
self
}
pub fn user_managed(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::replication::UserManaged>> {
#[allow(unreachable_patterns)]
self.replication.as_ref().and_then(|v| match v {
crate::model::replication::Replication::UserManaged(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_user_managed<
T: std::convert::Into<std::boxed::Box<crate::model::replication::UserManaged>>,
>(
mut self,
v: T,
) -> Self {
self.replication = std::option::Option::Some(
crate::model::replication::Replication::UserManaged(v.into()),
);
self
}
}
impl wkt::message::Message for Replication {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Replication"
}
}
pub mod replication {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Automatic {
pub customer_managed_encryption:
std::option::Option<crate::model::CustomerManagedEncryption>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Automatic {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_customer_managed_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryption>,
{
self.customer_managed_encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer_managed_encryption<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryption>,
{
self.customer_managed_encryption = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Automatic {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Replication.Automatic"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserManaged {
pub replicas: std::vec::Vec<crate::model::replication::user_managed::Replica>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserManaged {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replicas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::replication::user_managed::Replica>,
{
use std::iter::Iterator;
self.replicas = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UserManaged {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Replication.UserManaged"
}
}
pub mod user_managed {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Replica {
pub location: std::string::String,
pub customer_managed_encryption:
std::option::Option<crate::model::CustomerManagedEncryption>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Replica {
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_customer_managed_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryption>,
{
self.customer_managed_encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer_managed_encryption<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryption>,
{
self.customer_managed_encryption = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Replica {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Replication.UserManaged.Replica"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Replication {
Automatic(std::boxed::Box<crate::model::replication::Automatic>),
UserManaged(std::boxed::Box<crate::model::replication::UserManaged>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomerManagedEncryption {
pub kms_key_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomerManagedEncryption {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_name = v.into();
self
}
}
impl wkt::message::Message for CustomerManagedEncryption {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.CustomerManagedEncryption"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReplicationStatus {
pub replication_status:
std::option::Option<crate::model::replication_status::ReplicationStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicationStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replication_status<
T: std::convert::Into<
std::option::Option<crate::model::replication_status::ReplicationStatus>,
>,
>(
mut self,
v: T,
) -> Self {
self.replication_status = v.into();
self
}
pub fn automatic(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::replication_status::AutomaticStatus>>
{
#[allow(unreachable_patterns)]
self.replication_status.as_ref().and_then(|v| match v {
crate::model::replication_status::ReplicationStatus::Automatic(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_automatic<
T: std::convert::Into<std::boxed::Box<crate::model::replication_status::AutomaticStatus>>,
>(
mut self,
v: T,
) -> Self {
self.replication_status = std::option::Option::Some(
crate::model::replication_status::ReplicationStatus::Automatic(v.into()),
);
self
}
pub fn user_managed(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::replication_status::UserManagedStatus>>
{
#[allow(unreachable_patterns)]
self.replication_status.as_ref().and_then(|v| match v {
crate::model::replication_status::ReplicationStatus::UserManaged(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_user_managed<
T: std::convert::Into<std::boxed::Box<crate::model::replication_status::UserManagedStatus>>,
>(
mut self,
v: T,
) -> Self {
self.replication_status = std::option::Option::Some(
crate::model::replication_status::ReplicationStatus::UserManaged(v.into()),
);
self
}
}
impl wkt::message::Message for ReplicationStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ReplicationStatus"
}
}
pub mod replication_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomaticStatus {
pub customer_managed_encryption:
std::option::Option<crate::model::CustomerManagedEncryptionStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomaticStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_customer_managed_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryptionStatus>,
{
self.customer_managed_encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer_managed_encryption<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryptionStatus>,
{
self.customer_managed_encryption = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AutomaticStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserManagedStatus {
pub replicas:
std::vec::Vec<crate::model::replication_status::user_managed_status::ReplicaStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserManagedStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replicas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<
crate::model::replication_status::user_managed_status::ReplicaStatus,
>,
{
use std::iter::Iterator;
self.replicas = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UserManagedStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus"
}
}
pub mod user_managed_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReplicaStatus {
pub location: std::string::String,
pub customer_managed_encryption:
std::option::Option<crate::model::CustomerManagedEncryptionStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicaStatus {
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_customer_managed_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryptionStatus>,
{
self.customer_managed_encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer_managed_encryption<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::CustomerManagedEncryptionStatus>,
{
self.customer_managed_encryption = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReplicaStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReplicationStatus {
Automatic(std::boxed::Box<crate::model::replication_status::AutomaticStatus>),
UserManaged(std::boxed::Box<crate::model::replication_status::UserManagedStatus>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomerManagedEncryptionStatus {
pub kms_key_version_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomerManagedEncryptionStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.kms_key_version_name = v.into();
self
}
}
impl wkt::message::Message for CustomerManagedEncryptionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Topic {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Topic {
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 Topic {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Topic"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Rotation {
pub next_rotation_time: std::option::Option<wkt::Timestamp>,
pub rotation_period: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Rotation {
pub fn new() -> Self {
std::default::Default::default()
}
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_rotation_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.rotation_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rotation_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.rotation_period = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Rotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.Rotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecretPayload {
pub data: ::bytes::Bytes,
pub data_crc32c: std::option::Option<i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecretPayload {
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<i64>,
{
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<i64>,
{
self.data_crc32c = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SecretPayload {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.SecretPayload"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecretsRequest {
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 ListSecretsRequest {
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 ListSecretsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ListSecretsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecretsResponse {
pub secrets: std::vec::Vec<crate::model::Secret>,
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 ListSecretsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secrets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Secret>,
{
use std::iter::Iterator;
self.secrets = 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 ListSecretsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ListSecretsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSecretsResponse {
type PageItem = crate::model::Secret;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.secrets
}
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 CreateSecretRequest {
pub parent: std::string::String,
pub secret_id: std::string::String,
pub secret: std::option::Option<crate::model::Secret>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSecretRequest {
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_secret_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.secret_id = v.into();
self
}
pub fn set_secret<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.secret = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_secret<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.secret = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSecretRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.CreateSecretRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AddSecretVersionRequest {
pub parent: std::string::String,
pub payload: std::option::Option<crate::model::SecretPayload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AddSecretVersionRequest {
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_payload<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecretPayload>,
{
self.payload = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_payload<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecretPayload>,
{
self.payload = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AddSecretVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.AddSecretVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSecretRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSecretRequest {
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 GetSecretRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.GetSecretRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecretVersionsRequest {
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 ListSecretVersionsRequest {
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 ListSecretVersionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ListSecretVersionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecretVersionsResponse {
pub versions: std::vec::Vec<crate::model::SecretVersion>,
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 ListSecretVersionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SecretVersion>,
{
use std::iter::Iterator;
self.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 ListSecretVersionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.ListSecretVersionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSecretVersionsResponse {
type PageItem = crate::model::SecretVersion;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.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 GetSecretVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSecretVersionRequest {
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 GetSecretVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.GetSecretVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSecretRequest {
pub secret: std::option::Option<crate::model::Secret>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSecretRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secret<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.secret = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_secret<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.secret = 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 UpdateSecretRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.UpdateSecretRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessSecretVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessSecretVersionRequest {
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 AccessSecretVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.AccessSecretVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessSecretVersionResponse {
pub name: std::string::String,
pub payload: std::option::Option<crate::model::SecretPayload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessSecretVersionResponse {
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_payload<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecretPayload>,
{
self.payload = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_payload<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecretPayload>,
{
self.payload = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AccessSecretVersionResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.AccessSecretVersionResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSecretRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSecretRequest {
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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteSecretRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.DeleteSecretRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableSecretVersionRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisableSecretVersionRequest {
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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DisableSecretVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.DisableSecretVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnableSecretVersionRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnableSecretVersionRequest {
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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for EnableSecretVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.EnableSecretVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestroySecretVersionRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestroySecretVersionRequest {
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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DestroySecretVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.secretmanager.v1.DestroySecretVersionRequest"
}
}