Skip to main content

nominal_api/conjure/objects/attachments/api/
update_attachment_request.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 UpdateAttachmentRequest {
16    #[builder(default, into)]
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
18    title: Option<String>,
19    #[builder(default, into)]
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
21    description: Option<String>,
22    #[builder(default, into)]
23    #[serde(rename = "properties", skip_serializing_if = "Option::is_none", default)]
24    properties: Option<
25        std::collections::BTreeMap<
26            super::super::super::api::PropertyName,
27            super::super::super::api::PropertyValue,
28        >,
29    >,
30    #[builder(default, into)]
31    #[serde(rename = "labels", skip_serializing_if = "Option::is_none", default)]
32    labels: Option<std::collections::BTreeSet<super::super::super::api::Label>>,
33}
34impl UpdateAttachmentRequest {
35    /// Constructs a new instance of the type.
36    #[inline]
37    pub fn new() -> Self {
38        Self::builder().build()
39    }
40    #[inline]
41    pub fn title(&self) -> Option<&str> {
42        self.title.as_ref().map(|o| &**o)
43    }
44    #[inline]
45    pub fn description(&self) -> Option<&str> {
46        self.description.as_ref().map(|o| &**o)
47    }
48    #[inline]
49    pub fn properties(
50        &self,
51    ) -> Option<
52        &std::collections::BTreeMap<
53            super::super::super::api::PropertyName,
54            super::super::super::api::PropertyValue,
55        >,
56    > {
57        self.properties.as_ref().map(|o| &*o)
58    }
59    #[inline]
60    pub fn labels(
61        &self,
62    ) -> Option<&std::collections::BTreeSet<super::super::super::api::Label>> {
63        self.labels.as_ref().map(|o| &*o)
64    }
65}