#[non_exhaustive]pub struct Key {
pub name: String,
pub uid: String,
pub display_name: String,
pub key_string: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub delete_time: Option<Timestamp>,
pub annotations: HashMap<String, String>,
pub restrictions: Option<Restrictions>,
pub etag: String,
/* private fields */
}Expand description
The representation of a key managed by the API Keys API.
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 key.
The name has the form:
projects/<PROJECT_NUMBER>/locations/global/keys/<KEY_ID>.
For example:
projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2
NOTE: Key is a global resource; hence the only supported value for
location is global.
uid: StringOutput only. Unique id in UUID4 format.
display_name: StringHuman-readable display name of this key that you can modify. The maximum length is 63 characters.
key_string: StringOutput only. An encrypted and signed value held by this key.
This field can be accessed only through the GetKeyString method.
create_time: Option<Timestamp>Output only. A timestamp identifying the time this key was originally created.
update_time: Option<Timestamp>Output only. A timestamp identifying the time this key was last updated.
delete_time: Option<Timestamp>Output only. A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
annotations: HashMap<String, String>Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
restrictions: Option<Restrictions>Key restrictions.
etag: StringOutput only. A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
Implementations§
Source§impl Key
impl Key
pub fn new() -> Self
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_key_string<T: Into<String>>(self, v: T) -> Self
pub fn set_key_string<T: Into<String>>(self, v: T) -> Self
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 = Key::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 = Key::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Key::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = Key::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = Key::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Key::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_delete_time<T>(self, v: T) -> Self
pub fn set_delete_time<T>(self, v: T) -> Self
Sets the value of delete_time.
§Example
use wkt::Timestamp;
let x = Key::new().set_delete_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_delete_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_delete_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of delete_time.
§Example
use wkt::Timestamp;
let x = Key::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
let x = Key::new().set_or_clear_delete_time(None::<Timestamp>);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.
§Example
let x = Key::new().set_annotations([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_restrictions<T>(self, v: T) -> Selfwhere
T: Into<Restrictions>,
pub fn set_restrictions<T>(self, v: T) -> Selfwhere
T: Into<Restrictions>,
Sets the value of restrictions.
§Example
use google_cloud_apikeys_v2::model::Restrictions;
let x = Key::new().set_restrictions(Restrictions::default()/* use setters */);Sourcepub fn set_or_clear_restrictions<T>(self, v: Option<T>) -> Selfwhere
T: Into<Restrictions>,
pub fn set_or_clear_restrictions<T>(self, v: Option<T>) -> Selfwhere
T: Into<Restrictions>,
Sets or clears the value of restrictions.
§Example
use google_cloud_apikeys_v2::model::Restrictions;
let x = Key::new().set_or_clear_restrictions(Some(Restrictions::default()/* use setters */));
let x = Key::new().set_or_clear_restrictions(None::<Restrictions>);