Ejemplo n.º 1
0
    def fetch_participants(self, **kwargs):
        """
        |aiter|

        Fetches users participating on the participable.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.User`.
        """

        from github.objects import User

        def map_func(data):
            return User.from_data(data, self.http)

        map = {
            "Issue": self.http.fetch_issue_participants,
            "PullRequest": self.http.fetch_pull_request_participants,
        }

        meth = map[self.data["__typename"]]

        return CollectionIterator(meth, self.id, map_func=map_func, **kwargs)
Ejemplo n.º 2
0
    def fetch_comments(self, **kwargs):
        """
        |aiter|

        Fetches comments on the commentable.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.abc.Comment`.
        """

        from github import objects

        def map_func(data):
            if data["__typename"] == "IssueComment" and self.data["__typename"] == "PullRequest":
                # special case for lack of API PullRequestComment
                cls = objects.PullRequestComment
            else:
                cls = objects._TYPE_MAP[data["__typename"]]

            return cls.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_commentable_comments,
                                  self.id, map_func=map_func, **kwargs)
Ejemplo n.º 3
0
    def fetch_issues(self, **kwargs):
        """
        |aiter|

        Fetches issues in the repository.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.Issue`.
        """

        def map_func(data):
            return Issue.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_repository_issues, self.id,
                                  map_func=map_func, **kwargs)
Ejemplo n.º 4
0
    def fetch_collaborators(self, **kwargs):
        """
        |aiter|

        Fetches collaborators on the repository.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.User`.
        """

        def map_func(data):
            return User.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_repository_collaborators,
                                  self.id, map_func=map_func, **kwargs)
Ejemplo n.º 5
0
    def fetch_assignable_users(self, **kwargs):
        """
        |aiter|

        Fetches users that can be assigned to issues in the repository.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.User`.
        """

        def map_func(data):
            return User.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_repository_assignable_users,
                                  self.id, map_func=map_func, **kwargs)
Ejemplo n.º 6
0
    def fetch_pull_requests(self, **kwargs):
        """
        |aiter|

        Fetches pull requests with the label.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.PullRequest`.
        """
        def map_func(data):
            return PullRequest.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_label_pull_requests,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 7
0
    def fetch_following(self, **kwargs):
        """
        |aiter|

        Fetches users followed by the user.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.User`.
        """
        def map_func(data):
            return User.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_user_following,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 8
0
    def fetch_commit_comments(self, **kwargs):
        """
        |aiter|

        Fetches the user's commit comments.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.CommitComment`.
        """
        def map_func(data):
            return CommitComment.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_user_commit_comments,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 9
0
    def fetch_tiers(self, **kwargs):
        """
        |aiter|

        Fetches tiers for the sponsor listing.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.SponsorTier`.
        """
        def map_func(data):
            return SponsorTier.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_sponsorlisting_tiers,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 10
0
    def fetch_columns(self, **kwargs):
        """
        |aiter|

        Fetches columns in the project.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.ProjectColumn`.
        """
        def map_func(data):
            return ProjectColumn.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_project_columns,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 11
0
    def fetch_sponsorships(self, **kwargs):
        """
        |aiter|

        Fetches sponsorships on the sponsor tier.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.Sponsorship`.
        """
        def map_func(data):
            return Sponsorship.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_sponsortier_sponsorships,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 12
0
    def fetch_labels(self, **kwargs):
        """
        |aiter|

        Fetches labels from the labelable.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.Label`.
        """

        from github.objects import Label

        def map_func(data):
            return Label.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_labelable_labels, self.id,
                                  map_func=map_func, **kwargs)
Ejemplo n.º 13
0
    def fetch_assignees(self, **kwargs):
        """
        |aiter|

        Fetches users assigned to the assignable.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.User`.
        """

        from github.objects import User

        def map_func(data):
            return User.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_assignable_assignees,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)
Ejemplo n.º 14
0
    def fetch_projects(self, **kwargs):
        """
        |aiter|

        Fetches projects from this project owner.

        This requires the ``public_repo`` scope.

        Returns
        -------
        :class:`~github.iterator.CollectionIterator`
            An iterator of :class:`~github.Project`.
        """

        from github.objects import Project

        def map_func(data):
            return Project.from_data(data, self.http)

        return CollectionIterator(self.http.fetch_projectowner_projects,
                                  self.id,
                                  map_func=map_func,
                                  **kwargs)