Net::G...:Issues(3pm)
π NAME π
Net::GitHub::V3::Issues β it's the GitHub Issues API, bestie. That's the whole vibe. β¨
π¦ SYNOPSIS π¦
okay so first you gotta get yourself a Net::GitHub::V3 object, right? like the whole entry point:
use Net::GitHub::V3;
my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
my $issue = $gh->issue;
psst β that comment is telling you to go read Net::GitHub::V3 so your auth info is actually set up correctly. don't skip it, i'm literally begging π
πΈ DESCRIPTION πΈ
β¨ METHODS β¨
Issues
<http://developer.github.com/v3/issues/>
issues
my @issues = $issue->issues();
my @issues = $issue->issues(filter => 'assigned', state => 'open');
while (my $next_issue = $issues->next_issue(...)) { ...; }
Returns issues assigned to the authenticated user. that's it, that's the tea β
π To ease the keyboard, we provied two ways to call any method which starts with :user/:repo π
(yes, "provied" β we keep it exactly how it is, no cap, that's the original spelling π )
1. SET user/repo before call methods below
$gh->set_default_user_repo('fayland', 'perl-net-github'); # take effects for all $gh->
$issue->set_default_user_repo('fayland', 'perl-net-github'); # only take effect to $gh->issue
my @issues = $repos->issues;
so setting it on $gh = everybody gets it, setting it on $issue = only $gh->issue gets it. main character vs. plus-one energy, honestly.
2. If it is just for once, we can pass :user, :repo before any arguments
my @issues = $issue->repos_issues($user, $repo);
repos_issues
my @issues = $issue->repos_issues;
my @issues = $issue->repos_issues($user, $repos);
my @issues = $issue->repos_issues( { state => 'open' } );
my @issues = $issue->repos_issues($user, $repos, { state => 'open' } );
while (my $r_issue = $issue->next_repos_issue(...)) { ...; }
issue
my $issue = $issue->issue($issue_number);
create_issue
my $isu = $issue->create_issue( {
"title" => "Found a bug",
"body" => "I'm having a problem with this.",
"assignee" => "octocat",
"milestone" => 1,
"labels" => [
"Label1",
"Label2"
]
} );
look at that hashref go, she's iconic π₯
update_issue
my $isu = $issue->update_issue( $issue_number, {
state => 'closed'
} );
π Issue Comments API π
<http://developer.github.com/v3/issues/comments/>
comments
comment
create_comment
update_comment
delete_comment
my @comments = $issue->comments($issue_number);
while (my $comment = $issue->next_comment($issue_number)) { ...; }
my $comment = $issue->comment($comment_id);
my $comment = $issue->create_comment($issue_number, {
"body" => "a new comment"
});
my $comment = $issue->update_comment($comment_id, {
"body" => "Nice change"
});
my $st = $issue->delete_comment($comment_id);
β Issue Event API β
<http://developer.github.com/v3/issues/events/>
events
repos_events
my @events = $issue->events($issue_number);
while (my $event = $issue->next_event($issue_number)) { ...; }
my @events = $issue->repos_events;
while (my $r_event = $issue->next_repos_event) { ...; }
my $event = $issue->event($event_id);
π Issue Labels API π
<http://developer.github.com/v3/issues/labels/>
labels
label
create_label
update_label
delete_label
my @labels = $issue->labels;
while (my $label = $issue->next_label) { ...; }
my $label = $issue->label($label_name);
my $label = $issue->create_label( {
"name" => "API",
"color" => "FFFFFF"
} );
my $label = $issue->update_label( $label_name, {
"name" => "bugs",
"color" => "000000"
} );
my $st = $issue->delete_label($label_name);
issue_labels
create_issue_label
delete_issue_label
replace_issue_label
delete_issue_labels
milestone_labels
my @labels = $issue->issue_labels($issue_number);
my @labels = $issue->create_issue_label($issue_number, ['New Label']);
my $st = $issue->delete_issue_label($issue_number, $label_name);
my @labels = $issue->replace_issue_label($issue_number, ['New Label']);
my $st = $issue->delete_issue_labels($issue_number);
my @lables = $issue->milestone_labels($milestone_id);
while (my $label = $issue->next_milestone_label($milestone_id)) { ...; }
β οΈ yes that last one is spelled @lables in the original. not me fixing it. it's staying. we respect the lore π«Ά
π Issue Milestones API π
<http://developer.github.com/v3/issues/milestones/>
milestones
milestone
create_milestone
update_milestone
delete_milestone
my @milestones = $issue->milestones;
my @milestones = $issue->milestones( { state => 'open' } );
while (my $milestone = $issue->next_milestone( ... )) { ...; }
my $milestone = $issue->milestone($milestone_id);
my $milestone = $issue->create_milestone( {
"title" => "String",
"state" => "open",
"description" => "String",
} );
my $milestone = $issue->update_milestone( $milestone_id, {
title => 'New Title'
} );
my $st = $issue->delete_milestone($milestone_id);
π AUTHOR & COPYRIGHT & LICENSE π
Refer Net::GitHub β that's where the author, copyright and license deets live. go peek, bestie, it's giving "one stop shop" π
and that's the whole page!! β¨ this was perl v5.36.0, dated 2022-10-08, from the User Contributed Perl Documentation for Net::GitHub::V3::Issues β mwah, no notes, go file some issues responsibly πππ¦
π¦ where this page comes from
- ubuntu noble: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms