Package com.podio.comment
Class CommentAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.comment.CommentAPI
-
public class CommentAPI extends BaseAPI
Comments are made by users on different objects. Objects can f.ex. be items, status, etc. Comments is simply a text that can be any length. Comments are made from the API of the object, see f.ex. Items for more details. Comments are however updated and deleted from the comment API.
-
-
Constructor Summary
Constructors Constructor Description CommentAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddComment(Reference reference, CommentCreate comment, boolean silent, boolean hook)Adds a new comment to the object of the given type and id, f.ex. item 1.voiddeleteComment(int commentId)Deletes a comment made by a user.CommentgetComment(int commentId)Returns the contents of a comment.List<Comment>getComments(Reference reference)Used to retrieve all the comments that have been made on an object of the given type and with the given id.voidupdateComment(int commentId, CommentUpdate comment)Updates an already created comment.-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
CommentAPI
public CommentAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
getComments
public List<Comment> getComments(Reference reference)
Used to retrieve all the comments that have been made on an object of the given type and with the given id. It returns a list of all the comments sorted in ascending order by time created.- Parameters:
reference- The reference to the object from which the comments should be retrieved- Returns:
- The comments on the object
-
getComment
public Comment getComment(int commentId)
Returns the contents of a comment. It is not possible to see where the comment was made, only the comment itself.- Parameters:
commentId- The id of the comment- Returns:
- The comment
-
addComment
public int addComment(Reference reference, CommentCreate comment, boolean silent, boolean hook)
Adds a new comment to the object of the given type and id, f.ex. item 1.- Parameters:
reference- The reference to the object the comment should be added tocomment- The comment that should be addedsilent- True if the update should be silent, false otherwise
-
updateComment
public void updateComment(int commentId, CommentUpdate comment)Updates an already created comment. This should only be used to correct spelling and grammatical mistakes in the comment.- Parameters:
commentId- The id of the commentcomment- The updated comment definition
-
deleteComment
public void deleteComment(int commentId)
Deletes a comment made by a user. This can be used to retract a comment that was made and which the user regrets.- Parameters:
commentId- The id of the comment
-
-