nominal_api/conjure/objects/scout/checks/api/
checklist_metadata.rs1#[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(
29 default,
30 map(
31 key(type = super::super::super::super::api::PropertyName),
32 value(type = super::super::super::super::api::PropertyValue)
33 )
34 )]
35 #[serde(
36 rename = "properties",
37 skip_serializing_if = "std::collections::BTreeMap::is_empty",
38 default
39 )]
40 properties: std::collections::BTreeMap<
41 super::super::super::super::api::PropertyName,
42 super::super::super::super::api::PropertyValue,
43 >,
44 #[builder(default, set(item(type = super::super::super::super::api::Label)))]
45 #[serde(
46 rename = "labels",
47 skip_serializing_if = "std::collections::BTreeSet::is_empty",
48 default
49 )]
50 labels: std::collections::BTreeSet<super::super::super::super::api::Label>,
51 #[builder(default, into)]
52 #[serde(rename = "lastUsed", skip_serializing_if = "Option::is_none", default)]
53 last_used: Option<conjure_object::DateTime<conjure_object::Utc>>,
54 #[serde(rename = "isArchived")]
55 is_archived: bool,
56 #[serde(rename = "isPublished")]
57 is_published: bool,
58}
59impl ChecklistMetadata {
60 #[inline]
61 pub fn author_rid(&self) -> &super::super::super::rids::api::UserRid {
62 &self.author_rid
63 }
64 #[inline]
65 pub fn assignee_rid(&self) -> &super::super::super::rids::api::UserRid {
66 &self.assignee_rid
67 }
68 #[inline]
69 pub fn title(&self) -> &str {
70 &*self.title
71 }
72 #[inline]
73 pub fn description(&self) -> &str {
74 &*self.description
75 }
76 #[inline]
77 pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
78 self.created_at
79 }
80 #[inline]
81 pub fn properties(
82 &self,
83 ) -> &std::collections::BTreeMap<
84 super::super::super::super::api::PropertyName,
85 super::super::super::super::api::PropertyValue,
86 > {
87 &self.properties
88 }
89 #[inline]
90 pub fn labels(
91 &self,
92 ) -> &std::collections::BTreeSet<super::super::super::super::api::Label> {
93 &self.labels
94 }
95 #[inline]
96 pub fn last_used(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
97 self.last_used.as_ref().map(|o| *o)
98 }
99 #[inline]
100 pub fn is_archived(&self) -> bool {
101 self.is_archived
102 }
103 #[inline]
104 pub fn is_published(&self) -> bool {
105 self.is_published
106 }
107}