line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pithub::Issues; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PLU'; |
3
|
|
|
|
|
|
|
our $VERSION = '0.01039'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Github v3 Issues API |
5
|
|
|
|
|
|
|
|
6
|
16
|
|
|
16
|
|
147920
|
use Moo; |
|
16
|
|
|
|
|
26
|
|
|
16
|
|
|
|
|
89
|
|
7
|
16
|
|
|
16
|
|
4349
|
use Carp qw( croak ); |
|
16
|
|
|
|
|
27
|
|
|
16
|
|
|
|
|
718
|
|
8
|
16
|
|
|
16
|
|
6004
|
use Pithub::Issues::Assignees; |
|
16
|
|
|
|
|
40
|
|
|
16
|
|
|
|
|
402
|
|
9
|
16
|
|
|
16
|
|
6667
|
use Pithub::Issues::Comments; |
|
16
|
|
|
|
|
35
|
|
|
16
|
|
|
|
|
402
|
|
10
|
16
|
|
|
16
|
|
5751
|
use Pithub::Issues::Events; |
|
16
|
|
|
|
|
49
|
|
|
16
|
|
|
|
|
405
|
|
11
|
16
|
|
|
16
|
|
6199
|
use Pithub::Issues::Labels; |
|
16
|
|
|
|
|
41
|
|
|
16
|
|
|
|
|
407
|
|
12
|
16
|
|
|
16
|
|
6130
|
use Pithub::Issues::Milestones; |
|
16
|
|
|
|
|
43
|
|
|
16
|
|
|
|
|
6753
|
|
13
|
|
|
|
|
|
|
extends 'Pithub::Base'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub assignees { |
17
|
1
|
|
|
1
|
1
|
498
|
return shift->_create_instance('Pithub::Issues::Assignees', @_); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub comments { |
22
|
2
|
|
|
2
|
1
|
1591
|
return shift->_create_instance('Pithub::Issues::Comments', @_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub create { |
27
|
6
|
|
|
6
|
1
|
14207
|
my ( $self, %args ) = @_; |
28
|
6
|
100
|
|
|
|
46
|
croak 'Missing key in parameters: data (hashref)' unless ref $args{data} eq 'HASH'; |
29
|
4
|
|
|
|
|
36
|
$self->_validate_user_repo_args( \%args ); |
30
|
|
|
|
|
|
|
return $self->request( |
31
|
|
|
|
|
|
|
method => 'POST', |
32
|
4
|
|
|
|
|
53
|
path => sprintf( '/repos/%s/%s/issues', delete $args{user}, delete $args{repo} ), |
33
|
|
|
|
|
|
|
%args, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub events { |
39
|
1
|
|
|
1
|
1
|
1462
|
return shift->_create_instance('Pithub::Issues::Events', @_); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub get { |
44
|
4
|
|
|
4
|
1
|
3570
|
my ( $self, %args ) = @_; |
45
|
4
|
100
|
|
|
|
25
|
croak 'Missing key in parameters: issue_id' unless $args{issue_id}; |
46
|
3
|
|
|
|
|
19
|
$self->_validate_user_repo_args( \%args ); |
47
|
|
|
|
|
|
|
return $self->request( |
48
|
|
|
|
|
|
|
method => 'GET', |
49
|
3
|
|
|
|
|
36
|
path => sprintf( '/repos/%s/%s/issues/%s', delete $args{user}, delete $args{repo}, delete $args{issue_id} ), |
50
|
|
|
|
|
|
|
%args, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub labels { |
56
|
1
|
|
|
1
|
1
|
1441
|
return shift->_create_instance('Pithub::Issues::Labels', @_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub list { |
61
|
5
|
|
|
5
|
1
|
3949
|
my ( $self, %args ) = @_; |
62
|
5
|
|
|
|
|
35
|
$self->_get_user_repo_args( \%args ); |
63
|
5
|
50
|
66
|
|
|
25
|
if ( $args{user} && $args{repo} ) { |
64
|
|
|
|
|
|
|
return $self->request( |
65
|
|
|
|
|
|
|
method => 'GET', |
66
|
3
|
|
|
|
|
33
|
path => sprintf( '/repos/%s/%s/issues', delete $args{user}, delete $args{repo} ), |
67
|
|
|
|
|
|
|
%args, |
68
|
|
|
|
|
|
|
); |
69
|
|
|
|
|
|
|
} |
70
|
2
|
|
|
|
|
7
|
return $self->request( |
71
|
|
|
|
|
|
|
method => 'GET', |
72
|
|
|
|
|
|
|
path => sprintf('/issues'), |
73
|
|
|
|
|
|
|
%args, |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub milestones { |
79
|
1
|
|
|
1
|
1
|
1399
|
return shift->_create_instance('Pithub::Issues::Milestones', @_); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub update { |
84
|
7
|
|
|
7
|
1
|
5385
|
my ( $self, %args ) = @_; |
85
|
7
|
100
|
|
|
|
29
|
croak 'Missing key in parameters: issue_id' unless $args{issue_id}; |
86
|
6
|
100
|
|
|
|
36
|
croak 'Missing key in parameters: data (hashref)' unless ref $args{data} eq 'HASH'; |
87
|
4
|
|
|
|
|
21
|
$self->_validate_user_repo_args( \%args ); |
88
|
|
|
|
|
|
|
return $self->request( |
89
|
|
|
|
|
|
|
method => 'PATCH', |
90
|
4
|
|
|
|
|
42
|
path => sprintf( '/repos/%s/%s/issues/%s', delete $args{user}, delete $args{repo}, delete $args{issue_id} ), |
91
|
|
|
|
|
|
|
%args, |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__END__ |