diff --git a/src/models/metadata.rs b/src/models/metadata.rs index f31d9ec..75df7b3 100644 --- a/src/models/metadata.rs +++ b/src/models/metadata.rs @@ -1,25 +1,70 @@ use serde::{Deserialize, Serialize}; use crate::proto::gevulot::gevulot; +/// Metadata represents common metadata fields used across different resource types. +/// +/// # Examples +/// +/// ``` +/// use crate::models::Metadata; +/// use crate::models::Label; +/// +/// let metadata = Metadata { +/// id: Some("task-123".to_string()), +/// name: "my-task".to_string(), +/// creator: Some("alice".to_string()), +/// description: "An example task".to_string(), +/// tags: vec!["tag1".to_string(), "tag2".to_string()], +/// labels: vec![ +/// Label { +/// key: "env".to_string(), +/// value: "prod".to_string() +/// } +/// ], +/// workflow_ref: None +/// }; +/// ``` #[derive(Serialize, Deserialize, Debug, Default)] pub struct Metadata { + /// Unique identifier for the resource pub id: Option, + /// Name of the resource pub name: String, + /// Creator/owner of the resource pub creator: Option, + /// Detailed description of the resource pub description: String, + /// List of searchable tags pub tags: Vec, + /// List of key-value labels pub labels: Vec