Skip to main content

nominal_api/conjure/objects/comments/api/
edit_comment_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 EditCommentRequest {
16    #[builder(into)]
17    #[serde(rename = "content")]
18    content: String,
19    #[builder(default, set(item(type = super::super::super::api::rids::AttachmentRid)))]
20    #[serde(
21        rename = "attachments",
22        skip_serializing_if = "std::collections::BTreeSet::is_empty",
23        default
24    )]
25    attachments: std::collections::BTreeSet<
26        super::super::super::api::rids::AttachmentRid,
27    >,
28}
29impl EditCommentRequest {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(content: impl Into<String>) -> Self {
33        Self::builder().content(content).build()
34    }
35    /// The content of the comment. Markdown supported.
36    #[inline]
37    pub fn content(&self) -> &str {
38        &*self.content
39    }
40    /// Attachments to the comment.
41    #[inline]
42    pub fn attachments(
43        &self,
44    ) -> &std::collections::BTreeSet<super::super::super::api::rids::AttachmentRid> {
45        &self.attachments
46    }
47}