def _get_all_issue_comments(self, issue_id) -> List["IssueComment"]: issue = self.gitlab_repo.issues.get(issue_id) return [ GitlabIssueComment(raw_comment) for raw_comment in issue.notes.list(sort="asc") ]
def issue_comment(self, issue_id: int, body: str) -> IssueComment: """ Create comment on an issue. """ issue = self.gitlab_repo.issues.get(issue_id) comment = issue.notes.create({"body": body}) return GitlabIssueComment(comment)
def comment(self, body: str) -> IssueComment: comment = self._raw_issue.notes.create({"body": body}) return GitlabIssueComment(parent=self, raw_comment=comment)
def _get_all_comments(self) -> List[IssueComment]: return [ GitlabIssueComment(parent=self, raw_comment=raw_comment) for raw_comment in self._raw_issue.notes.list(sort="asc", all=True) ]
def get_comment(self, comment_id: int) -> IssueComment: return GitlabIssueComment(self._raw_issue.notes.get(comment_id))