File Coverage

blib/lib/Net/GitHub/V3/Orgs.pm
Criterion Covered Total %
statement 9 12 75.0
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 19 68.4


line stmt bran cond sub pod time code
1             package Net::GitHub::V3::Orgs;
2              
3 1     1   4 use Moo;
  1         1  
  1         4  
4              
5             our $VERSION = '0.60';
6             our $AUTHORITY = 'cpan:FAYLAND';
7              
8 1     1   192 use URI::Escape;
  1         1  
  1         181  
9              
10             with 'Net::GitHub::V3::Query';
11              
12             sub orgs {
13 0     0 1   my ( $self, $user ) = @_;
14            
15 0 0         my $u = $user ? "/users/" . uri_escape($user) . '/orgs' : '/user/orgs';
16 0           return $self->query($u);
17             }
18              
19             ## build methods on fly
20             my %__methods = (
21             org => { url => "/orgs/%s" },
22             update_org => { url => "/orgs/%s", method => 'PATCH', args => 1 },
23             # Members
24             members => { url => "/orgs/%s/members" },
25             is_member => { url => "/orgs/%s/members/%s", check_status => 204 },
26             delete_member => { url => "/orgs/%s/members/%s", method => 'DELETE', check_status => 204 },
27             public_members => { url => "/orgs/%s/public_members" },
28             is_public_member => { url => "/orgs/%s/public_members/%s", check_status => 204 },
29             publicize_member => { url => "/orgs/%s/public_members/%s", method => 'PUT', check_status => 204 },
30             conceal_member => { url => "/orgs/%s/public_members/%s", method => 'DELETE', check_status => 204 },
31             # Org Teams API
32             teams => { url => "/orgs/%s/teams" },
33             team => { url => "/teams/%s" },
34             create_team => { url => "/orgs/%s/teams", method => 'POST', args => 1 },
35             update_team => { url => "/teams/%s", method => 'PATCH', args => 1 },
36             delete_team => { url => "/teams/%s", method => 'DELETE', check_status => 204 },
37             team_members => { url => "/teams/%s/members" },
38             is_team_member => { url => "/teams/%s/members/%s", check_status => 204 },
39             add_team_member => { url => "/teams/%s/members/%s", method => 'PUT', check_status => 204 },
40             delete_team_member => { url => "/teams/%s/members/%s", method => 'DELETE', check_status => 204 },
41             team_repos => { url => "/teams/%s/repos" },
42             is_team_repos => { url => "/teams/%s/repos/%s", check_status => 204 },
43             add_team_repos => { url => "/teams/%s/repos/%s", method => 'PUT', check_status => 204 },
44             delete_team_repos => { url => "/teams/%s/repos/%s", method => 'DELETE', check_status => 204 },
45             );
46             __build_methods(__PACKAGE__, %__methods);
47              
48 1     1   4 no Moo;
  1         1  
  1         3  
49              
50             1;
51             __END__