Skip to main content

CommentsService

Trait CommentsService 

Source
pub trait CommentsService<I: Iterator<Item = Result<Bytes, Error>>> {
    // Required methods
    fn get_conversation(
        &self,
        auth_: &BearerToken,
        resource_type: &ResourceType,
        resource_rid: &ResourceIdentifier,
    ) -> Result<Conversation, Error>;
    fn get_conversation_count(
        &self,
        auth_: &BearerToken,
        resource_type: &ResourceType,
        resource_rid: &ResourceIdentifier,
        include_deleted: Option<bool>,
    ) -> Result<i32, Error>;
    fn get_comment(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
    ) -> Result<Comment, Error>;
    fn create_comment(
        &self,
        auth_: &BearerToken,
        request: &CreateCommentRequest,
    ) -> Result<Comment, Error>;
    fn edit_comment(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
        request: &EditCommentRequest,
    ) -> Result<Comment, Error>;
    fn delete_comment(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
    ) -> Result<Comment, Error>;
    fn pin_comment(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
    ) -> Result<Comment, Error>;
    fn unpin_comment(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
    ) -> Result<Comment, Error>;
    fn add_reaction(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
        type_: &ReactionType,
    ) -> Result<Comment, Error>;
    fn remove_reaction(
        &self,
        auth_: &BearerToken,
        comment_rid: &CommentRid,
        type_: &ReactionType,
    ) -> Result<Comment, Error>;
}
Expand description

Comments service manages conversations about resources.

Required Methods§

Source

fn get_conversation( &self, auth_: &BearerToken, resource_type: &ResourceType, resource_rid: &ResourceIdentifier, ) -> Result<Conversation, Error>

A conversation is a fully resolved comment tree. It includes all comments for the given resource and all the nested comments/replies to those comments.

Source

fn get_conversation_count( &self, auth_: &BearerToken, resource_type: &ResourceType, resource_rid: &ResourceIdentifier, include_deleted: Option<bool>, ) -> Result<i32, Error>

Returns the number of comments in a conversation.

Source

fn get_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> Result<Comment, Error>

Get a comment identified by its RID

Source

fn create_comment( &self, auth_: &BearerToken, request: &CreateCommentRequest, ) -> Result<Comment, Error>

Create a comment on a resource

Source

fn edit_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, request: &EditCommentRequest, ) -> Result<Comment, Error>

Edit an existing comment

Source

fn delete_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> Result<Comment, Error>

Delete an existing comment

Source

fn pin_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> Result<Comment, Error>

Pin a comment to the top of the conversation

Source

fn unpin_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> Result<Comment, Error>

Unpin a comment from the top of the conversation

Source

fn add_reaction( &self, auth_: &BearerToken, comment_rid: &CommentRid, type_: &ReactionType, ) -> Result<Comment, Error>

Create a reaction on a comment

Source

fn remove_reaction( &self, auth_: &BearerToken, comment_rid: &CommentRid, type_: &ReactionType, ) -> Result<Comment, Error>

Create a reaction on a comment

Implementors§

Source§

impl<I: Iterator<Item = Result<Bytes, Error>>, __C> CommentsService<I> for CommentsServiceClient<__C>
where __C: Client<ResponseBody = I>,