Module ogr.services.github.comments

Classes

class GithubComment (raw_comment: Any | None = None,
parent: Any | None = None,
body: str | None = None,
id_: int | None = None,
author: str | None = None,
created: datetime.datetime | None = None,
edited: datetime.datetime | None = None)
Expand source code
class GithubComment(Comment):
    def _from_raw_comment(
        self,
        raw_comment: Union[
            _GithubIssueComment,
            _GithubPullRequestComment,
            _GithubCommitComment,
        ],
    ) -> None:
        self._raw_comment = raw_comment
        self._id = raw_comment.id
        self._author = raw_comment.user.login
        self._created = raw_comment.created_at

    @property
    def body(self) -> str:
        return self._raw_comment.body

    @body.setter
    def body(self, new_body: str) -> None:
        self._raw_comment.edit(new_body)

    @property
    def edited(self) -> datetime.datetime:
        return self._raw_comment.updated_at

    def get_reactions(self) -> list[Reaction]:
        return [
            GithubReaction(reaction) for reaction in self._raw_comment.get_reactions()
        ]

    def add_reaction(self, reaction: str) -> GithubReaction:
        return GithubReaction(self._raw_comment.create_reaction(reaction))

Ancestors

Subclasses

Inherited members

class GithubCommitComment (sha: str, raw_comment: Any)

Attributes

sha : str
Hash of the related commit.
body : str
Body of the comment.
author : str
Login of the author.
Expand source code
class GithubCommitComment(GithubComment, CommitComment):
    def __str__(self) -> str:
        return "Github" + super().__str__()

Ancestors

Inherited members

class GithubIssueComment (raw_comment: Any | None = None,
parent: Any | None = None,
body: str | None = None,
id_: int | None = None,
author: str | None = None,
created: datetime.datetime | None = None,
edited: datetime.datetime | None = None)
Expand source code
class GithubIssueComment(GithubComment, IssueComment):
    def __str__(self) -> str:
        return "Github" + super().__str__()

Ancestors

Inherited members

class GithubPRComment (raw_comment: Any | None = None,
parent: Any | None = None,
body: str | None = None,
id_: int | None = None,
author: str | None = None,
created: datetime.datetime | None = None,
edited: datetime.datetime | None = None)
Expand source code
class GithubPRComment(GithubComment, PRComment):
    def __str__(self) -> str:
        return "Github" + super().__str__()

Ancestors

Inherited members

class GithubReaction (raw_reaction: Any)
Expand source code
class GithubReaction(Reaction):
    _raw_reaction: _Reaction

    def __str__(self) -> str:
        return "Github" + super().__str__()

    def delete(self) -> None:
        self._raw_reaction.delete()

Ancestors

Inherited members