def _issuecomment_from_gitlab_object(raw_comment) -> IssueComment: return IssueComment( comment=raw_comment.body, author=raw_comment.author["username"], created=raw_comment.created_at, edited=raw_comment.updated_at, )
def _issuecomment_from_pagure_dict(self, comment_dict: dict) -> IssueComment: return IssueComment( comment=comment_dict["comment"], author=comment_dict["user"]["name"], created=datetime.datetime.fromtimestamp(int(comment_dict["date_created"])), edited=None, )
def _issuecomment_from_github_object( raw_comment: GithubIssueComment) -> IssueComment: return IssueComment( comment=raw_comment.body, author=raw_comment.user.login, created=raw_comment.created_at, edited=raw_comment.updated_at, )
def issue_comment(self, issue_id: int, body: str) -> IssueComment: payload = {"comment": body} self._call_project_api("issue", str(issue_id), "comment", data=payload, method="POST") return IssueComment(comment=body, author=self._username)
def issue_comment(cls, original_object: Any, issue_id: int, body: str) -> "IssueComment": issue = original_object.get_issue(issue_id) log_output(issue) return IssueComment( parent=issue, body=body, author=cls.author, created=datetime.datetime.now(), edited=datetime.datetime.now(), )