#[non_exhaustive]pub struct ProtectedResource {
pub name: String,
pub project: String,
pub project_id: String,
pub cloud_product: String,
pub resource_type: String,
pub location: String,
pub labels: HashMap<String, String>,
pub crypto_key_version: String,
pub crypto_key_versions: Vec<String>,
pub create_time: Option<Timestamp>,
/* private fields */
}Expand description
Metadata about a resource protected by a Cloud KMS key.
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: StringThe full resource name of the resource.
Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1.
project: StringFormat: projects/{PROJECT_NUMBER}.
project_id: StringThe ID of the project that owns the resource.
cloud_product: StringThe Cloud product that owns the resource.
Example: compute
resource_type: StringExample: compute.googleapis.com/Disk
location: StringLocation can be global, regional like us-east1, or zonal like
us-west1-b.
labels: HashMap<String, String>A key-value pair of the resource’s labels (v1) to their values.
crypto_key_version: StringThe name of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key version data to Asset Inventory. If there are multiple key versions protecting the resource, then this is same value as the first element of crypto_key_versions.
crypto_key_versions: Vec<String>The names of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key versions data to Asset Inventory. The first element of this field is stored in crypto_key_version.
create_time: Option<Timestamp>Output only. The time at which this resource was created. The granularity is in seconds. Timestamp.nanos will always be 0.
Implementations§
Source§impl ProtectedResource
impl ProtectedResource
pub fn new() -> Self
Sourcepub fn set_project<T: Into<String>>(self, v: T) -> Self
pub fn set_project<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_project_id<T: Into<String>>(self, v: T) -> Self
pub fn set_project_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_cloud_product<T: Into<String>>(self, v: T) -> Self
pub fn set_cloud_product<T: Into<String>>(self, v: T) -> Self
Sets the value of cloud_product.
§Example
let x = ProtectedResource::new().set_cloud_product("example");Sourcepub fn set_resource_type<T: Into<String>>(self, v: T) -> Self
pub fn set_resource_type<T: Into<String>>(self, v: T) -> Self
Sets the value of resource_type.
§Example
let x = ProtectedResource::new().set_resource_type("example");Sourcepub fn set_location<T: Into<String>>(self, v: T) -> Self
pub fn set_location<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_crypto_key_version<T: Into<String>>(self, v: T) -> Self
pub fn set_crypto_key_version<T: Into<String>>(self, v: T) -> Self
Sets the value of crypto_key_version.
§Example
let x = ProtectedResource::new().set_crypto_key_version("example");Sourcepub fn set_crypto_key_versions<T, V>(self, v: T) -> Self
pub fn set_crypto_key_versions<T, V>(self, v: T) -> Self
Sets the value of crypto_key_versions.
§Example
let x = ProtectedResource::new().set_crypto_key_versions(["a", "b", "c"]);Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = ProtectedResource::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = ProtectedResource::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = ProtectedResource::new().set_or_clear_create_time(None::<Timestamp>);Trait Implementations§
Source§impl Clone for ProtectedResource
impl Clone for ProtectedResource
Source§fn clone(&self) -> ProtectedResource
fn clone(&self) -> ProtectedResource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more