line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pithub::Users::Followers; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PLU'; |
3
|
|
|
|
|
|
|
our $VERSION = '0.01039'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Github v3 User Followers API |
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
89
|
use Moo; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
74
|
|
7
|
15
|
|
|
15
|
|
4026
|
use Carp qw( croak ); |
|
15
|
|
|
|
|
50
|
|
|
15
|
|
|
|
|
5162
|
|
8
|
|
|
|
|
|
|
extends 'Pithub::Base'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub follow { |
12
|
4
|
|
|
4
|
1
|
7725
|
my ( $self, %args ) = @_; |
13
|
4
|
100
|
|
|
|
23
|
croak 'Missing key in parameters: user' unless $args{user}; |
14
|
|
|
|
|
|
|
return $self->request( |
15
|
|
|
|
|
|
|
method => 'PUT', |
16
|
3
|
|
|
|
|
38
|
path => sprintf( '/user/following/%s', delete $args{user} ), |
17
|
|
|
|
|
|
|
%args, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub is_following { |
23
|
4
|
|
|
4
|
1
|
3676
|
my ( $self, %args ) = @_; |
24
|
4
|
100
|
|
|
|
21
|
croak 'Missing key in parameters: user' unless $args{user}; |
25
|
|
|
|
|
|
|
return $self->request( |
26
|
|
|
|
|
|
|
method => 'GET', |
27
|
3
|
|
|
|
|
25
|
path => sprintf( '/user/following/%s', delete $args{user} ), |
28
|
|
|
|
|
|
|
%args, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub list { |
34
|
12
|
|
|
12
|
1
|
4295
|
my ( $self, %args ) = @_; |
35
|
12
|
100
|
|
|
|
55
|
if ( $args{user} ) { |
36
|
|
|
|
|
|
|
return $self->request( |
37
|
|
|
|
|
|
|
method => 'GET', |
38
|
10
|
|
|
|
|
110
|
path => sprintf( '/users/%s/followers', delete $args{user} ), |
39
|
|
|
|
|
|
|
%args, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
2
|
|
|
|
|
8
|
return $self->request( |
43
|
|
|
|
|
|
|
method => 'GET', |
44
|
|
|
|
|
|
|
path => '/user/followers', |
45
|
|
|
|
|
|
|
%args, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub list_following { |
51
|
4
|
|
|
4
|
1
|
3438
|
my ( $self, %args ) = @_; |
52
|
4
|
100
|
|
|
|
16
|
if ( $args{user} ) { |
53
|
|
|
|
|
|
|
return $self->request( |
54
|
|
|
|
|
|
|
method => 'GET', |
55
|
2
|
|
|
|
|
21
|
path => sprintf( '/users/%s/following', delete $args{user} ), |
56
|
|
|
|
|
|
|
%args, |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
} |
59
|
2
|
|
|
|
|
6
|
return $self->request( |
60
|
|
|
|
|
|
|
method => 'GET', |
61
|
|
|
|
|
|
|
path => '/user/following', |
62
|
|
|
|
|
|
|
%args, |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub unfollow { |
68
|
4
|
|
|
4
|
1
|
3017
|
my ( $self, %args ) = @_; |
69
|
4
|
100
|
|
|
|
21
|
croak 'Missing key in parameters: user' unless $args{user}; |
70
|
|
|
|
|
|
|
return $self->request( |
71
|
|
|
|
|
|
|
method => 'DELETE', |
72
|
3
|
|
|
|
|
26
|
path => sprintf( '/user/following/%s', delete $args{user} ), |
73
|
|
|
|
|
|
|
%args, |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |