Skip to content

users

Participant

Bases: BitbucketCloudBase

Source code in server/vendor/atlassian/bitbucket/cloud/common/users.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
class Participant(BitbucketCloudBase):
    ROLE_REVIEWER = "REVIEWER"
    ROLE_PARTICIPANT = "PARTICIPANT"
    CHANGES_REQUESTED = "changes_requested"

    def __init__(self, data, *args, **kwargs):
        super(Participant, self).__init__(None, None, *args, data=data, expected_type="participant", **kwargs)

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

    @property
    def is_participant(self):
        """True if the user is a pull request participant."""
        return self.get_data("role") == self.ROLE_PARTICIPANT

    @property
    def is_reviewer(self):
        """True if the user is a pull request reviewer."""
        return self.get_data("role") == self.ROLE_REVIEWER

    @property
    def is_default_reviewer(self):
        """True if the user is a default reviewer."""

    @property
    def has_changes_requested(self):
        """True if user requested changes."""
        return str(self.get_data("state")) == self.CHANGES_REQUESTED

    @property
    def has_approved(self):
        """True if user approved the pull request."""
        return self.get_data("approved")

    @property
    def participated_on(self):
        """Time of last participation."""
        return self.get_time("participated_on")

    @property
    def avatar(self):
        """URL to user avatar on Bitbucket Cloud"""
        return self.get_data("links")["avatar"]["href"]

avatar property

URL to user avatar on Bitbucket Cloud

has_approved property

True if user approved the pull request.

has_changes_requested property

True if user requested changes.

is_default_reviewer property

True if the user is a default reviewer.

is_participant property

True if the user is a pull request participant.

is_reviewer property

True if the user is a pull request reviewer.

participated_on property

Time of last participation.

user property

User object with user information of the participant.

User

Bases: BitbucketCloudBase

Source code in server/vendor/atlassian/bitbucket/cloud/common/users.py
 4
 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
class User(BitbucketCloudBase):
    def __init__(self, url, data, *args, **kwargs):
        super(User, self).__init__(url, *args, data=data, expected_type="user", **kwargs)

    @property
    def display_name(self):
        """Display name used by Bitbucket Cloud"""
        return str(self.get_data("display_name"))

    @property
    def nickname(self):
        """Username used by Bitbucket Cloud"""
        return self.get_data("nickname")

    @property
    def account_id(self):
        """Account id used by Bitbucket Cloud"""
        return self.get_data("account_id")

    @property
    def uuid(self):
        """User id used by Bitbucket Cloud"""
        return self.get_data("uuid")

    @property
    def avatar(self):
        """URL to user avatar on Bitbucket Cloud"""
        return self.get_data("links")["avatar"]["href"]

account_id property

Account id used by Bitbucket Cloud

avatar property

URL to user avatar on Bitbucket Cloud

display_name property

Display name used by Bitbucket Cloud

nickname property

Username used by Bitbucket Cloud

uuid property

User id used by Bitbucket Cloud