nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct Comment {
    #[serde(rename = "rid")]
    rid: super::CommentRid,
    #[builder(custom(type = super::CommentParent, convert = Box::new))]
    #[serde(rename = "parent")]
    parent: Box<super::CommentParent>,
    #[serde(rename = "authorRid")]
    author_rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(default, into)]
    #[serde(rename = "editedAt", skip_serializing_if = "Option::is_none", default)]
    edited_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(default, into)]
    #[serde(rename = "deletedAt", skip_serializing_if = "Option::is_none", default)]
    deleted_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(into)]
    #[serde(rename = "content")]
    content: String,
    #[builder(default, into)]
    #[serde(rename = "pinnedBy", skip_serializing_if = "Option::is_none", default)]
    pinned_by: Option<conjure_object::ResourceIdentifier>,
    #[builder(default, into)]
    #[serde(rename = "pinnedAt", skip_serializing_if = "Option::is_none", default)]
    pinned_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(default, list(item(type = super::Reaction)))]
    #[serde(rename = "reactions", skip_serializing_if = "Vec::is_empty", default)]
    reactions: Vec<super::Reaction>,
    #[builder(default, set(item(type = super::super::super::api::rids::AttachmentRid)))]
    #[serde(
        rename = "attachments",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    attachments: std::collections::BTreeSet<
        super::super::super::api::rids::AttachmentRid,
    >,
}
impl Comment {
    /// Unique resource identifier for the comment
    #[inline]
    pub fn rid(&self) -> &super::CommentRid {
        &self.rid
    }
    /// The parent of the comment. It can be a resource or another comment.
    #[inline]
    pub fn parent(&self) -> &super::CommentParent {
        &*self.parent
    }
    /// The user who authored the comment
    #[inline]
    pub fn author_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.author_rid
    }
    /// The time the comment was created
    #[inline]
    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.created_at
    }
    /// The time the comment was edited. Empty if the comment has not been edited.
    #[inline]
    pub fn edited_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.edited_at.as_ref().map(|o| *o)
    }
    /// The time the comment was deleted. Empty if the comment has not been deleted.
    #[inline]
    pub fn deleted_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.deleted_at.as_ref().map(|o| *o)
    }
    /// The markdown content of the comment.
    #[inline]
    pub fn content(&self) -> &str {
        &*self.content
    }
    /// The user who pinned the comment. Empty if the comment is not pinned.
    #[inline]
    pub fn pinned_by(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.pinned_by.as_ref().map(|o| &*o)
    }
    /// The time the comment was pinned. Empty if the comment is not pinned.
    #[inline]
    pub fn pinned_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.pinned_at.as_ref().map(|o| *o)
    }
    /// The reactions on the comment
    #[inline]
    pub fn reactions(&self) -> &[super::Reaction] {
        &*self.reactions
    }
    /// The comment's attachments
    #[inline]
    pub fn attachments(
        &self,
    ) -> &std::collections::BTreeSet<super::super::super::api::rids::AttachmentRid> {
        &self.attachments
    }
}