#[non_exhaustive]pub struct Metadata {
pub fingerprint: Option<Bytes>,
pub items: Vec<Items>,
pub kind: Option<String>,
/* private fields */
}instance-templates or instances or machine-images or projects or region-instance-templates or region-instances only.Expand description
A metadata key/value entry.
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.fingerprint: Option<Bytes>Specifies a fingerprint for this request, which is essentially a hash of the metadata’s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error412 conditionNotMet.
To see the latest fingerprint, make a get() request to retrieve the resource.
items: Vec<Items>Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
kind: Option<String>Output only. [Output Only] Type of the resource. Always compute#metadata for metadata.
Implementations§
Source§impl Metadata
impl Metadata
pub fn new() -> Self
Sourcepub fn set_fingerprint<T>(self, v: T) -> Self
pub fn set_fingerprint<T>(self, v: T) -> Self
Sets the value of fingerprint.
§Example
let x = Metadata::new().set_fingerprint(bytes::Bytes::from_static(b"example"));Sourcepub fn set_or_clear_fingerprint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_fingerprint<T>(self, v: Option<T>) -> Self
Sets or clears the value of fingerprint.
§Example
let x = Metadata::new().set_or_clear_fingerprint(Some(bytes::Bytes::from_static(b"example")));
let x = Metadata::new().set_or_clear_fingerprint(None::<bytes::Bytes>);