#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOutput 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: StringOptional. 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
impl Secret
Sourcepub fn set_replication<T: Into<Option<Replication>>>(self, v: T) -> Self
pub fn set_replication<T: Into<Option<Replication>>>(self, v: T) -> Self
Sets the value of replication.
Sourcepub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
pub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_version_destroy_ttl<T: Into<Option<Duration>>>(self, v: T) -> Self
pub fn set_version_destroy_ttl<T: Into<Option<Duration>>>(self, v: T) -> Self
Sets the value of version_destroy_ttl.
Sourcepub fn set_customer_managed_encryption<T: Into<Option<CustomerManagedEncryption>>>(
self,
v: T,
) -> Self
pub fn set_customer_managed_encryption<T: Into<Option<CustomerManagedEncryption>>>( self, v: T, ) -> Self
Sets the value of customer_managed_encryption.
Sourcepub fn set_topics<T, V>(self, v: T) -> Self
pub fn set_topics<T, V>(self, v: T) -> Self
Sets the value of topics.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_version_aliases<T, K, V>(self, v: T) -> Self
pub fn set_version_aliases<T, K, V>(self, v: T) -> Self
Sets the value of version_aliases.
Sourcepub fn set_annotations<T, K, V>(self, v: T) -> Self
pub fn set_annotations<T, K, V>(self, v: T) -> Self
Sets the value of annotations.
Sourcepub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
pub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
Sets the value of expiration.
Sourcepub fn get_expire_time(&self) -> Option<&Box<Timestamp>>
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.
Sourcepub fn get_ttl(&self) -> Option<&Box<Duration>>
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.
Sourcepub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
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.