#[non_exhaustive]
pub struct Resource { pub service: String, pub name: String, pub type: String, pub labels: HashMap<String, String>, pub uid: String, pub annotations: HashMap<String, String>, pub display_name: String, pub create_time: Option<Timestamp>, pub update_time: Option<Timestamp>, pub delete_time: Option<Timestamp>, pub etag: String, pub location: String, /* private fields */ }
Expand description

This message defines core attributes for a resource. A resource is an addressable (named) entity provided by the destination service. For example, a file stored on a network storage service.

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.
§service: String

The name of the service that this resource belongs to, such as pubsub.googleapis.com. The service may be different from the DNS hostname that actually serves the request.

§name: String

The stable identifier (name) of a resource on the service. A resource can be logically identified as “//{resource.service}/{resource.name}”. The differences between a resource name and a URI are:

  • Resource name is a logical identifier, independent of network protocol and API version. For example, //pubsub.googleapis.com/projects/123/topics/news-feed.
  • URI often includes protocol and version information, so it can be used directly by applications. For example, <https://pubsub.googleapis.com/v1/projects/123/topics/news-feed>.

See https://cloud.google.com/apis/design/resource_names for details.

§type: String

The type of the resource. The syntax is platform-specific because different platforms define their resources differently.

For Google APIs, the type format must be “{service}/{kind}”, such as “pubsub.googleapis.com/Topic”.

§labels: HashMap<String, String>

The labels or tags on the resource, such as AWS resource tags and Kubernetes resource labels.

§uid: String

The unique identifier of the resource. UID is unique in the time and space for this resource within the scope of the service. It is typically generated by the server on successful creation of a resource and must not be changed. UID is used to uniquely identify resources with resource name reuses. This should be a UUID4.

§annotations: HashMap<String, String>

Annotations is an unstructured key-value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.

More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/

§display_name: String

Mutable. The display name set by clients. Must be <= 63 characters.

§create_time: Option<Timestamp>

Output only. The timestamp when the resource was created. This may be either the time creation was initiated or when it was completed.

§update_time: Option<Timestamp>

Output only. The timestamp when the resource was last updated. Any change to the resource made by users must refresh this value. Changes to a resource made by the service should refresh this value.

§delete_time: Option<Timestamp>

Output only. The timestamp when the resource was deleted. If the resource is not deleted, this must be empty.

§etag: String

Output only. An opaque value that uniquely identifies a version or generation of a resource. It can be used to confirm that the client and server agree on the ordering of a resource being written.

§location: String

Immutable. The location of the resource. The location encoding is specific to the service provider, and new encoding may be introduced as the service evolves.

For Google Cloud products, the encoding is what is used by Google Cloud APIs, such as us-east1, aws-us-east-1, and azure-eastus2. The semantics of location is identical to the cloud.googleapis.com/location label used by some Google Cloud APIs.

Implementations§

Source§

impl Resource

Source

pub fn new() -> Self

Source

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

Sets the value of service.

Source

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

Sets the value of name.

Source

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

Sets the value of r#type.

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_uid<T: Into<String>>(self, v: T) -> Self

Sets the value of uid.

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_display_name<T: Into<String>>(self, v: T) -> Self

Sets the value of display_name.

Source

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

Sets the value of create_time.

Source

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

Sets or clears the value of create_time.

Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

Source

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

Sets or clears the value of update_time.

Source

pub fn set_delete_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of delete_time.

Source

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

Sets or clears the value of delete_time.

Source

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

Sets the value of etag.

Source

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

Sets the value of location.

Trait Implementations§

Source§

impl Clone for Resource

Source§

fn clone(&self) -> Resource

Returns a duplicate 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 Resource

Source§

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

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

impl Default for Resource

Source§

fn default() -> Resource

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

impl Message for Resource

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Resource

Source§

fn eq(&self, other: &Resource) -> 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 StructuralPartialEq for Resource

Auto Trait Implementations§

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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