line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pithub::Issues; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PLU'; |
3
|
|
|
|
|
|
|
our $VERSION = '0.01041'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: Github v3 Issues API |
6
|
|
|
|
|
|
|
|
7
|
17
|
|
|
17
|
|
189103
|
use Moo; |
|
17
|
|
|
|
|
39
|
|
|
17
|
|
|
|
|
102
|
|
8
|
17
|
|
|
17
|
|
5858
|
use Carp qw( croak ); |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
929
|
|
9
|
17
|
|
|
17
|
|
8085
|
use Pithub::Issues::Assignees (); |
|
17
|
|
|
|
|
52
|
|
|
17
|
|
|
|
|
427
|
|
10
|
17
|
|
|
17
|
|
8072
|
use Pithub::Issues::Comments (); |
|
17
|
|
|
|
|
46
|
|
|
17
|
|
|
|
|
392
|
|
11
|
17
|
|
|
17
|
|
7499
|
use Pithub::Issues::Events (); |
|
17
|
|
|
|
|
55
|
|
|
17
|
|
|
|
|
467
|
|
12
|
17
|
|
|
17
|
|
8095
|
use Pithub::Issues::Labels (); |
|
17
|
|
|
|
|
63
|
|
|
17
|
|
|
|
|
395
|
|
13
|
17
|
|
|
17
|
|
7922
|
use Pithub::Issues::Milestones (); |
|
17
|
|
|
|
|
60
|
|
|
17
|
|
|
|
|
8585
|
|
14
|
|
|
|
|
|
|
extends 'Pithub::Base'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub assignees { |
18
|
1
|
|
|
1
|
1
|
547
|
return shift->_create_instance( Pithub::Issues::Assignees::, @_ ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub comments { |
23
|
2
|
|
|
2
|
1
|
1651
|
return shift->_create_instance( Pithub::Issues::Comments::, @_ ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub create { |
28
|
6
|
|
|
6
|
1
|
15968
|
my ( $self, %args ) = @_; |
29
|
|
|
|
|
|
|
croak 'Missing key in parameters: data (hashref)' |
30
|
6
|
100
|
|
|
|
47
|
unless ref $args{data} eq 'HASH'; |
31
|
4
|
|
|
|
|
31
|
$self->_validate_user_repo_args( \%args ); |
32
|
|
|
|
|
|
|
return $self->request( |
33
|
|
|
|
|
|
|
method => 'POST', |
34
|
|
|
|
|
|
|
path => sprintf( |
35
|
|
|
|
|
|
|
'/repos/%s/%s/issues', delete $args{user}, delete $args{repo} |
36
|
4
|
|
|
|
|
51
|
), |
37
|
|
|
|
|
|
|
%args, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub events { |
43
|
1
|
|
|
1
|
1
|
1485
|
return shift->_create_instance( Pithub::Issues::Events::, @_ ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub get { |
48
|
4
|
|
|
4
|
1
|
3457
|
my ( $self, %args ) = @_; |
49
|
4
|
100
|
|
|
|
32
|
croak 'Missing key in parameters: issue_id' unless $args{issue_id}; |
50
|
3
|
|
|
|
|
19
|
$self->_validate_user_repo_args( \%args ); |
51
|
|
|
|
|
|
|
return $self->request( |
52
|
|
|
|
|
|
|
method => 'GET', |
53
|
|
|
|
|
|
|
path => sprintf( |
54
|
|
|
|
|
|
|
'/repos/%s/%s/issues/%s', delete $args{user}, delete $args{repo}, |
55
|
|
|
|
|
|
|
delete $args{issue_id} |
56
|
3
|
|
|
|
|
51
|
), |
57
|
|
|
|
|
|
|
%args, |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub labels { |
63
|
1
|
|
|
1
|
1
|
1443
|
return shift->_create_instance( Pithub::Issues::Labels::, @_ ); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub list { |
68
|
5
|
|
|
5
|
1
|
4018
|
my ( $self, %args ) = @_; |
69
|
5
|
|
|
|
|
24
|
$self->_get_user_repo_args( \%args ); |
70
|
5
|
50
|
66
|
|
|
29
|
if ( $args{user} && $args{repo} ) { |
71
|
|
|
|
|
|
|
return $self->request( |
72
|
|
|
|
|
|
|
method => 'GET', |
73
|
|
|
|
|
|
|
path => sprintf( |
74
|
|
|
|
|
|
|
'/repos/%s/%s/issues', delete $args{user}, delete $args{repo} |
75
|
3
|
|
|
|
|
36
|
), |
76
|
|
|
|
|
|
|
%args, |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
} |
79
|
2
|
|
|
|
|
12
|
return $self->request( |
80
|
|
|
|
|
|
|
method => 'GET', |
81
|
|
|
|
|
|
|
path => sprintf('/issues'), |
82
|
|
|
|
|
|
|
%args, |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub milestones { |
88
|
1
|
|
|
1
|
1
|
1353
|
return shift->_create_instance( Pithub::Issues::Milestones::, @_ ); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub update { |
93
|
7
|
|
|
7
|
1
|
5768
|
my ( $self, %args ) = @_; |
94
|
7
|
100
|
|
|
|
38
|
croak 'Missing key in parameters: issue_id' unless $args{issue_id}; |
95
|
|
|
|
|
|
|
croak 'Missing key in parameters: data (hashref)' |
96
|
6
|
100
|
|
|
|
37
|
unless ref $args{data} eq 'HASH'; |
97
|
4
|
|
|
|
|
18
|
$self->_validate_user_repo_args( \%args ); |
98
|
|
|
|
|
|
|
return $self->request( |
99
|
|
|
|
|
|
|
method => 'PATCH', |
100
|
|
|
|
|
|
|
path => sprintf( |
101
|
|
|
|
|
|
|
'/repos/%s/%s/issues/%s', delete $args{user}, delete $args{repo}, |
102
|
|
|
|
|
|
|
delete $args{issue_id} |
103
|
4
|
|
|
|
|
52
|
), |
104
|
|
|
|
|
|
|
%args, |
105
|
|
|
|
|
|
|
); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
__END__ |