nominal_api/conjure/objects/attachments/api/
attachment.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 Attachment {
16 #[serde(rename = "rid")]
17 rid: super::super::super::api::rids::AttachmentRid,
18 #[builder(into)]
19 #[serde(rename = "title")]
20 title: String,
21 #[serde(rename = "s3Path")]
22 s3_path: super::super::super::api::S3Path,
23 #[builder(into)]
24 #[serde(rename = "fileType")]
25 file_type: String,
26 #[builder(into)]
27 #[serde(rename = "description")]
28 description: String,
29 #[serde(rename = "createdBy")]
30 created_by: conjure_object::ResourceIdentifier,
31 #[builder(
32 default,
33 map(
34 key(type = super::super::super::api::PropertyName),
35 value(type = super::super::super::api::PropertyValue)
36 )
37 )]
38 #[serde(
39 rename = "properties",
40 skip_serializing_if = "std::collections::BTreeMap::is_empty",
41 default
42 )]
43 properties: std::collections::BTreeMap<
44 super::super::super::api::PropertyName,
45 super::super::super::api::PropertyValue,
46 >,
47 #[builder(default, set(item(type = super::super::super::api::Label)))]
48 #[serde(
49 rename = "labels",
50 skip_serializing_if = "std::collections::BTreeSet::is_empty",
51 default
52 )]
53 labels: std::collections::BTreeSet<super::super::super::api::Label>,
54 #[serde(rename = "createdAt")]
55 created_at: conjure_object::DateTime<conjure_object::Utc>,
56 #[serde(rename = "isArchived")]
57 is_archived: bool,
58}
59impl Attachment {
60 #[inline]
61 pub fn rid(&self) -> &super::super::super::api::rids::AttachmentRid {
62 &self.rid
63 }
64 #[inline]
65 pub fn title(&self) -> &str {
66 &*self.title
67 }
68 #[inline]
69 pub fn s3_path(&self) -> &super::super::super::api::S3Path {
70 &self.s3_path
71 }
72 #[inline]
73 pub fn file_type(&self) -> &str {
74 &*self.file_type
75 }
76 #[inline]
77 pub fn description(&self) -> &str {
78 &*self.description
79 }
80 #[inline]
81 pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
82 &self.created_by
83 }
84 #[inline]
85 pub fn properties(
86 &self,
87 ) -> &std::collections::BTreeMap<
88 super::super::super::api::PropertyName,
89 super::super::super::api::PropertyValue,
90 > {
91 &self.properties
92 }
93 #[inline]
94 pub fn labels(
95 &self,
96 ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
97 &self.labels
98 }
99 #[inline]
100 pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
101 self.created_at
102 }
103 #[inline]
104 pub fn is_archived(&self) -> bool {
105 self.is_archived
106 }
107}