Skip to content

comments

Comment

Bases: BitbucketCloudBase

Source code in server/vendor/atlassian/bitbucket/cloud/common/comments.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Comment(BitbucketCloudBase):
    def __init__(self, data, *args, **kwargs):
        super(Comment, self).__init__(
            None,
            None,
            *args,
            data=data,
            expected_type="pullrequest_comment",
            **kwargs
        )  # fmt: skip

    @property
    def raw(self):
        """The raw comment."""
        return self.get_data("content")["raw"]

    @property
    def html(self):
        """The html comment."""
        return self.get_data("content")["html"]

    @property
    def markup(self):
        """The markup type."""
        return self.get_data("content")["markup"]

    @property
    def user(self):
        """User object with user information of the comment."""
        return User(None, self.get_data("user"), **self._new_session_args)

    def update(self, **kwargs):
        """Update the comment properties. Fields not present in the request body are ignored.

        :param kwargs: dict: The data to update.

        :return: The updated comment
        """
        return self._update_data(self.put(None, data=kwargs))

    def delete(self):
        """Delete the comment.

        :return: The response on success
        """
        return super(Comment, self).delete(None)

html property

The html comment.

markup property

The markup type.

raw property

The raw comment.

user property

User object with user information of the comment.

delete()

Delete the comment.

:return: The response on success

Source code in server/vendor/atlassian/bitbucket/cloud/common/comments.py
45
46
47
48
49
50
def delete(self):
    """Delete the comment.

    :return: The response on success
    """
    return super(Comment, self).delete(None)

update(**kwargs)

Update the comment properties. Fields not present in the request body are ignored.

:param kwargs: dict: The data to update.

:return: The updated comment

Source code in server/vendor/atlassian/bitbucket/cloud/common/comments.py
36
37
38
39
40
41
42
43
def update(self, **kwargs):
    """Update the comment properties. Fields not present in the request body are ignored.

    :param kwargs: dict: The data to update.

    :return: The updated comment
    """
    return self._update_data(self.put(None, data=kwargs))