1Net::GitHub::V3::PullReUqsueerstCso(n3t)ributed Perl DocNuemte:n:tGaittiHounb::V3::PullRequests(3)
2
3
4
6 Net::GitHub::V3::PullRequests - GitHub Pull Requests API
7
9 use Net::GitHub::V3;
10
11 my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
12 my $pull_request = $gh->pull_request;
13
15 To ease the keyboard, we provied two ways to call any method which
16 starts with :user/:repo
17
18 1. SET user/repos before call methods below
19
20 $gh->set_default_user_repo('fayland', 'perl-net-github'); # take effects for all $gh->
21 $pull_request->set_default_user_repo('fayland', 'perl-net-github'); # only take effect to $gh->pull_request
22 my @pulls = $pull_request->pulls();
23
24 2. If it is just for once, we can pass :user, :repo before any
25 arguments
26
27 my @pulls = $pull_request->pulls($user, $repo);
28
29 METHODS
30 Pull Requets
31
32 <http://developer.github.com/v3/pulls/>
33
34 pulls
35 my @pulls = $pull_request->pulls();
36 my @pulls = $pull_request->pulls( { state => 'open' } );
37 while (my $pr = $pull_request->next_pull( { state => 'open' } )) { ...; }
38
39 pull
40 my $pull = $pull_request->pull($pull_number);
41
42 create_pull
43 update_pull
44 my $pull = $pull_request->create_pull( {
45 "title" => "Amazing new feature",
46 "body" => "Please pull this in!",
47 "head" => "octocat:new-feature",
48 "base" => "master"
49 } );
50 my $pull = $pull_request->update_pull( $pull_number, $new_pull_data );
51
52 commits
53 files
54 my @commits = $pull_request->commits($pull_number);
55 my @files = $pull_request->files($pull_number);
56 while (my $commit = $pull_request->next_commit($pull_number)) { ...; }
57 while (my $file = $pull_request->next_file($pull_number)) { ...; }
58
59 is_merged
60 merge
61 my $is_merged = $pull_request->is_merged($pull_number);
62 my $result = $pull_request->merge($pull_number);
63
64 Pull Request Comments API
65
66 <http://developer.github.com/v3/pulls/comments/>
67
68 comments
69 comment
70 create_comment
71 update_comment
72 delete_comment
73 my @comments = $pull_request->comments($pull_number);
74 while (my $comment = $pull_request->next_comment($pull_number)) { ...; }
75 my $comment = $pull_request->comment($comment_id);
76 my $comment = $pull_request->create_comment($pull_number, {
77 "body" => "a new comment",
78 commit_id => '586fe4be94c32248043b344e99fa15c72b40d1c2',
79 path => 'test',
80 position => 1,
81 });
82 my $comment = $pull_request->update_comment($comment_id, {
83 "body" => "Nice change"
84 });
85 my $st = $pull_request->delete_comment($comment_id);
86
87 Pull Request Review API
88
89 <https://developer.github.com/v3/pulls/review_requests/>
90
91 reviewers
92 add_reviewers
93 delete_reviewers
94 my @reviewers = $pull_request->reviewers($pull_number);
95 my $result = $pull_request->add_reviewers($pull_number, {
96 reviewers => [$user1, $user2],
97 team_reviewers => [$team1],
98 );
99 my $result = $pull_request->delete_reviewers($pull_number, {
100 reviewers => [$user1, $user2],
101 team_reviewers => [$team1],
102 );
103
105 Refer Net::GitHub
106
107
108
109perl v5.32.0 2020-07-28 Net::GitHub::V3::PullRequests(3)