Skip to main content

nominal_api/conjure/objects/module/
module_metadata.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct ModuleMetadata {
16    #[serde(rename = "rid")]
17    rid: super::super::modules::api::ModuleRid,
18    #[builder(into)]
19    #[serde(rename = "apiName")]
20    api_name: String,
21    #[builder(into)]
22    #[serde(rename = "title")]
23    title: String,
24    #[builder(into)]
25    #[serde(rename = "description")]
26    description: String,
27    #[serde(rename = "createdBy")]
28    created_by: super::super::scout::rids::api::UserRid,
29    #[serde(rename = "createdAt")]
30    created_at: conjure_object::DateTime<conjure_object::Utc>,
31    #[builder(default, into)]
32    #[serde(rename = "archivedAt", skip_serializing_if = "Option::is_none", default)]
33    archived_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
34}
35impl ModuleMetadata {
36    #[inline]
37    pub fn rid(&self) -> &super::super::modules::api::ModuleRid {
38        &self.rid
39    }
40    /// This uniquely identifies the module within the org.
41    /// Note that this cannot be changed after creation.
42    #[inline]
43    pub fn api_name(&self) -> &str {
44        &*self.api_name
45    }
46    #[inline]
47    pub fn title(&self) -> &str {
48        &*self.title
49    }
50    #[inline]
51    pub fn description(&self) -> &str {
52        &*self.description
53    }
54    #[inline]
55    pub fn created_by(&self) -> &super::super::scout::rids::api::UserRid {
56        &self.created_by
57    }
58    #[inline]
59    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
60        self.created_at
61    }
62    /// The time at which the module was archived. Unset if the module is not archived.
63    #[inline]
64    pub fn archived_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
65        self.archived_at.as_ref().map(|o| *o)
66    }
67}