Skip to main content

nominal_api/conjure/objects/scout/checks/api/
checklist_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 ChecklistMetadata {
16    #[serde(rename = "authorRid")]
17    author_rid: super::super::super::rids::api::UserRid,
18    #[serde(rename = "assigneeRid")]
19    assignee_rid: super::super::super::rids::api::UserRid,
20    #[builder(into)]
21    #[serde(rename = "title")]
22    title: String,
23    #[builder(into)]
24    #[serde(rename = "description")]
25    description: String,
26    #[serde(rename = "createdAt")]
27    created_at: conjure_object::DateTime<conjure_object::Utc>,
28    #[builder(default, map(key(type = String, into), value(type = String, into)))]
29    #[serde(
30        rename = "properties",
31        skip_serializing_if = "std::collections::BTreeMap::is_empty",
32        default
33    )]
34    properties: std::collections::BTreeMap<String, String>,
35    #[builder(default, set(item(type = String, into)))]
36    #[serde(
37        rename = "labels",
38        skip_serializing_if = "std::collections::BTreeSet::is_empty",
39        default
40    )]
41    labels: std::collections::BTreeSet<String>,
42    #[builder(default, into)]
43    #[serde(rename = "lastUsed", skip_serializing_if = "Option::is_none", default)]
44    last_used: Option<conjure_object::DateTime<conjure_object::Utc>>,
45    #[serde(rename = "isArchived")]
46    is_archived: bool,
47    #[serde(rename = "isPublished")]
48    is_published: bool,
49}
50impl ChecklistMetadata {
51    #[inline]
52    pub fn author_rid(&self) -> &super::super::super::rids::api::UserRid {
53        &self.author_rid
54    }
55    #[inline]
56    pub fn assignee_rid(&self) -> &super::super::super::rids::api::UserRid {
57        &self.assignee_rid
58    }
59    #[inline]
60    pub fn title(&self) -> &str {
61        &*self.title
62    }
63    #[inline]
64    pub fn description(&self) -> &str {
65        &*self.description
66    }
67    #[inline]
68    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
69        self.created_at
70    }
71    #[inline]
72    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
73        &self.properties
74    }
75    #[inline]
76    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
77        &self.labels
78    }
79    #[inline]
80    pub fn last_used(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
81        self.last_used.as_ref().map(|o| *o)
82    }
83    #[inline]
84    pub fn is_archived(&self) -> bool {
85        self.is_archived
86    }
87    #[inline]
88    pub fn is_published(&self) -> bool {
89        self.is_published
90    }
91}