| 1 | package Net::GitHub::V3::Users; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = '1.02'; | |||||||||
| 6 | 1 | our $AUTHORITY = 'cpan:FAYLAND'; | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use URI::Escape; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | with 'Net::GitHub::V3::Query'; | |||||||||
| 11 | |||||||||||
| 12 | sub show { | ||||||||||
| 13 | 0 | ▶ | my ( $self, $user ) = @_; | ||||||||
|
Subroutine
show: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) : '/user'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | return $self->query($u); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub update { | ||||||||||
| 20 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
update: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 21 | 0 | ▶ | my $data = @_ % 2 ? shift @_ : { @_ }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | return $self->query('PATCH', '/user', $data); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | sub add_email { | ||||||||||
| 27 | 0 | ▶ | (shift)->query( 'POST', '/user/emails', [ @_ ] ); | ||||||||
|
Subroutine
add_email: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | } | ||||||||||
| 29 | sub remove_email { | ||||||||||
| 30 | 0 | ▶ | (shift)->query( 'DELETE', '/user/emails', [ @_ ] ); | ||||||||
|
Subroutine
remove_email: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | sub followers { | ||||||||||
| 34 | 0 | ▶ | my ($self, $user) = @_; | ||||||||
|
Subroutine
followers: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/followers' : '/user/followers'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | return $self->query($u); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | sub next_follower { | ||||||||||
| 41 | 0 | ▶ | my ($self, $user) = @_; | ||||||||
|
Subroutine
next_follower: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 42 | |||||||||||
| 43 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/followers' : '/user/followers'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | 0 | return $self->next($u); | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | sub close_follower { | ||||||||||
| 48 | 0 | ▶ | my ($self, $user) = @_; | ||||||||
|
Subroutine
close_follower: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 49 | |||||||||||
| 50 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/followers' : '/user/followers'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 0 | return $self->close($u); | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | |||||||||||
| 55 | sub following { | ||||||||||
| 56 | 0 | ▶ | my ($self, $user) = @_; | ||||||||
|
Subroutine
following: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/following' : '/user/following'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | return $self->query($u); | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | sub next_following { | ||||||||||
| 63 | 0 | ▶ | my ($self, $user) = @_; | ||||||||
|
Subroutine
next_following: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 64 | |||||||||||
| 65 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/following' : '/user/following'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | 0 | return $self->next($u); | |||||||||
| 67 | } | ||||||||||
| 68 | |||||||||||
| 69 | sub close_following { | ||||||||||
| 70 | 0 | ▶ | my ($self, $user) = @_; | ||||||||
|
Subroutine
close_following: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 71 | |||||||||||
| 72 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/following' : '/user/following'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 73 | 0 | return $self->close($u); | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | ## build methods on fly | ||||||||||
| 77 | 1 | my %__methods = ( | |||||||||
| 78 | |||||||||||
| 79 | emails => { url => "/user/emails", paginate => 1 }, | ||||||||||
| 80 | |||||||||||
| 81 | is_following => { url => "/user/following/%s", check_status => 204 }, | ||||||||||
| 82 | follow => { url => "/user/following/%s", method => 'PUT', check_status => 204 }, | ||||||||||
| 83 | unfollow => { url => "/user/following/%s", method => 'DELETE', check_status => 204 }, | ||||||||||
| 84 | |||||||||||
| 85 | keys => { url => "/user/keys", paginate => 1 }, | ||||||||||
| 86 | key => { url => "/user/keys/%s" }, | ||||||||||
| 87 | create_key => { url => "/user/keys", method => 'POST', args => 1 }, | ||||||||||
| 88 | update_key => { url => "/user/keys/%s", method => 'PATCH', args => 1 }, | ||||||||||
| 89 | delete_key => { url => "/user/keys/%s", method => 'DELETE', check_status => 204 }, | ||||||||||
| 90 | ); | ||||||||||
| 91 | 1 | __build_methods(__PACKAGE__, %__methods); | |||||||||
| 92 | |||||||||||
| 93 | ## DEPERCATED | ||||||||||
| 94 | sub contributions { | ||||||||||
| 95 | 0 | ▶ | die "contributions_calender_data is no longer available"; | ||||||||
|
Subroutine
contributions: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 96 | } | ||||||||||
| 97 | |||||||||||
| 98 | 1 | ▶ | no Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 99 | |||||||||||
| 100 | 1 | 1; | |||||||||
| 101 | __END__ | ||||||||||