line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pithub::Events; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PLU'; |
3
|
|
|
|
|
|
|
our $VERSION = '0.01039'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Github v3 Events API |
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
994
|
use Moo; |
|
15
|
|
|
|
|
13790
|
|
|
15
|
|
|
|
|
72
|
|
7
|
15
|
|
|
15
|
|
4946
|
use Carp qw( croak ); |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
8534
|
|
8
|
|
|
|
|
|
|
extends 'Pithub::Base'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub issue { |
12
|
2
|
|
|
2
|
1
|
6547
|
my ( $self, %args ) = @_; |
13
|
2
|
|
|
|
|
26
|
$self->_validate_user_repo_args( \%args ); |
14
|
|
|
|
|
|
|
return $self->request( |
15
|
|
|
|
|
|
|
method => 'GET', |
16
|
2
|
|
|
|
|
34
|
path => sprintf( '/repos/%s/%s/issues/events', delete $args{user}, delete $args{repo} ), |
17
|
|
|
|
|
|
|
%args, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub network { |
23
|
2
|
|
|
2
|
1
|
3317
|
my ( $self, %args ) = @_; |
24
|
2
|
|
|
|
|
17
|
$self->_validate_user_repo_args( \%args ); |
25
|
|
|
|
|
|
|
return $self->request( |
26
|
|
|
|
|
|
|
method => 'GET', |
27
|
2
|
|
|
|
|
24
|
path => sprintf( '/networks/%s/%s/events', delete $args{user}, delete $args{repo} ), |
28
|
|
|
|
|
|
|
%args, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub org { |
34
|
3
|
|
|
3
|
1
|
4433
|
my ( $self, %args ) = @_; |
35
|
3
|
100
|
|
|
|
22
|
croak 'Missing key in parameters: org' unless $args{org}; |
36
|
|
|
|
|
|
|
return $self->request( |
37
|
|
|
|
|
|
|
method => 'GET', |
38
|
2
|
|
|
|
|
25
|
path => sprintf( '/orgs/%s/events', delete $args{org} ), |
39
|
|
|
|
|
|
|
%args, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub org_for_user { |
45
|
5
|
|
|
5
|
1
|
4931
|
my ( $self, %args ) = @_; |
46
|
5
|
100
|
|
|
|
31
|
croak 'Missing key in parameters: org' unless $args{org}; |
47
|
4
|
100
|
|
|
|
22
|
croak 'Missing key in parameters: user' unless $args{user}; |
48
|
|
|
|
|
|
|
return $self->request( |
49
|
|
|
|
|
|
|
method => 'GET', |
50
|
3
|
|
|
|
|
44
|
path => sprintf( '/users/%s/events/orgs/%s', delete $args{user}, delete $args{org} ), |
51
|
|
|
|
|
|
|
%args, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub public { |
57
|
2
|
|
|
2
|
1
|
3102
|
my ( $self, %args ) = @_; |
58
|
2
|
|
|
|
|
18
|
return $self->request( |
59
|
|
|
|
|
|
|
method => 'GET', |
60
|
|
|
|
|
|
|
path => '/events', |
61
|
|
|
|
|
|
|
%args, |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub repos { |
67
|
2
|
|
|
2
|
1
|
3106
|
my ( $self, %args ) = @_; |
68
|
2
|
|
|
|
|
15
|
$self->_validate_user_repo_args( \%args ); |
69
|
|
|
|
|
|
|
return $self->request( |
70
|
|
|
|
|
|
|
method => 'GET', |
71
|
2
|
|
|
|
|
22
|
path => sprintf( '/repos/%s/%s/events', delete $args{user}, delete $args{repo} ), |
72
|
|
|
|
|
|
|
%args, |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub user_performed { |
78
|
4
|
|
|
4
|
1
|
5097
|
my ( $self, %args ) = @_; |
79
|
4
|
100
|
|
|
|
29
|
croak 'Missing key in parameters: user' unless $args{user}; |
80
|
3
|
|
|
|
|
19
|
my $path = sprintf( '/users/%s/events', delete $args{user} ); |
81
|
3
|
100
|
|
|
|
12
|
if ( $args{public} ) { |
82
|
1
|
|
|
|
|
3
|
$path .= '/public'; |
83
|
|
|
|
|
|
|
} |
84
|
3
|
|
|
|
|
22
|
return $self->request( |
85
|
|
|
|
|
|
|
method => 'GET', |
86
|
|
|
|
|
|
|
path => $path, |
87
|
|
|
|
|
|
|
%args, |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub user_received { |
93
|
4
|
|
|
4
|
1
|
4299
|
my ( $self, %args ) = @_; |
94
|
4
|
100
|
|
|
|
89
|
croak 'Missing key in parameters: user' unless $args{user}; |
95
|
3
|
|
|
|
|
18
|
my $path = sprintf( '/users/%s/received_events', delete $args{user} ); |
96
|
3
|
100
|
|
|
|
15
|
if ( $args{public} ) { |
97
|
1
|
|
|
|
|
4
|
$path .= '/public'; |
98
|
|
|
|
|
|
|
} |
99
|
3
|
|
|
|
|
21
|
return $self->request( |
100
|
|
|
|
|
|
|
method => 'GET', |
101
|
|
|
|
|
|
|
path => $path, |
102
|
|
|
|
|
|
|
%args, |
103
|
|
|
|
|
|
|
); |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
__END__ |