Struct Secret

Source
#[non_exhaustive]
pub struct Secret { pub name: String, pub replication: Option<Replication>, pub create_time: Option<Timestamp>, pub labels: HashMap<String, String>, pub topics: Vec<Topic>, pub etag: String, pub rotation: Option<Rotation>, pub version_aliases: HashMap<String, i64>, pub annotations: HashMap<String, String>, pub version_destroy_ttl: Option<Duration>, pub customer_managed_encryption: Option<CustomerManagedEncryption>, pub expiration: Option<Expiration>, }
Expand description

A Secret is a logical secret whose value and versions can be accessed.

A Secret is made up of zero or more SecretVersions that represent the secret data.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Output only. The resource name of the Secret in the format projects/*/secrets/*.

§replication: Option<Replication>

Optional. Immutable. The replication policy of the secret data attached to the Secret.

The replication policy cannot be changed after the Secret has been created.

§create_time: Option<Timestamp>

Output only. The time at which the Secret was created.

§labels: HashMap<String, String>

The labels assigned to this Secret.

Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}

Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}

No more than 64 labels can be assigned to a given resource.

§topics: Vec<Topic>

Optional. A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions.

§etag: String

Optional. Etag of the currently stored Secret.

§rotation: Option<Rotation>

Optional. Rotation policy attached to the Secret. May be excluded if there is no rotation policy.

§version_aliases: HashMap<String, i64>

Optional. Mapping from version alias to version name.

A version alias is a string with a maximum length of 63 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (‘_’) characters. An alias string must start with a letter and cannot be the string ‘latest’ or ‘NEW’. No more than 50 aliases can be assigned to a given secret.

Version-Alias pairs will be viewable via GetSecret and modifiable via UpdateSecret. Access by alias is only be supported on GetSecretVersion and AccessSecretVersion.

§annotations: HashMap<String, String>

Optional. Custom metadata about the secret.

Annotations are distinct from various forms of labels. Annotations exist to allow client tools to store their own state information without requiring a database.

Annotation keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols.

The total size of annotation keys and values must be less than 16KiB.

§version_destroy_ttl: Option<Duration>

Optional. Secret Version TTL after destruction request

This is a part of the Delayed secret version destroy feature. For secret with TTL>0, version destruction doesn’t happen immediately on calling destroy instead the version goes to a disabled state and destruction happens after the TTL expires.

§customer_managed_encryption: Option<CustomerManagedEncryption>

Optional. The customer-managed encryption configuration of the regionalized secrets. If no configuration is provided, Google-managed default encryption is used.

Updates to the Secret encryption configuration only apply to SecretVersions added afterwards. They do not apply retroactively to existing SecretVersions.

§expiration: Option<Expiration>

Expiration policy attached to the Secret. If specified the Secret and all SecretVersions will be automatically deleted at expiration. Expired secrets are irreversibly deleted.

Expiration is not the recommended way to set time-based permissions. IAM Conditions is recommended for granting time-based permissions because the operation can be reversed.

Implementations§

Source§

impl Secret

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

Source

pub fn set_replication<T: Into<Option<Replication>>>(self, v: T) -> Self

Sets the value of replication.

Source

pub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self

Sets the value of create_time.

Source

pub fn set_etag<T: Into<String>>(self, v: T) -> Self

Sets the value of etag.

Source

pub fn set_rotation<T: Into<Option<Rotation>>>(self, v: T) -> Self

Sets the value of rotation.

Source

pub fn set_version_destroy_ttl<T: Into<Option<Duration>>>(self, v: T) -> Self

Sets the value of version_destroy_ttl.

Source

pub fn set_customer_managed_encryption<T: Into<Option<CustomerManagedEncryption>>>( self, v: T, ) -> Self

Sets the value of customer_managed_encryption.

Source

pub fn set_topics<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Topic>,

Sets the value of topics.

Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

Source

pub fn set_version_aliases<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<i64>,

Sets the value of version_aliases.

Source

pub fn set_annotations<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of annotations.

Source

pub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self

Sets the value of expiration.

Source

pub fn get_expire_time(&self) -> Option<&Box<Timestamp>>

The value of expiration if it holds a ExpireTime, None if the field is not set or holds a different branch.

Source

pub fn get_ttl(&self) -> Option<&Box<Duration>>

The value of expiration if it holds a Ttl, None if the field is not set or holds a different branch.

Source

pub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self

Sets the value of expiration to hold a ExpireTime.

Note that all the setters affecting expiration are mutually exclusive.

Source

pub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self

Sets the value of expiration to hold a Ttl.

Note that all the setters affecting expiration are mutually exclusive.

Trait Implementations§

Source§

impl Clone for Secret

Source§

fn clone(&self) -> Secret

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Secret

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Secret

Source§

fn default() -> Secret

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Secret
where Secret: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Message for Secret

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Secret

Source§

fn eq(&self, other: &Secret) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Secret

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Secret

Auto Trait Implementations§

§

impl Freeze for Secret

§

impl RefUnwindSafe for Secret

§

impl Send for Secret

§

impl Sync for Secret

§

impl Unpin for Secret

§

impl UnwindSafe for Secret

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T