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