File Coverage

blib/lib/Pithub/Orgs/Members.pm
Criterion Covered Total %
statement 32 32 100.0
branch 24 24 100.0
condition n/a
subroutine 9 9 100.0
pod 7 7 100.0
total 72 72 100.0


line stmt bran cond sub pod time code
1             package Pithub::Orgs::Members;
2             our $AUTHORITY = 'cpan:PLU';
3             our $VERSION = '0.01039';
4             # ABSTRACT: Github v3 Org Members API
5              
6 15     15   94 use Moo;
  15         24  
  15         73  
7 15     15   3871 use Carp qw( croak );
  15         34  
  15         7677  
8             extends 'Pithub::Base';
9              
10              
11             sub conceal {
12 5     5 1 8178 my ( $self, %args ) = @_;
13 5 100       25 croak 'Missing key in parameters: org' unless $args{org};
14 4 100       21 croak 'Missing key in parameters: user' unless $args{user};
15             return $self->request(
16             method => 'DELETE',
17 3         42 path => sprintf( '/orgs/%s/public_members/%s', delete $args{org}, delete $args{user} ),
18             %args,
19             );
20             }
21              
22              
23             sub delete {
24 5     5 1 3739 my ( $self, %args ) = @_;
25 5 100       44 croak 'Missing key in parameters: org' unless $args{org};
26 4 100       18 croak 'Missing key in parameters: user' unless $args{user};
27             return $self->request(
28             method => 'DELETE',
29 3         27 path => sprintf( '/orgs/%s/members/%s', delete $args{org}, delete $args{user} ),
30             %args,
31             );
32             }
33              
34              
35             sub is_member {
36 5     5 1 3717 my ( $self, %args ) = @_;
37 5 100       23 croak 'Missing key in parameters: org' unless $args{org};
38 4 100       39 croak 'Missing key in parameters: user' unless $args{user};
39             return $self->request(
40             method => 'GET',
41 3         60 path => sprintf( '/orgs/%s/members/%s', delete $args{org}, delete $args{user} ),
42             %args,
43             );
44             }
45              
46              
47             sub is_public {
48 4     4 1 3113 my ( $self, %args ) = @_;
49 4 100       23 croak 'Missing key in parameters: org' unless $args{org};
50 3 100       18 croak 'Missing key in parameters: user' unless $args{user};
51             return $self->request(
52             method => 'GET',
53 2         22 path => sprintf( '/orgs/%s/public_members/%s', delete $args{org}, delete $args{user} ),
54             %args,
55             );
56             }
57              
58              
59             sub list {
60 3     3 1 2131 my ( $self, %args ) = @_;
61 3 100       18 croak 'Missing key in parameters: org' unless $args{org};
62             return $self->request(
63             method => 'GET',
64 2         21 path => sprintf( '/orgs/%s/members', delete $args{org} ),
65             %args,
66             );
67             }
68              
69              
70             sub list_public {
71 3     3 1 3353 my ( $self, %args ) = @_;
72 3 100       20 croak 'Missing key in parameters: org' unless $args{org};
73             return $self->request(
74             method => 'GET',
75 2         21 path => sprintf( '/orgs/%s/public_members', delete $args{org} ),
76             %args,
77             );
78             }
79              
80              
81             sub publicize {
82 5     5 1 3707 my ( $self, %args ) = @_;
83 5 100       23 croak 'Missing key in parameters: org' unless $args{org};
84 4 100       20 croak 'Missing key in parameters: user' unless $args{user};
85             return $self->request(
86             method => 'PUT',
87 3         27 path => sprintf( '/orgs/%s/public_members/%s', delete $args{org}, delete $args{user} ),
88             %args,
89             );
90             }
91              
92             1;
93              
94             __END__