pub trait CommentsService {
// 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§
Sourcefn get_conversation(
&self,
auth_: BearerToken,
resource_type: ResourceType,
resource_rid: ResourceIdentifier,
) -> Result<Conversation, Error>
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.
Sourcefn get_conversation_count(
&self,
auth_: BearerToken,
resource_type: ResourceType,
resource_rid: ResourceIdentifier,
include_deleted: Option<bool>,
) -> Result<i32, Error>
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.
Sourcefn get_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
) -> Result<Comment, Error>
fn get_comment( &self, auth_: BearerToken, comment_rid: CommentRid, ) -> Result<Comment, Error>
Get a comment identified by its RID
Sourcefn create_comment(
&self,
auth_: BearerToken,
request: CreateCommentRequest,
) -> Result<Comment, Error>
fn create_comment( &self, auth_: BearerToken, request: CreateCommentRequest, ) -> Result<Comment, Error>
Create a comment on a resource
Sourcefn edit_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
request: EditCommentRequest,
) -> Result<Comment, Error>
fn edit_comment( &self, auth_: BearerToken, comment_rid: CommentRid, request: EditCommentRequest, ) -> Result<Comment, Error>
Edit an existing comment
Sourcefn delete_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
) -> Result<Comment, Error>
fn delete_comment( &self, auth_: BearerToken, comment_rid: CommentRid, ) -> Result<Comment, Error>
Delete an existing comment
Sourcefn pin_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
) -> Result<Comment, Error>
fn pin_comment( &self, auth_: BearerToken, comment_rid: CommentRid, ) -> Result<Comment, Error>
Pin a comment to the top of the conversation
Sourcefn unpin_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
) -> Result<Comment, Error>
fn unpin_comment( &self, auth_: BearerToken, comment_rid: CommentRid, ) -> Result<Comment, Error>
Unpin a comment from the top of the conversation
Sourcefn add_reaction(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
type_: ReactionType,
) -> Result<Comment, Error>
fn add_reaction( &self, auth_: BearerToken, comment_rid: CommentRid, type_: ReactionType, ) -> Result<Comment, Error>
Create a reaction on a comment
Sourcefn remove_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>
Create a reaction on a comment